package migra

  1. Overview
  2. Docs
A database migration tool and library for OCaml supporting PostgreSQL, MariaDB/MySQL, and SQLite

Install

dune-project
 Dependency

Authors

Maintainers

Sources

migra-1.0.1.tbz
sha256=daaaab416e580e5b8dc9f0a74482e142cef6d77b248d995d320f6f882d3a9e35
sha512=8f60494b9ee6ac2e7e69a16eefce69d1e8c22e831fe28f600a42200e3086e2f4d15331323ad1848f7165e1c8ff30fe320445185b7e988325588293a66937966a

doc/migra.engine/Migra_engine/Dialect/index.html

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