module
Memo::Database
Overview
Database initialization and schema management
Memo can operate in two modes:
- Standalone: Memo has its own memo.db file, no table prefix needed
- Embedded: Tables in app's database with prefix (default "memo_")
Extended Modules
Defined in:
memo/database.crInstance Method Summary
-
#create(path : String) : DB::Database
Create new database file and initialize schema (standalone mode)
-
#init(db : DB::Database)
Initialize Memo schema in provided database
-
#load_schema(db : DB::Database)
Load memo schema into the provided database (embedded mode)
Instance Method Detail
Create new database file and initialize schema (standalone mode)
Creates a new SQLite database at the specified path and loads Memo schema. Returns the database connection.
Initialize Memo schema in provided database
Loads consolidated schema with table prefix applied. Safe to call multiple times (uses IF NOT EXISTS)
Load memo schema into the provided database (embedded mode)
Creates tables with configured prefix (e.g., memo_embeddings, memo_chunks) Use when Memo shares database with application tables. Safe to call multiple times (uses IF NOT EXISTS)