SqliteCacheManager¶
-
class
privex.helpers.cache.post_deps.
SqliteCacheManager
(db: str = None, isolation_level=None, **kwargs)[source]¶ -
__init__
(db: str = None, isolation_level=None, **kwargs) - Parameters
db (str) – Relative / absolute path to SQLite3 database file to use.
isolation_level – Isolation level for SQLite3 connection. Defaults to
None
(autocommit). See the Python SQLite3 Docs for more information.
- Key int db_timeout
Amount of time to wait for any SQLite3 locks to expire before giving up
- Key str query_mode
Either
'flat'
(query returns tuples) or'dict'
(query returns dicts). More details in PyDoc block underquery_mode
- Key bool memory_persist
Use a shared in-memory database, which can be accessed by other instances of this class (in this process) - which is cleared after all memory connections are closed. Shortcut for
db='file::memory:?cache=shared'
-
property
conn
¶ Get or create an SQLite3 connection using DB file
db
and return it
-
make_connection
(*args, **kwargs) → sqlite3.Connection[source]¶ Creates a database connection using
connector_func
, passing all arguments/kwargs directly to the connector function.- Return GenericConnection conn
A database connection object, which should implement at least the basic connection object methods as specified in the Python DB API (PEP 249), and in the Protocol type class
GenericConnection
-
Methods¶
Methods
|
|
|
|
|
|
|
|
|
|
|
Creates a database connection using |
|
|
|