Memo::Dialect::Base
Abstract interface for SQL dialect differences between SQLite and PostgreSQL.
Most SQL in Memo is cross-database compatible. This module only abstracts the patterns that differ:
- Insert-and-return-ID (last_insert_rowid vs RETURNING)
- Conflict handling (INSERT OR IGNORE, INSERT OR REPLACE)
- Implicit rowid (SQLite) vs explicit column (PostgreSQL)
- FTS5 (SQLite) vs tsvector/GIN (PostgreSQL)
- Schema DDL (AUTOINCREMENT, BLOB, REAL types)
- DB path discovery (pragma vs connection string)
Instance methods
Get the database file path from a connection, if applicable.
SQLite: reads pragma_database_list PostgreSQL: returns nil (no local file)
Drop the tables content-addressed storage replaced (memo_texts and its full-text index).
The column name for embedding row identity used as USearch key.
SQLite: "rowid" (implicit) PostgreSQL: "eid" (explicit column)
Build INSERT OR IGNORE SQL.
Execute an INSERT and return the generated ID.
Inside a migration's transaction: keep other processes from migrating the same database at the same time.
Bring existing tables up to date before the schema runs, where its statements depend on columns older databases lack.