db.table_store
Low-level helpers for dynamic imported text tables.
Each imported *.txt file gets mapped to one physical SQLite table.
This module owns identifier safety and row-level table operations.
Functions
|
Validate and quote a SQLite identifier. |
|
Create one physical text table for imported txt rows. |
|
Insert parsed txt rows into a physical text table. |
|
Fetch paginated rows from one physical txt table. |
Module Contents
- db.table_store.quote_identifier(identifier)
Validate and quote a SQLite identifier.
- Parameters:
identifier (str) – Unquoted table or column identifier.
- Returns:
Quoted identifier safe for SQL string interpolation.
- Raises:
ValueError – If identifier contains unsafe characters.
- Return type:
- db.table_store.create_text_table(conn, table_name)
Create one physical text table for imported txt rows.
The table schema is intentionally minimal:
id: surrogate primary keyline_number: source txt line numbervalue: trimmed non-empty line value
- db.table_store.insert_text_rows(conn, table_name, rows)
Insert parsed txt rows into a physical text table.
- db.table_store.fetch_text_rows(conn, table_name, *, offset, limit)
Fetch paginated rows from one physical txt table.