feat: autocommit session
parent
915f3c2a4c
commit
4a3d43bcc5
|
@ -47,7 +47,8 @@ class WriteToPostgreSQL(beam.DoFn):
|
||||||
self.table_key = table_key
|
self.table_key = table_key
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
self.connection = psycopg2.connect(**self.connection_details, autocommit=True)
|
self.connection = psycopg2.connect(**self.connection_details)
|
||||||
|
self.connection.autocommit = True
|
||||||
|
|
||||||
def execute_insert(self, row, cursor):
|
def execute_insert(self, row, cursor):
|
||||||
colnames = ",".join(row.keys())
|
colnames = ",".join(row.keys())
|
||||||
|
|
Loading…
Reference in New Issue