neosqlite.options module¶
- class neosqlite.options.WriteConcern(w: int | str | None = None, wtimeout: int | None = None, j: bool | None = None, fsync: bool | None = None)[source]¶
Bases:
objectRepresents a write concern for MongoDB compatibility. Maps to SQLite synchronous PRAGMAs.
- __init__(w: int | str | None = None, wtimeout: int | None = None, j: bool | None = None, fsync: bool | None = None)[source]¶
- property document: dict[str, Any]¶
- property acknowledged: bool¶
- class neosqlite.options.ReadPreference(mode: int, tag_sets: list | None = None, max_staleness_ms: int | None = None, hedge: dict | None = None)[source]¶
Bases:
objectRepresents a read preference for MongoDB compatibility. (Mostly a placeholder in NeoSQLite as SQLite is single-node).
- PRIMARY = 0¶
- PRIMARY_PREFERRED = 1¶
- SECONDARY = 2¶
- SECONDARY_PREFERRED = 3¶
- NEAREST = 4¶
- __init__(mode: int, tag_sets: list | None = None, max_staleness_ms: int | None = None, hedge: dict | None = None)[source]¶
- property mode: int¶
- property document: dict[str, Any]¶
- class neosqlite.options.ReadConcern(level: str | None = None)[source]¶
Bases:
objectRepresents a read concern for MongoDB compatibility.
- property level: str | None¶
- property ok_for_legacy: bool¶
- property document: dict[str, Any]¶
- class neosqlite.options.CodecOptions(document_class: type = <class 'dict'>, tz_aware: bool = False, uuid_representation: int = 0)[source]¶
Bases:
objectRepresents codec options for MongoDB compatibility.
- class neosqlite.options.JournalMode[source]¶
Bases:
objectRepresents valid SQLite journal modes. Used to validate the journal_mode parameter in Connection.
- DELETE = 'DELETE'¶
- TRUNCATE = 'TRUNCATE'¶
- PERSIST = 'PERSIST'¶
- MEMORY = 'MEMORY'¶
- WAL = 'WAL'¶
- OFF = 'OFF'¶
- class neosqlite.options.AutoVacuumMode[source]¶
Bases:
objectRepresents SQLite auto_vacuum modes. Controls how SQLite reclaims space after deleting data.
- NONE = 0¶
- FULL = 1¶
- INCREMENTAL = 2¶
- classmethod validate(mode: int | str) int[source]¶
Validate and normalize an auto_vacuum mode.
- Parameters:
mode – The auto_vacuum mode (0, 1, 2) or string (“NONE”, “FULL”, “INCREMENTAL”).
- Returns:
The normalized auto_vacuum mode value.
- Return type:
int
- Raises:
ValueError – If the auto_vacuum mode is not valid.