How to open the database.
filename: a path,":memory:", or afile:URI (its parameters, such as?immutable=1, apply)readonly: open it read-only (and start transactions with a plainBEGIN; otherwiseBEGIN IMMEDIATE)prepare_cache_size: how many prepared statements to keepdisable_wal: keep the journal mode; otherwise switch to WALbusy_timeout: how long SQLite waits on a locked database (5 seconds; infinite is clamped to SQLite's maximum). The wait happens on the connection's thread, not a fiber's.span_attributes: added to every statement's spantransform_result_names/transform_query_names: rename result columns / identifiers (fx.casehas the usual ones)
Attributes#
| Attribute | Type | Description |
|---|---|---|
filename | str | |
readonly | bool = False | |
prepare_cache_size | int = 200 | |
disable_wal | bool = False | |
busy_timeout | DurationInput = '5 seconds' | |
span_attributes | Mapping[str, object] = field(default_factory=(dict[str, object])) | |
transform_result_names | Callable[[str], str] | None = None | |
transform_query_names | Callable[[str], str] | None = None |
Functions#
__init__#
__init__(*, filename, readonly=False, prepare_cache_size=200, disable_wal=False, busy_timeout='5 seconds', span_attributes=dict[str, object](), transform_result_names=None, transform_query_names=None) -> None| Parameter | Type | Description |
|---|---|---|
filename | str | |
readonly | bool = False | |
prepare_cache_size | int = 200 | |
disable_wal | bool = False | |
busy_timeout | DurationInput = '5 seconds' | |
span_attributes | Mapping[str, object] = dict[str, object]() | |
transform_result_names | Callable[[str], str] | None = None | |
transform_query_names | Callable[[str], str] | None = None |