class
Memo::Dialect::SQLite
- Memo::Dialect::SQLite
- Memo::Dialect::Base
- Reference
- Object
Defined in:
memo/dialect/sqlite.crConstant Summary
-
SCHEMA_SQL =
{{ read_file("/home/trans/Projects/memo/src/memo/dialect/../../../db/schema/memo_schema.sql") }}
Instance Method Summary
- #column_exists?(db : DBHandle, table : String, column : String) : Bool
-
#database_name(db : DB::Database) : String | Nil
The database's name on its server, for naming index files.
-
#db_file_path(db : DB::Database) : String | Nil
Get the database file path from a connection, if applicable.
-
#drop_legacy_texts(db : DBHandle) : Nil
Drop the tables content-addressed storage replaced (memo_texts and its full-text index).
-
#embedding_rowid_column : String
The column name for embedding row identity used as USearch key.
-
#fts_join_sql : String
memo_contents_fts is an external-content table: rows are keyed by the content's id, and MATCH looks them up without a second copy
-
#fts_where_sql : String
Build FTS WHERE clause for match queries.
-
#insert_or_ignore_sql(table : String, columns : String, placeholders : String) : String
Build INSERT OR IGNORE SQL.
-
#insert_returning_id(db : DBHandle, sql : String, *args) : Int64
Execute an INSERT and return the generated ID.
-
#lock_for_migration(db : DB::Connection) : Nil
BEGIN IMMEDIATE already holds the write lock
-
#prepare(db : DB::Database) : Nil
Databases from before 0.13: add content_id to memo_sources and memo_chunks, which the schema's indexes need.
-
#schema_statements : Array(String)
Get schema DDL statements.
- #table_exists?(db : DBHandle, table : String) : Bool
-
#upsert_sql(table : String, columns : String, placeholders : String, conflict_columns : String, update_columns : Array(String)) : String
Build upsert SQL (INSERT OR REPLACE equivalent).
Instance methods inherited from class Memo::Dialect::Base
database_name(db : DB::Database) : String | Nil
database_name,
db_file_path(db : DB::Database) : String | Nil
db_file_path,
drop_legacy_texts(db : DBHandle) : Nil
drop_legacy_texts,
embedding_rowid_column : String
embedding_rowid_column,
fts_join_sql : String
fts_join_sql,
fts_where_sql : String
fts_where_sql,
insert_or_ignore_sql(table : String, columns : String, placeholders : String) : String
insert_or_ignore_sql,
insert_returning_id(db : DBHandle, sql : String, *args) : Int64
insert_returning_id,
lock_for_migration(db : DB::Connection) : Nil
lock_for_migration,
prepare(db : DB::Database) : Nil
prepare,
schema_statements : Array(String)
schema_statements,
table_exists?(db : DBHandle, table : String) : Bool
table_exists?,
upsert_sql(table : String, columns : String, placeholders : String, conflict_columns : String, update_columns : Array(String)) : String
upsert_sql
Instance Method Detail
The database's name on its server, for naming index files.
SQLite: nil (the file names it) PostgreSQL: current_database()
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)
memo_contents_fts is an external-content table: rows are keyed by the content's id, and MATCH looks them up without a second copy
Build FTS WHERE clause for match queries.
Build INSERT OR IGNORE SQL.
Execute an INSERT and return the generated ID.
Databases from before 0.13: add content_id to memo_sources and memo_chunks, which the schema's indexes need. The transaction takes the write lock first (BEGIN IMMEDIATE), so a second process opening the database waits, then finds the columns there.
Get schema DDL statements.
Build upsert SQL (INSERT OR REPLACE equivalent).