DbUnify.SQLite3 package
Subpackages
- DbUnify.SQLite3.aio package
- DbUnify.SQLite3.data package
- Submodules
- DbUnify.SQLite3.data.Rules module
- DbUnify.SQLite3.data.Type module
DataTypeDataType.BIGINTDataType.BLOBDataType.BOOLEANDataType.CHARACTER()DataType.CLOBDataType.DATEDataType.DATETIMEDataType.DECIMAL()DataType.DOUBLEDataType.DOUBLE_PRECISIONDataType.FLOATDataType.INTDataType.INT2DataType.INT8DataType.INTEGERDataType.MEDIUMINTDataType.NATIVE_CHARACTER()DataType.NCHAR()DataType.NONEDataType.NUMERICDataType.NVARCHAR()DataType.REALDataType.SMALLINTDataType.TEXTDataType.TINYINTDataType.UNSIGNED_BIG_INTDataType.VARCHAR()DataType.VARYING_CHARACTER()
- Module contents
- DbUnify.SQLite3.sync package
Submodules
DbUnify.SQLite3.Cache module
- class DbUnify.SQLite3.Cache.Cache(ttl: int = 60)[source]
Bases:
objectCache Class
The Cache class provides methods for storing and retrieving query results in a cache to improve performance. It supports automatic cache expiration based on a time-to-live (TTL) value.
- cache
A dictionary to store cached query results and their expiration times.
- Type:
Dict[str, Tuple[Any, float]]
- ttl
Time-to-live for cache entries in seconds.
- Type:
int
- get(key: str) Any[source]
Retrieve a query result from the cache if it exists and is not expired.
- Parameters:
key (str) – The cache key, usually the query string.
- Returns:
The cached query result, or None if the cache entry does not exist or is expired.
- Return type:
Any