bricks/examples/list_tables.dspy

16 lines
239 B
Plaintext
Raw Permalink Normal View History

2023-09-14 10:28:07 +08:00
db = DBPools();
if params_kw.get('page', '1') != '1':
print(params_kw)
return {
"total":"0",
"rows":[]
}
async with db.sqlorContext('kboss') as sor:
d = await sor.tables();
print(len(d))
return {
"total":len(d),
"rows":d
}