MCPcopy Create free account
hub / github.com/JafarAkhondali/Morefixes / run_sql_script

Method run_sql_script

prospector/commitdb/postgres.py:105–116  ·  view source on GitHub ↗
(self, script_file)

Source from the content-addressed store, hash-verified

103 self.run_sql_script("ddl/20_users.sql")
104
105 def run_sql_script(self, script_file):
106 if not self.connection:
107 raise Exception("Invalid connection")
108
109 with open(script_file, "r") as file:
110 ddl = file.read()
111
112 cursor = self.connection.cursor()
113 cursor.execute(ddl)
114 self.connection.commit()
115
116 cursor.close()
117
118
119def parse_connect_string(connect_string):

Callers 1

resetMethod · 0.95

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected