Module Migra_engine.DialectSource

Sourcetype t =
  1. | PostgreSQL
  2. | MariaDB
  3. | SQLite
Sourcemodule type DIALECT = sig ... end
Sourceval normalize_url : string -> string

Normalize database URL for Caqti compatibility

SQLite: caqti-driver-sqlite3 expects sqlite3:path (single colon), not sqlite3://path We accept both formats for user convenience but normalize to what Caqti expects.

  • parameter url

    Database URL

  • returns

    Normalized URL

Sourceval detect_from_url : string -> (t, string) result

Detect database type from URL scheme

  • parameter url

    Database URL (e.g., "postgresql://...", "sqlite3://...")

  • returns

    Ok dialect or Error message for unsupported schemes

Sourceval get_dialect : t -> (module DIALECT)

Get dialect module for database type

  • parameter db_type

    Database type

  • returns

    First-class module implementing DIALECT

Sourceval to_string : t -> string

Pretty-print database type

  • parameter t

    Database type

  • returns

    Human-readable string