MCPcopy Create free account
hub / github.com/google-research/language / empty_db

Function empty_db

language/xsp/data_utils/empty_database.py:26–42  ·  view source on GitHub ↗

Empty DB.

(name)

Source from the content-addressed store, hash-verified

24
25
26def empty_db(name):
27 """Empty DB."""
28 db = sqlite3.connect(name)
29 c = db.cursor()
30
31 q = ("select name from sqlite_master where type='table' and "
32 "name not like 'sqlite_%'")
33 c.execute(q)
34
35 table_names = [name[0] for name in c.fetchall()]
36 for name in table_names:
37 print('emptying ' + name)
38 q = 'delete from ' + name
39 c.execute(q)
40 db.commit()
41
42 db.close()
43
44
45def main(db_to_del):

Callers 1

mainFunction · 0.85

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…