A postgresql datalayer for the Ash Framework
Find a file
2022-05-14 02:58:04 -04:00
.github chore: more master -> main work 2022-04-27 09:55:08 -04:00
.vscode chore: clean up docs for new docs site 2022-03-28 22:30:27 -04:00
config fix: better embedded filters, switch to latest ash 2021-02-24 13:59:49 -05:00
documentation/guides chore: update for latest ash changes 2022-04-19 11:08:44 -04:00
lib improvement: add explicit timeout capability declaration 2022-05-14 02:58:04 -04:00
logos
priv chore: test enum types 2022-02-09 12:13:11 -05:00
test improvement: add static schema specification in DSL 2022-05-13 17:41:30 -04:00
test_snapshot_path chore: work on tests 2021-11-13 13:57:00 -05:00
.check.exs
.credo.exs all green on dynamic refactor 2022-02-07 15:35:18 -05:00
.formatter.exs improvement: add static schema specification in DSL 2022-05-13 17:41:30 -04:00
.gitignore feat: snapshot-based migration generator 2020-09-10 20:26:47 -04:00
CHANGELOG.md chore: release version v0.42.0-rc.0 2022-04-26 11:05:38 -04:00
LICENSE Update LICENSE 2020-09-21 14:02:15 -04:00
mix.exs chore: update to latest ash 2022-05-13 18:00:39 -04:00
mix.lock chore: update to latest ash 2022-05-13 18:00:39 -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