MCPcopy Create free account
hub / github.com/CL-lau/SQL-GPT / save

Method save

sql/orm.py:11–20  ·  view source on GitHub ↗
(self, sql)

Source from the content-addressed store, hash-verified

9 self.data_file = data_file
10
11 def save(self, sql):
12 if os.path.exists(self.data_file):
13 with open(self.data_file, 'ab+') as f:
14 pickle.dump(sql, f)
15 f.write(b'\n')
16 # 如果文件不存在,则创建新文件并写入数据
17 else:
18 with open(self.data_file, 'wb+') as f:
19 pickle.dump(sql, f)
20 f.write(b'\n')

Callers 1

processSQLMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected