A postgresql datalayer for the Ash Framework
Find a file
2023-10-03 12:56:44 -04:00
.github chore: fix hex_api_key secret ref 2023-02-21 10:28:39 -05:00
.vscode
config improvement: fix upsert_fields behavior for upserts 2023-09-25 15:32:20 -04:00
documentation docs: update spark for docs improvements 2023-09-26 23:17:47 -04:00
lib fix: subquery aggregate if limit is applied 2023-10-03 12:56:44 -04:00
logos
priv improvement: Allow resources to opt out of the primary key requirement. (#166) 2023-09-06 01:18:57 -04:00
test * improvement: in multitenant resources migration's generation, check if the relationship points at the primary key of the target then not adding the multitenancy attribute (#144 and #157) 2023-09-25 15:33:28 -04:00
test_snapshot_path improvement: custom-extension implementation (#162) 2023-08-08 10:20:26 -07:00
.check.exs improvement: update to the latest ash 2022-10-07 15:50:20 -04:00
.credo.exs fix: convert Ash.Resource.Aggregate to Ash.Query.Aggregate when adding 2023-07-13 23:27:08 -04:00
.formatter.exs improvement: support deferrable option in migration generator 2023-07-14 16:24:57 -04:00
.gitignore
.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.52 2023-09-26 11:45:28 -04:00
LICENSE
mix.exs chore: only gather analytics on hexdocs 2023-10-02 10:56:05 -04:00
mix.lock docs: update spark for docs improvements 2023-09-26 23:17:47 -04: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