A postgresql datalayer for the Ash Framework
Find a file
2021-07-02 01:01:56 -04:00
.github improvement: update to latest ash 2021-05-07 12:00:52 -04:00
config
documentation improvement: update to latest ash 2021-05-14 01:20:10 -04:00
lib fix: horribly hack ecto for dynamic bindings 2021-07-02 01:01:56 -04:00
logos
priv feat: support expression based calculations 2021-06-04 01:48:35 -04:00
test improvement: support calculation sorts 2021-06-05 18:13:20 -04:00
test_snapshot_path
.check.exs
.credo.exs feat: support expression based calculations 2021-06-04 01:48:35 -04:00
.formatter.exs improvement: custom index names 2021-04-27 17:16:56 -04:00
.gitignore
CHANGELOG.md chore: release version v0.40.1 2021-07-01 23:04:36 -04:00
LICENSE
mix.exs chore: release version v0.40.1 2021-07-01 23:04:36 -04:00
mix.lock improvement: update to latest ash 2021-07-01 23:04:21 -04:00
README.md docs: Update docs in readme (#50) 2021-03-14 17:22:59 -04: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 chage your Ecto Repo's from use Ecto.Repo, to use AshPostgres.Repo. because AshPostgres adds functionality to Ecto Repos.

Then, configure each of your Ash.Resource resources by adding use Ash.Resource, data_layer: AshPostgres.DataLayer like so:

defmodule MyApp.SomeResource do
  use Ash.Resource, data_layer: AshPostgres.DataLayer

  postgres do
    repo MyApp.Repo
    table "table_name"
  end

  attributes do
    # ... Attribute definitions
  end
end

Generating Migrations

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