module Memo::Database

Overview

Database initialization and schema management

Extended Modules

Defined in:

memo/database.cr

Instance Method Summary

Instance Method Detail

def create(path : String) : DB::Database #

Create database connection and initialize schema (standalone mode)

Accepts either a file path (SQLite) or connection string (postgres://...). Sets the appropriate dialect automatically.


[View source]
def init(db : DB::Database) #

Initialize Memo schema in provided database

Uses the dialect attached to the db connection to generate the correct DDL for the backend (SQLite or PostgreSQL). Safe to call multiple times (uses IF NOT EXISTS)


[View source]
def load_schema(db : DB::Database) #

Load memo schema into the provided database (embedded mode) Safe to call multiple times (uses IF NOT EXISTS)


[View source]