How to use the tinydb.TinyDB.table_class function in tinydb

To help you get started, we’ve selected a few tinydb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github msiemens / tinydb-smartcache / test_smartcache.py View on Github external
def test_custom_table_class_via_class_attribute(db):
    TinyDB.table_class = SmartCacheTable

    table = db.table('table3')
    assert isinstance(table, SmartCacheTable)

    TinyDB.table_class = Table
github msiemens / tinydb-smartcache / test_smartcache.py View on Github external
def db_smartcache():
    TinyDB.table_class = SmartCacheTable

    db_ = TinyDB(storage=MemoryStorage)
    table = db_.table('_default')

    table.insert_multiple({'int': 1, 'char': c} for c in 'abc')
    return table
github msiemens / tinydb-smartcache / test_smartcache.py View on Github external
def test_custom_table_class_via_class_attribute(db):
    TinyDB.table_class = SmartCacheTable

    table = db.table('table3')
    assert isinstance(table, SmartCacheTable)

    TinyDB.table_class = Table