From aedd10b0dde0aef1dd61790098d00650e2b74926 Mon Sep 17 00:00:00 2001 From: Deji Ibrahim <31637316+dejii@users.noreply.github.com> Date: Fri, 29 Nov 2024 13:58:22 +0100 Subject: [PATCH] fix: wrap bq column names in backticks --- pg_replicate/src/clients/bigquery.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pg_replicate/src/clients/bigquery.rs b/pg_replicate/src/clients/bigquery.rs index 5ca9203..c70beda 100644 --- a/pg_replicate/src/clients/bigquery.rs +++ b/pg_replicate/src/clients/bigquery.rs @@ -132,7 +132,9 @@ impl BigQueryClient { } fn column_spec(column_schema: &ColumnSchema, s: &mut String) { + s.push('`'); s.push_str(&column_schema.name); + s.push('`'); s.push(' '); let typ = Self::postgres_to_bigquery_type(&column_schema.typ); s.push_str(typ); @@ -147,7 +149,9 @@ impl BigQueryClient { s.push_str("primary key ("); for column in identity_columns { + s.push('`'); s.push_str(&column.name); + s.push('`'); s.push(','); }