Commit graph

36 commits

Author SHA1 Message Date
Zach Daniel
bc26951c41 test: add test for optimistic lock 2024-09-18 06:52:21 -04:00
Jonatan Männchen
ec3273f163
feat: Implement Ltree Type (#385) 2024-09-12 09:11:26 -04:00
Zach Daniel
b35b976547 improvement: support upcoming action_select options 2024-09-10 20:09:32 -04:00
Zach Daniel
52f0250652 chore: generate migrations 2024-07-15 09:54:09 -04:00
Zach Daniel
ef58c78313 test: add more tests for atomic update interactions
chore: get build passing
2024-07-12 23:23:42 -04:00
Zach Daniel
860d085386 fix: update ash_sql to fix query generation issues 2024-06-18 07:50:54 -04:00
Zach Daniel
cacf71cd55 fix: ensure that parens are always added to calculation generated SQL 2024-06-17 15:34:05 -04:00
Zach Daniel
8ad92cc3c0 improvement: update ash and support new identity features 2024-05-24 01:14:55 -04:00
Frank Dugan III
bc02a4d23c
feat: add timestamptz types (#266) 2024-05-05 06:08:21 -04:00
Zach Daniel
56f3a5eb2f fix: fix calculate when exprs aren't dynamics
test: add test for datetimes
2024-05-02 21:29:21 -04:00
Zach Daniel
804482b8ac improvement!: change defaults for uuids to gen_random_uuid() 2024-03-27 17:20:07 -04:00
Zach Daniel
37cb3825f1 fix: properly handle complex types in lists 2024-02-23 20:53:19 -05:00
Zach Daniel
4930a69b95 improvement: support count_nils expression 2024-01-29 17:17:32 -05:00
Barnabas Jovanovics
c916034931
fix: replace upsert field with source in EXCLUDED fragment (#187) 2023-12-19 15:05:05 +01:00
Zach Daniel
8d482674a0 chore: generate migrations 2023-11-29 09:14:57 -05:00
Zach Daniel
592e79a2f9 improvement: support composite types 2023-11-27 17:47:54 -05:00
Zach Daniel
cbde3958f3 fix: properly handle ensure nsted calls to get_path are jsonb 2023-08-23 12:54:25 -04:00
Alan Heywood
f290ae47b8 Add failing test for policy + aggregate issue
The conditions for this issue to occur seem to be:

- DataLayer is Postgres
- Resource has a relates_to_actor_via policy on read
- The relates_to_actor_via path includes a has_many relationship
- An aggregate is loaded

The following error is produced:

  1) test relates to actor via has_many and with an aggregate (AshPostgres.AggregateTest)
     test/aggregate_test.exs:8
     ** (Ash.Error.Unknown.UnknownError) ** (ArgumentError) No such entity nil found.

     code: |> Api.read_one!(actor: user)
     stacktrace:
       nil.spark_dsl_config()
       (spark 0.3.8) lib/spark/dsl/extension.ex:129: Spark.Dsl.Extension.dsl!/1
       (spark 0.3.8) lib/spark/dsl/extension.ex:158: Spark.Dsl.Extension.get_persisted/3
       (ash 2.5.10) lib/ash/filter/filter.ex:2986: Ash.Filter.do_hydrate_refs/2
       (ash 2.5.10) lib/ash/policy/check/relates_to_actor_via.ex:3: Ash.Policy.Check.RelatesToActorVia.try_eval/2
       (ash 2.5.10) lib/ash/policy/check/relates_to_actor_via.ex:3: Ash.Policy.Check.RelatesToActorVia.try_strict_check/3
       (ash 2.5.10) lib/ash/policy/checker.ex:63: Ash.Policy.Checker.do_strict_check_facts/3
       (ash 2.5.10) lib/ash/policy/checker.ex:88: anonymous fn/2 in Ash.Policy.Checker.strict_check_policies/3
       (elixir 1.14.2) lib/enum.ex:4751: Enumerable.List.reduce/3
       (elixir 1.14.2) lib/enum.ex:2514: Enum.reduce_while/3
       (ash 2.5.10) lib/ash/policy/checker.ex:9: anonymous fn/2 in Ash.Policy.Checker.strict_check_facts/1
       (elixir 1.14.2) lib/enum.ex:4751: Enumerable.List.reduce/3
       (elixir 1.14.2) lib/enum.ex:2514: Enum.reduce_while/3
       (ash 2.5.10) lib/ash/policy/authorizer.ex:790: Ash.Policy.Authorizer.do_strict_check_facts/1
       (ash 2.5.10) lib/ash/policy/authorizer.ex:372: Ash.Policy.Authorizer.strict_check/2
       (ash 2.5.10) lib/ash/engine/request.ex:550: Ash.Engine.Request.do_strict_check/3
       (ash 2.5.10) lib/ash/engine/request.ex:518: anonymous fn/2 in Ash.Engine.Request.strict_check/2
       (elixir 1.14.2) lib/enum.ex:4751: Enumerable.List.reduce/3
       (elixir 1.14.2) lib/enum.ex:2514: Enum.reduce_while/3
       (ash 2.5.10) lib/ash/engine/request.ex:255: Ash.Engine.Request.do_next/1
       (ash 2.5.10) lib/ash/engine/request.ex:211: Ash.Engine.Request.next/1
       (ash 2.5.10) lib/ash/engine/engine.ex:650: Ash.Engine.advance_request/2
       (ash 2.5.10) lib/ash/engine/engine.ex:556: Ash.Engine.fully_advance_request/2
       (ash 2.5.10) lib/ash/engine/engine.ex:497: Ash.Engine.do_run_iteration/2
       (elixir 1.14.2) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3
       (ash 2.5.10) lib/ash/engine/engine.ex:440: Ash.Engine.run_iteration/1
       (ash 2.5.10) lib/ash/engine/engine.ex:257: Ash.Engine.run_to_completion/1
       (ash 2.5.10) lib/ash/engine/engine.ex:202: Ash.Engine.do_run/2
       (ash 2.5.10) lib/ash/engine/engine.ex:141: Ash.Engine.run/2
       (ash 2.5.10) lib/ash/actions/read.ex:170: Ash.Actions.Read.do_run/3
       (ash 2.5.10) lib/ash/actions/read.ex:90: Ash.Actions.Read.run/3
       (ash 2.5.10) lib/ash/api/api.ex:1005: Ash.Api.read_one/3
       (ash 2.5.10) lib/ash/api/api.ex:998: Ash.Api.read_one!/3
       test/aggregate_test.exs:44: (test)
2023-01-29 16:15:16 +10:00
Zach Daniel
059837651d improvement: add unique constraints to changeset for custom unique indexes
improvement: separate out concurrent index creations and do them in a separate transaction
2022-11-25 14:06:22 -05:00
Zach Daniel
4a69edce2d important: update to ash 2.0 branch 2022-08-24 12:07:38 -04:00
Zach Daniel
eb2bd267cb improvement: fix typecasting for calculations & embed access
chore: rebuild test migrations
2022-08-05 15:27:22 -04:00
Zach Daniel
c52917bca1 improvement: set update_defaults on upsert results 2022-07-06 14:44:18 -04:00
Zach Daniel
824748b0ab fix: support upsert_identity with base filters 2022-07-01 19:12:01 -04:00
Zach Daniel
da07ed7b6c fix: handle various join bugs 2022-06-29 15:08:49 -04:00
Zach Daniel
2a5c7ac4a2 improvement: check_migrations, rename to --check
fix: don't use `table` where we should use `schema` in migration generator
2022-05-18 13:21:58 -04:00
Zach Daniel
a6577d5175 chore: test enum types 2022-02-09 12:13:11 -05:00
Zach Daniel
98004f3251 fix: handle new if types
improvement: relax ash version requirement
2021-11-13 14:48:14 -05:00
Zach Daniel
9a97cb682d chore: work on tests 2021-11-13 13:57:00 -05:00
Zach Daniel
8bcc2a16eb fix: stringify struct defaults in migration generator 2021-04-26 13:21:57 -04:00
Zach Daniel
301f05604c improvement: support ash enums 2021-04-21 13:50:11 -04:00
Zach Daniel
1f6621b852 feat: add check_constraints, both for validation and migrations 2021-04-19 14:26:41 -04:00
Zach Daniel
4d2d29d976 feat: support configuring references
feat: support configuring polymorphic references
feat: support `distinct` Ash queries
2021-04-01 02:19:30 -04:00
regularfellow
2807b191fc
chore: Test creating resource with uuid or integer primary key (#48)
Co-authored-by: Zach Daniel <zachary.s.daniel@gmail.com>
2021-03-29 11:03:45 -04:00
Zach Daniel
eb703efe6f fix: better embedded filters, switch to latest ash 2021-02-24 13:59:49 -05:00
Zach Daniel
fbc42ce87a fix: rework the way multitenant migrations work
feat: add `mix ash_postgres.create`

feat: add `mix ash_postgres.migrate`

feat: add `mix ash_postgres.migrate --tenants`

feat: add `mix ash_postgres.drop`
2021-01-26 19:16:29 -05:00
Zach Daniel
5b3fd3f144 feat: support latest ash + contains 2021-01-23 22:45:15 -05:00