Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Commit df98bfb

Browse files
hlcianfagnamfussenegger
authored andcommitted
Add support for camel case column names in target for insert-from-sql
1 parent a38da7f commit df98bfb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ Copies data from one CrateDB cluster or PostgreSQL server to another.
190190
... --query "SELECT name FROM x.demo" \
191191
... --hosts localhost:4200 \
192192
... --table y.demo \
193-
INSERT INTO y.demo (name) VALUES ($1)
193+
INSERT INTO y.demo ("name") VALUES ($1)
194194
Runtime (in ms):
195195
...
196196

cr8/insert_from_sql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
def mk_insert(table, attributes):
15-
columns = ', '.join((x.name for x in attributes))
15+
columns = ', '.join(('"' + x.name + '"' for x in attributes))
1616
params = ', '.join((f'${i + 1}' for i in range(len(attributes))))
1717
return f'INSERT INTO {table} ({columns}) VALUES ({params})'
1818

0 commit comments

Comments
 (0)