Revision 833
Added by Aaron Marcuse-Kubitza almost 13 years ago
lib/sql.py | ||
---|---|---|
172 | 172 |
elif module == 'MySQLdb': return values(run_query(db, 'SHOW TABLES')) |
173 | 173 |
else: raise NotImplementedError("Can't list tables for "+module+' database') |
174 | 174 |
|
175 |
##### Database management |
|
176 |
|
|
177 |
def empty_db(db): |
|
178 |
for table in tables(db): truncate(db, table) |
|
179 |
|
|
175 | 180 |
##### Heuristic queries |
176 | 181 |
|
177 | 182 |
def try_insert(db, table, row): |
... | ... | |
208 | 213 |
if not create: raise |
209 | 214 |
return put(db, table, row, pkey, row_ct_ref) # insert new row |
210 | 215 |
|
211 |
##### Database management |
|
212 |
|
|
213 |
def empty_db(db): |
|
214 |
for table in tables(db): truncate(db, table) |
|
215 |
|
|
216 | 216 |
##### Database connections |
217 | 217 |
|
218 | 218 |
db_engines = { |
Also available in: Unified diff
sql.py: Added documentation labels to each section