本文整理汇总了Python中sqlitedict.SqliteDict.get_tablenames方法的典型用法代码示例。如果您正苦于以下问题:Python SqliteDict.get_tablenames方法的具体用法?Python SqliteDict.get_tablenames怎么用?Python SqliteDict.get_tablenames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sqlitedict.SqliteDict
的用法示例。
在下文中一共展示了SqliteDict.get_tablenames方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_tablenames
# 需要导入模块: from sqlitedict import SqliteDict [as 别名]
# 或者: from sqlitedict.SqliteDict import get_tablenames [as 别名]
def test_tablenames(self):
fname = norm_file('tests/db/tablenames-test-1.sqlite')
SqliteDict(fname)
self.assertEqual(SqliteDict.get_tablenames(fname), ['unnamed'])
fname = norm_file('tests/db/tablenames-test-2.sqlite')
with SqliteDict(fname,tablename='table1') as db1:
self.assertEqual(SqliteDict.get_tablenames(fname), ['table1'])
with SqliteDict(fname,tablename='table2') as db2:
self.assertEqual(SqliteDict.get_tablenames(fname), ['table1','table2'])
tablenames = SqliteDict.get_tablenames('tests/db/tablenames-test-2.sqlite')
self.assertEqual(tablenames, ['table1','table2'])
示例2: list
# 需要导入模块: from sqlitedict import SqliteDict [as 别名]
# 或者: from sqlitedict.SqliteDict import get_tablenames [as 别名]
def list(self, table) -> List[str]:
''' Return all tables name in db. '''
return SqliteDict.get_tablenames(table)