class
Memo::Dialect::Postgres
- Memo::Dialect::Postgres
- Memo::Dialect::Base
- Reference
- Object
Defined in:
memo/dialect/postgres.crConstant Summary
-
MIGRATION_LOCK =
1835363695_i64 -
Any constant shared by every memo process ("memo" in ASCII)
-
SCHEMA_SQL =
{{ read_file("/home/trans/Projects/memo/src/memo/dialect/../../../db/schema/memo_schema_pg.sql") }}
Instance Method Summary
-
#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
Build FTS JOIN clause for search queries (joining a chunk's text).
-
#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
Two processes opening the database at once would otherwise both migrate it.
-
#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)
Build FTS JOIN clause for search queries (joining a chunk's text).
Build FTS WHERE clause for match queries.
Build INSERT OR IGNORE SQL.
Execute an INSERT and return the generated ID.
Two processes opening the database at once would otherwise both migrate it. The lock is released when the transaction ends.
Get schema DDL statements.
Build upsert SQL (INSERT OR REPLACE equivalent).