Moebius (Moebius v5.0.0)

Copy Markdown View Source

Helpers for connection config and SQL scripts. The query builders are in Moebius.Query and Moebius.DocumentQuery; running them is Moebius.Database.

Moebius starts no processes of its own. Add Moebius.Db (or your own module that uses Moebius.Database) to your supervision tree.

Summary

Functions

Runs a SQL script: any number of statements separated by semicolons, without parameters. Opens its own connection with opts (the same options as a database module), so it works before any pool is started. Returns :ok or {:error, message}.

Functions

get_connection()

get_connection(key)

parse_connection(url)

run_script(sql, opts)

Runs a SQL script: any number of statements separated by semicolons, without parameters. Opens its own connection with opts (the same options as a database module), so it works before any pool is started. Returns :ok or {:error, message}.

The mix tasks use this to load test/db/tables.sql and seeds.sql.