5.3 KiB
5.3 KiB
Changelog
All notable changes to this project will be documented in this file.
[Unreleased]
[1.2.0] - 2026-06-04
Added
- Parametrized queries (R1) —
execute(sql, params)accepts positional (?tuple/list) and named (:namedict) parameters; passed straight to SQLite during in-memory filtering. Cache loads still fetch the full table (parameters are not applied to source fetches). - JOIN support (R2) — multi-table SELECTs are parsed into per-table column sets; each table is cached independently and the JOIN runs in the in-memory SQLite. Columns in a multi-table query must be qualified by table or alias.
SELECT *support (R3) — wildcard (andalias.*) queries discover all columns from the source DB, cache the whole table, and mark itis_fullso later column queries are guaranteed cache hits without re-fetch.- Three-part table names (R4) —
[catalog].[schema].[table]is parsed to its base name for caching; the in-memory query is rewritten to strip catalog/schema prefixes so it runs under SQLite. SQLMEM_SQL_DIALECTenv var (defaulttsql) — sqlglot dialect used to parse incoming SQL; T-SQL also accepts ANSI SQL and MSSQL bracket quoting.CacheManager.discover_columns()andCacheManager.is_table_full();load_table()gained afullflag.
Changed
pyproject.toml— bumped version to1.2.0parser.py—ParsedQuery.table: strreplaced bytables: list[str]pluscolumns_by_table,sqlite_sql,params, andwildcard_tables; SQL is parsed with the configured dialect and rendered to SQLite for execution.executor.py— loads each referenced table independently and applies query parameters during in-memory execution.cache.py— schema version bumped to2;_sqlmem_tablesgained anis_fullcolumn (existing on-disk caches are discarded and rebuilt on load).
[1.1.0] - 2026-06-03
Added
StatsandTableStatsfrozen dataclasses — snapshot of runtime cache statistics (hit/miss/refetch counts, per-table row count, columns, last refresh timestamp)StatsCollector— internal thread-safe counter; increments on every cache hit, miss, and re-fetchengine.statsproperty — returns aStatssnapshot at any point in timeStatsandTableStatsexported from the public API
Changed
pyproject.toml— bumped version to1.1.0
[1.0.0] - 2026-06-03
Changed
pyproject.toml— bumped version to1.0.0
[0.4.0] - 2026-06-03
Added
add_sink(sink, *, level, **kwargs)— public API for routing sqlmem log records to any loguru-compatible sink (stream, file, callable); supports all logurulogger.add()kwargs includingrotation,retention, etc.
Changed
pyproject.toml— bumped version to0.4.0config.py— replaced destructivelogger.remove()+ forced default sink withlogger.disable("sqlmem"); sqlmem is now silent by default and does not interfere with the host application's logging setup
[0.3.0] - 2026-06-03
Added
README.md— full project documentation: architecture overview, quick start, cache behaviour, persistence, configuration, exceptions, logging, and limitations
Changed
pyproject.toml— bumped version to0.3.0parser.py—_extract_columnsnow deduplicates column names while preserving order.gitignore— added.envand.env.*to prevent accidental commit of environment files
Security
- Removed
.envfrom git tracking (git rm --cached)
[0.2.0] - 2026-06-01
Added
- Project specification in
project.md— architecture, API design, cache backend, metadata schema, logging strategy, and TODO for future features (JOIN, SELECT * support) .gitignorefor Python/Poetry projectpyproject.tomldependencies:sqlglot,sqlalchemy,loguru,python-dotenv; dev dependencies:pytest,ruff,mypysrc/sqlmem/package structure with src layoutsrc/sqlmem/exceptions.py—ReadOnlyError(blocks INSERT/UPDATE/DELETE),UnsupportedQueryError(blocks JOIN and SELECT *)src/sqlmem/config.py— loads.env, configuresloguruwith DEBUG/INFO level based onSQLMEM_DEBUGsrc/sqlmem/_meta.py— package version constantsrc/sqlmem/parser.py— SQL Parser usingsqlglot; extracts table and columns from SELECT, raises on writes/JOIN/wildcardsrc/sqlmem/registry.py— Column Registry; accumulates requested columns per table, detects missing columns requiring re-fetchsrc/sqlmem/cache.py— Cache Manager; SQLite in-memory storage, load fromcache.dbon startup (with schema version check), hourly backup thread,atexit/SIGTERM flush, metadata tables (_sqlmem_meta,_sqlmem_tables,_sqlmem_columns)src/sqlmem/executor.py— Query Executor; cache hit/miss logic, re-fetch on new columns with WARNING logsrc/sqlmem/engine.py—CachingEnginewrapper; public API compatible with SQLAlchemy,invalidate(table)for manual cache clearingsrc/sqlmem/__init__.py— public exports:CachingEngine,ReadOnlyError,UnsupportedQueryErrortests/test_parser.py— parser tests: SELECT parsing, ReadOnlyError, UnsupportedQueryErrortests/test_cache.py— cache tests: load, data correctness, metadata, disk backup/reloadtests/test_registry.py— registry tests: accumulation, needs_refetch, table isolation