A postgresql datalayer for the Ash Framework
Find a file
2022-12-10 16:13:25 -05:00
.github chore: upgrade ash in CI 2022-12-04 15:21:23 -05:00
.vscode
config
documentation
lib improvement: mark generate_migrations as recursive for umbrellas 2022-12-10 16:13:25 -05:00
logos
priv chore: add test with join in many to many 2022-12-04 13:39:58 -05:00
test improvement: better error messages from mix tasks 2022-12-10 15:59:50 -05:00
test_snapshot_path
.check.exs
.credo.exs
.formatter.exs chore: format/lint 2022-11-21 03:08:04 -05:00
.gitignore
CHANGELOG.md chore: release version v1.2.0-rc.0 2022-12-10 16:03:51 -05:00
LICENSE
mix.exs chore: release version v1.2.0-rc.0 2022-12-10 16:03:51 -05:00
mix.lock improvement: better error messages from mix tasks 2022-12-10 15:59:50 -05:00
README.md

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, "~> 1.0"}

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

Contributors

Ash is made possible by its excellent community!

Become a contributor