A postgresql datalayer for the Ash Framework
Find a file
Zach Daniel fbc42ce87a fix: rework the way multitenant migrations work
feat: add `mix ash_postgres.create`

feat: add `mix ash_postgres.migrate`

feat: add `mix ash_postgres.migrate --tenants`

feat: add `mix ash_postgres.drop`
2021-01-26 19:16:29 -05:00
.github fix: rework the way multitenant migrations work 2021-01-26 19:16:29 -05:00
config feat: multitenancy (#25) 2020-10-28 22:26:45 -04:00
documentation fix: rework the way multitenant migrations work 2021-01-26 19:16:29 -05:00
lib fix: rework the way multitenant migrations work 2021-01-26 19:16:29 -05:00
logos feat: use the new DSL builder for config (#7) 2020-06-14 03:04:18 -04:00
priv fix: rework the way multitenant migrations work 2021-01-26 19:16:29 -05:00
test improvement: better errors for multitenant unique constraints 2021-01-26 15:07:26 -05:00
.check.exs chore: only run coverage once (#14) 2020-08-27 23:00:57 -04:00
.credo.exs feat: multitenancy (#25) 2020-10-28 22:26:45 -04:00
.formatter.exs feat: support fragments 2021-01-22 16:47:24 -05:00
.gitignore feat: snapshot-based migration generator 2020-09-10 20:26:47 -04:00
CHANGELOG.md chore: release version v0.32.2 2021-01-26 15:08:14 -05:00
LICENSE Update LICENSE 2020-09-21 14:02:15 -04:00
mix.exs chore: release version v0.32.2 2021-01-26 15:08:14 -05:00
mix.lock feat: support latest ash + contains 2021-01-23 22:45:15 -05:00
README.md chore: update to latest ash 2020-12-27 01:20:12 -05:00

AshPostgres

Elixir CI License: MIT Coverage Status Hex version badge

AshPostgres supports all capabilities of an Ash data layer, and it will most likely stay that way, as postgres is the primary target/most maintained data layer.

Custom Predicates:

  • AshPostgres.Predicates.Trigram

DSL

See the DSL documentation in AshPostgres.DataLayer for DSL documentation

Usage

First, ensure you've added ash_postgres to your mix.exs file.

{:ash_postgres, "~> x.y.z"}

To use this data layer, you need to define an Ecto.Repo. AshPostgres adds some functionality on top of ecto repos, so you'll want to use AshPostgres.Repo

Then, configure your resource like so:

postgres do
  repo MyApp.Repo
  table "table_name"
end

Generating Migrations

See the documentation for Mix.Tasks.AshPostgres.GenerateMigrations for how to generate migrations from your resources