A postgresql datalayer for the Ash Framework
Find a file
2023-12-19 14:57:12 +01:00
.github chore: format and fix matrix 2023-11-17 09:17:11 -05:00
.vscode improvement: support latest ash 2022-09-20 23:00:29 -04:00
benchmarks chore: update benchmark 2023-10-18 16:56:09 -04:00
config improvement: fix upsert_fields behavior for upserts 2023-09-25 15:32:20 -04:00
documentation regenerate cheat sheets 2023-12-19 14:57:12 +01:00
lib use info function to get the attribute directly 2023-12-19 14:49:49 +01:00
logos feat: use the new DSL builder for config (#7) 2020-06-14 03:04:18 -04:00
priv replace upsert field with source in EXCLUDED fragment 2023-12-19 14:39:01 +01:00
test format code 2023-12-19 14:46:59 +01:00
test_snapshot_path chore: fix error expression 2023-12-15 08:48:20 -05:00
.check.exs improvement: update to the latest ash 2022-10-07 15:50:20 -04:00
.credo.exs chore: credo/dialyzer 2023-11-16 17:55:27 -05:00
.formatter.exs improvement: allow specifying multi-column foreign keys (#180) 2023-11-20 16:52:50 -05:00
.gitignore feat: snapshot-based migration generator 2020-09-10 20:26:47 -04:00
.tool-versions improvement: support new distinct features from ash core 2023-07-18 14:48:35 -04:00
CHANGELOG.md chore: release version v1.3.64 2023-12-04 14:56:05 -05:00
LICENSE Update LICENSE 2020-09-21 14:02:15 -04:00
mix.exs improvement: support for error/2 expression 2023-12-14 17:10:11 -05:00
mix.lock improvement: support for error/2 expression 2023-12-14 17:10:11 -05:00
README.md chore: update version in readme 2023-02-05 12:42:16 -05: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, 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