Skip to content

Sqlite

blackline.models.sqlite.sqlite

SQLiteConnectionConfig

Bases: ConnectionConfig

A data model representing a connection configuration for a SQLite database.

Parameters:

Name Type Description Default
database str The name or path to the SQLite database file. required
timeout float The number of seconds to wait before timing out the connection. 5.0
detect_types int The type detection flags to use when parsing column types. 0
isolation_level str The isolation level to use for the connection. DEFERRED
check_same_thread bool Whether to check if the connection is being used in the same thread it was created in. True
factory Any required
cached_statements int The maximum number of prepared statements to cache. 100
uri bool Whether to use a URI-style connection string. False
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/sqlite/sqlite.py
class SQLiteConnectionConfig(ConnectionConfig):
    """
    A data model representing a connection configuration for a SQLite database.
    """

    database: str = Field(
        ..., description="The name or path to the SQLite database file."
    )
    timeout: float = Field(
        default=5.0,
        description="The number of seconds to wait before timing out the connection.",
    )
    detect_types: int = Field(
        default=0,
        description="The type detection flags to use when parsing column types.",
    )
    isolation_level: str = Field(
        default="DEFERRED",
        description="The isolation level to use for the connection.",
    )
    check_same_thread: bool = Field(
        default=True,
        description="Whether to check if the connection is being used in the same thread it was created in.",  # noqa: E501
    )
    factory: Any = Field(
        default=Connection,
        description="The name of the factory function to use for creating the connection.",  # noqa: E501
    )
    cached_statements: int = Field(
        default=100,
        description="The maximum number of prepared statements to cache.",
    )
    uri: bool = Field(
        default=False, description="Whether to use a URI-style connection string."
    )

    class Config:
        env_prefix = ""

SQLiteDataStore

Bases: DataStoreBase

A data model representing the configuration for the SQLite adapter.

Parameters:

Name Type Description Default
Config BaseModel

A nested BaseModel class representing the SQLite connection configuration. # noqa: E501

required

Returns:

Name Type Description
SQLiteDataStore

An instance of the SQLiteDataStore class.

Parameters:

Name Type Description Default
type Literal['sqlite'] The type of adapter. required
config Config The configuration for the adapter. required
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/sqlite/sqlite.py
class SQLiteDataStore(DataStoreBase):
    """
    A data model representing the configuration for the SQLite adapter.

    Args:
        Config (BaseModel): A nested BaseModel class representing the SQLite connection configuration.  # noqa: E501

    Returns:
        SQLiteDataStore: An instance of the SQLiteDataStore class.

    """

    class Config(BaseModel):
        connection: SQLiteConnectionConfig = Field(
            ..., description="The connection configuration for the adapter."
        )

    type: Literal["sqlite"] = Field(..., description="The type of adapter.")
    config: Config = Field(..., description="The configuration for the adapter.")