We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e59be2 commit 25ff7cbCopy full SHA for 25ff7cb
target_postgres/sinks.py
@@ -259,6 +259,25 @@ def column_representation(
259
)
260
return columns
261
262
+ def generate_copy_statement(
263
+ self,
264
+ full_table_name: str,
265
+ columns: List[sa.Column],
266
+ ) -> str:
267
+ """Generate a copy statement for bulk copy.
268
+
269
+ Args:
270
+ full_table_name: the target table name.
271
+ columns: the target table columns.
272
273
+ Returns:
274
+ A copy statement.
275
+ """
276
+ columns_list = ", ".join((f'"{column.name}"' for column in columns))
277
+ sql: str = f"copy {full_table_name} ({columns_list}) from stdin with csv"
278
279
+ return sql
280
281
def generate_insert_statement(
282
self,
283
full_table_name: str,
0 commit comments