Skip to content

Commit cd3d4e3

Browse files
make sql lowercase
1 parent 9cb586f commit cd3d4e3

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

etl/src/test_utils/test_schema.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,12 @@ pub async fn create_partitioned_table<G: GenericClient>(
140140
partition_specs: &[(&str, &str)], // (partition_name, partition_constraint)
141141
) -> Result<(TableId, Vec<TableId>), tokio_postgres::Error> {
142142
let create_parent_query = format!(
143-
"CREATE TABLE {} (
143+
"create table {} (
144144
id bigserial,
145145
data text NOT NULL,
146146
partition_key integer NOT NULL,
147-
PRIMARY KEY (id, partition_key)
148-
) PARTITION BY RANGE (partition_key)",
147+
primary key (id, partition_key)
148+
) partition by range (partition_key)",
149149
table_name.as_quoted_identifier()
150150
);
151151

@@ -156,8 +156,8 @@ pub async fn create_partitioned_table<G: GenericClient>(
156156
.as_ref()
157157
.unwrap()
158158
.query_one(
159-
"SELECT c.oid FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace
160-
WHERE n.nspname = $1 AND c.relname = $2",
159+
"select c.oid from pg_class c join pg_namespace n on n.oid = c.relnamespace
160+
where n.nspname = $1 and c.relname = $2",
161161
&[&table_name.schema, &table_name.name],
162162
)
163163
.await?;
@@ -172,7 +172,7 @@ pub async fn create_partitioned_table<G: GenericClient>(
172172
);
173173

174174
let create_partition_query = format!(
175-
"CREATE TABLE {} PARTITION OF {} FOR VALUES {}",
175+
"create table {} partition of {} for values {}",
176176
partition_table_name.as_quoted_identifier(),
177177
table_name.as_quoted_identifier(),
178178
partition_constraint
@@ -185,8 +185,8 @@ pub async fn create_partitioned_table<G: GenericClient>(
185185
.as_ref()
186186
.unwrap()
187187
.query_one(
188-
"SELECT c.oid FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace
189-
WHERE n.nspname = $1 AND c.relname = $2",
188+
"select c.oid from pg_class c join pg_namespace n on n.oid = c.relnamespace
189+
where n.nspname = $1 and c.relname = $2",
190190
&[&partition_table_name.schema, &partition_table_name.name],
191191
)
192192
.await?;

etl/tests/partitioned_table_test.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ async fn partitioned_table_sync_succeeds_with_inherited_primary_keys() {
1717

1818
let table_name = test_table_name("partitioned_events");
1919
let partition_specs = [
20-
("p1", "FROM (1) TO (100)"),
21-
("p2", "FROM (100) TO (200)"),
22-
("p3", "FROM (200) TO (300)"),
20+
("p1", "from (1) to (100)"),
21+
("p2", "from (100) to (200)"),
22+
("p3", "from (200) to (300)"),
2323
];
2424

2525
let (parent_table_id, partition_table_ids) =
@@ -29,7 +29,7 @@ async fn partitioned_table_sync_succeeds_with_inherited_primary_keys() {
2929

3030
database
3131
.run_sql(&format!(
32-
"INSERT INTO {} (data, partition_key) VALUES
32+
"insert into {} (data, partition_key) values
3333
('event1', 50), ('event2', 150), ('event3', 250)",
3434
table_name.as_quoted_identifier()
3535
))

0 commit comments

Comments
 (0)