A postgresql datalayer for the Ash Framework
Find a file
2022-09-06 18:33:17 -04:00
.github chore: bump CI ash version 2022-08-30 17:15:02 -06:00
.vscode chore: clean up docs for new docs site 2022-03-28 22:30:27 -04:00
config chore: use new config 2022-05-14 03:01:14 -04:00
documentation docs: add a testing with postgres how-to 2022-08-30 17:36:57 -06:00
lib improvement: support latest ash exists/2 expr 2022-09-06 18:33:17 -04:00
logos feat: use the new DSL builder for config (#7) 2020-06-14 03:04:18 -04:00
priv important: update to ash 2.0 branch 2022-08-24 12:07:38 -04:00
test improvement: support latest ash exists/2 expr 2022-09-06 18:33:17 -04:00
test_snapshot_path improvement: fix typecasting for calculations & embed access 2022-08-05 15:27:22 -04:00
.check.exs improvement: check_migrations, rename to --check 2022-05-18 13:21:58 -04:00
.credo.exs improvement: support || and && 2022-07-20 14:19:06 -04:00
.formatter.exs improvement: add custom_statements to migration generator 2022-07-21 13:34:38 -04:00
.gitignore feat: snapshot-based migration generator 2020-09-10 20:26:47 -04:00
CHANGELOG.md chore: release version v1.0.0-rc.1 2022-09-04 00:40:19 -06:00
LICENSE Update LICENSE 2020-09-21 14:02:15 -04:00
mix.exs improvement: support latest ash exists/2 expr 2022-09-06 18:33:17 -04:00
mix.lock improvement: support latest ash exists/2 expr 2022-09-06 18:33:17 -04:00
README.md chore: more master -> main work 2022-04-27 09:55:08 -04:00

AshPostgres

Elixir CI License: MIT Coverage Status Hex version badge

AshPostgres supports all the capabilities of an Ash data layer. AshPostgres is the primary Ash data layer.

Custom Predicates:

  • AshPostgres.Predicates.Trigram

DSL

See the DSL documentation in AshPostgres.DataLayer for DSL documentation

Usage

Add 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