API Reference Moebius v#5.0.0

Copy Markdown View Source

Modules

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

The handle transaction/1 passes to your callback.

Turns a module into a database you can run commands against.

A ready-made database module that reads config :moebius, connection: [...]. Add it to your supervision tree, or define your own with use Moebius.Database.

If you like your Postgres doing document goodness, then you'll want to use this interface. Just include it in your module and you can work directly with JSONB in PostgreSQL. We've tried to keep reasonable parity with the Query interface, but there are some concepts here that are a bit different.

An error from Postgres, the driver or the pool.

Checks the table, column and function names Moebius puts into SQL.

The main query interface for Moebius. Import this module into your code and query like a champ

Struct for the query command which is piped through all the transforms

The QueryFilter module is used to build WHERE clauses to be used in queries. You can call it directly but in most cases it will be used through the Query module (see Query module).

The raw result of one statement, before Moebius turns rows into maps.

Turns query results into what Moebius returns: maps with atom keys, {:ok, value} or {:error, message}.

Mix Tasks

Creates the database named in the :connection config

Drops the database named in the :connection config

Rebuilds the test database's tables from test/db/tables.sql. Test environment only.

Loads the test data in test/db/seeds.sql. Test environment only.