A postgresql datalayer for the Ash Framework
Find a file
2024-04-23 10:07:53 +12:00
.github chore: enable dependabot for mix dependencies. 2024-04-11 09:32:34 +12:00
.vscode improvement: support latest ash 2022-09-20 23:00:29 -04:00
benchmarks improvement!: 3.0 (#227) 2024-03-27 16:52:28 -04:00
config docs: reformat docs and revisit certain guides 2024-04-09 20:21:04 -04:00
documentation docs: add ash-functions to the extensions list in getting started 2024-04-17 02:00:12 +01:00
lib improvement: warn on missing ash-functions at compile time 2024-04-22 12:08:30 -04:00
logos feat: use the new DSL builder for config (#7) 2020-06-14 03:04:18 -04:00
priv docs: reformat docs and revisit certain guides 2024-04-09 20:21:04 -04:00
test chore: Add failing test for tenanted aggregate bug. 2024-04-23 10:07:53 +12:00
test_snapshot_path/test_repo improvement!: 3.0 (#227) 2024-03-27 16:52:28 -04:00
.check.exs improvement: update to the latest ash 2022-10-07 15:50:20 -04:00
.credo.exs improvement: add default implementation for pg_version, and rename to min_pg_version 2024-03-27 19:20:49 -04:00
.formatter.exs improvement: Add nulls_distinct option to CustomIndex (#221) 2024-03-12 20:22:34 -04:00
.gitignore feat: snapshot-based migration generator 2020-09-10 20:26:47 -04:00
.tool-versions fix: properly format migrations 2024-03-20 16:18:27 -04:00
CHANGELOG.md chore: release version v2.0.0-rc.8 2024-04-22 11:34:04 -04:00
LICENSE Update LICENSE 2020-09-21 14:02:15 -04:00
mix.exs chore: release version v2.0.0-rc.8 2024-04-22 11:34:04 -04:00
mix.lock improvement: warn on missing ash-functions at compile time 2024-04-22 12:08:30 -04:00
README.md improvement!: 3.0 (#227) 2024-03-27 16:52:28 -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, "~> 1.3.6"}

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, domain: MyDomain, 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