moonbitstack/moonorm/engine does not have a README file

    DsnError

    pub(all) suberror DsnError {
    DsnError(String)
    }

    Why a connection string could not be read.
    impl Show for DsnError

    DsnError::output

    fn DsnError::output(self : DsnError, logger : &Logger) -> Unit

    DsnError::to_string

    fn DsnError::to_string(self : DsnError) -> String

    Dsn

    pub(all) struct Dsn {
    scheme : String
    driver : String
    dialect :
    Dialect

    user : String?
    password : String?
    host : String?
    port : Int?
    database : String?
    params : Map[String, String]
    }

    A parsed connection string. The scheme picks the driver and the dialect; the rest is what a driver needs to connect. A +driver suffix (SQLAlchemy's postgresql+asyncpg://) overrides driver while leaving the scheme's dialect.

    Engine

    pub struct Engine {
    dsn : Dsn
    }

    A backend selected by its connection string: the parsed Dsn plus the dialect its sessions render for. session binds one to a driver the caller supplies.

    Engine::dialect

    The dialect the URL's scheme selects.

    Engine::driver

    fn Engine::driver(self : Engine) -> String

    The driver the URL names (the scheme, or its +driver override).

    Engine::dsn

    fn Engine::dsn(self : Engine) -> Dsn

    The parsed connection string.

    Engine::from_dsn

    fn Engine::from_dsn(dsn : Dsn) -> Engine

    An Engine over an already parsed Dsn.

    Engine::new

    fn Engine::new(dsn : String) -> Engine raise DsnError

    Parse dsn into an Engine. The URL's scheme picks the driver and the dialect.

    Engine::session

    Wrap driver in a session that renders for this engine's dialect. moonorm owns no driver contract, so the concrete backend is the caller's to supply.

    parse_dsn

    fn parse_dsn(dsn : String) -> Dsn raise DsnError

    Parse dsn into a Dsn. It accepts the SQLAlchemy URL forms:

    • sqlite://, sqlite:///:memory:, sqlite:///file.db, sqlite:////abs/file.db
    • postgresql://user:pass@host:5432/db?sslmode=require (and postgres://)
    • mysql://user:pass@host:3306/db (and mysql+pymysql://)

    A +driver suffix overrides the driver name without changing the dialect. An absent or unknown scheme raises DsnError.

    Source Files