class Memo::Dialect::SQLite

Defined in:

memo/dialect/sqlite.cr

Constant Summary

SCHEMA_SQL = {{ read_file("/srv/crystaldoc.info/github-trans-memo-v0.11.6/src/memo/dialect/../../../db/schema/memo_schema.sql") }}

Instance Method Summary

Instance methods inherited from class Memo::Dialect::Base

db_file_path(db : DB::Database) : String | Nil db_file_path, embedding_rowid_column : String embedding_rowid_column, fts_delete(db : DB::Database, source_id : Int64) fts_delete, fts_join_sql : String fts_join_sql, fts_upsert(db : DB::Database, source_id : Int64, content : String) fts_upsert, 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 : DB::Database, sql : String, *args) : Int64 insert_returning_id, schema_statements : Array(String) schema_statements, upsert_sql(table : String, columns : String, placeholders : String, conflict_columns : String, update_columns : Array(String)) : String upsert_sql

Instance Method Detail

def db_file_path(db : DB::Database) : String | Nil #
Description copied from class Memo::Dialect::Base

Get the database file path from a connection, if applicable.

SQLite: reads pragma_database_list PostgreSQL: returns nil (no local file)


[View source]
def embedding_rowid_column : String #
Description copied from class Memo::Dialect::Base

The column name for embedding row identity used as USearch key.

SQLite: "rowid" (implicit) PostgreSQL: "eid" (explicit column)


[View source]
def fts_delete(db : DB::Database, source_id : Int64) #
Description copied from class Memo::Dialect::Base

Delete FTS index entry for a source.


[View source]
def fts_join_sql : String #
Description copied from class Memo::Dialect::Base

Build FTS JOIN clause for search queries.


[View source]
def fts_upsert(db : DB::Database, source_id : Int64, content : String) #
Description copied from class Memo::Dialect::Base

Insert or update FTS index for a source.


[View source]
def fts_where_sql : String #
Description copied from class Memo::Dialect::Base

Build FTS WHERE clause for match queries.


[View source]
def insert_or_ignore_sql(table : String, columns : String, placeholders : String) : String #
Description copied from class Memo::Dialect::Base

Build INSERT OR IGNORE SQL.


[View source]
def insert_returning_id(db : DB::Database, sql : String, *args) : Int64 #
Description copied from class Memo::Dialect::Base

Execute an INSERT and return the generated ID.


[View source]
def schema_statements : Array(String) #
Description copied from class Memo::Dialect::Base

Get schema DDL statements.


[View source]
def upsert_sql(table : String, columns : String, placeholders : String, conflict_columns : String, update_columns : Array(String)) : String #
Description copied from class Memo::Dialect::Base

Build upsert SQL (INSERT OR REPLACE equivalent).


[View source]