GitHub

SqliteClientConfig

API reference for SqliteClientConfig.

How to open the database.

  • filename: a path, ":memory:", or a file: URI (its parameters, such as ?immutable=1, apply)
  • readonly: open it read-only (and start transactions with a plain BEGIN; otherwise BEGIN IMMEDIATE)
  • prepare_cache_size: how many prepared statements to keep
  • disable_wal: keep the journal mode; otherwise switch to WAL
  • busy_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 span
  • transform_result_names / transform_query_names: rename result columns / identifiers (fx.case has the usual ones)

Attributes

AttributeTypeDescription
filenamestr
readonlybool = False
prepare_cache_sizeint = 200
disable_walbool = False
busy_timeoutDurationInput = '5 seconds'
span_attributesMapping[str, object] = field(default_factory=(dict[str, object]))
transform_result_namesCallable[[str], str] | None = None
transform_query_namesCallable[[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
ParameterTypeDescription
filenamestr
readonlybool = False
prepare_cache_sizeint = 200
disable_walbool = False
busy_timeoutDurationInput = '5 seconds'
span_attributesMapping[str, object] = dict[str, object]()
transform_result_namesCallable[[str], str] | None = None
transform_query_namesCallable[[str], str] | None = None