db.table_store ============== .. py:module:: db.table_store .. autoapi-nested-parse:: 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 --------- .. autoapisummary:: db.table_store.quote_identifier db.table_store.create_text_table db.table_store.insert_text_rows db.table_store.fetch_text_rows Module Contents --------------- .. py:function:: quote_identifier(identifier) Validate and quote a SQLite identifier. :param identifier: Unquoted table or column identifier. :returns: Quoted identifier safe for SQL string interpolation. :raises ValueError: If identifier contains unsafe characters. .. py:function:: create_text_table(conn, table_name) Create one physical text table for imported txt rows. The table schema is intentionally minimal: - ``id``: surrogate primary key - ``line_number``: source txt line number - ``value``: trimmed non-empty line value .. py:function:: insert_text_rows(conn, table_name, rows) Insert parsed txt rows into a physical text table. .. py:function:: fetch_text_rows(conn, table_name, *, offset, limit) Fetch paginated rows from one physical txt table. :param conn: Open SQLite connection. :param table_name: Validated physical table name. :param offset: Zero-based row offset. :param limit: Maximum rows to return. :returns: List of ``{"line_number": int, "value": str}`` mappings.