Riccardo Binetti
8826c9ec35
fix: enforce multitenancy on aggregates ( #952 )
...
The multitenancy attribute was already considered as a filter in
aggregates, but the presence of the tenant was not enforced
2024-03-27 10:07:53 -04:00
Zach Daniel
88d0b46dec
improvement: detect loaded-through types
2024-03-24 23:25:28 -04:00
Zach Daniel
ac0ff0e2e4
improvement: restore old behavior of leveraging in memory values for calculations
2024-03-24 19:25:13 -04:00
Minsub Kim
75b2d2eb00
feat: add less_than, greater_than constraints to float, decimal ( #936 )
2024-03-22 02:39:59 -04:00
Riccardo Binetti
23055f0a18
feat: allow providing descriptions to Ash.Type.Enum values ( #940 )
...
As discussed in https://github.com/ash-project/ash_graphql/issues/116 , this
allows extensions to use the description to use the provided descriptions.
The documentation assumes that if a user provides a description, it does so for
all values (since this seems to be a reasonable assumption and allows the nicer
keyword list syntax). However tests also cover an enum with some missing
descriptions.
2024-03-22 02:38:59 -04:00
Zach Daniel
5a338206b7
fix: fully expand calculation and aggregate references for applying authorization
2024-03-22 01:10:15 -04:00
Hannes Wüthrich
00b1ef3bee
fix: batch_change/3 is never called for updates ( #938 )
...
* fix: bulk updates for streams ignore :batch_size
2024-03-21 08:40:18 -04:00
Dmitry Maganov
ed4655cd83
improvement: add matches
built-in policy check ( #937 )
2024-03-21 08:39:21 -04:00
Hannes Wüthrich
b398107ca3
fix: don't double-encode vector data ( #934 )
2024-03-20 16:32:45 -04:00
Tun Cham Roeun
7d7bcaa3d7
fi: fetch_count/4
use the query after applying before_action
hooks ( #922 )
...
---------
Co-authored-by: Zach Daniel <zachary.s.daniel@gmail.com>
2024-03-12 20:28:52 -04:00
e5f01bbd59
improvement(Ash.Reactor): Backport improvements from 3.0 branch.
2024-03-08 10:51:40 +13:00
Zach Daniel
18cc9c9b26
fix: ensure that message is honored in atomic validations
...
fix: don't require actor when constructing aggregate query
2024-03-07 10:47:43 -05:00
9b88628b07
improvement: Make undo actions for update
and destroy
actions more explicit. ( #920 )
...
* chore(Ash.Reactor): Follow on from `get` -> `read_one` rename.
* improvement(Ash.Reactor): Make undo actions for `update` and `destroy` more explicit.
2024-03-05 11:30:35 +13:00
Zach Daniel
7f0e2d8037
improvement: rename get
to read_one
in Ash.Reactor
2024-03-02 16:51:00 -05:00
86d74ed789
feat(Ash.Reactor): Add a Reactor extension that makes working with resources easy. ( #683 )
...
* feat: Add `Ash.Reactor` with create support.
* improvement: Add `Ash.Reactor` update support.
* improvement: Add `Ash.Reactor` destroy support.
* improvement(Ash.Reactor): Support for transactional handling of notifications.
* improvement(Ash.Reactor): Add `read` and `get` steps.
* docs: Add the beginnings of a Reactor topic.
* improvement(Ash.Reactor): add support for generic actions.
* improvement: Add `undo` capability to `create` step.
* improvement: transaction and undo working.
* docs: Start documenting undo behaviour.
* chore: Update to Reactor 0.6.
* improvement: Automatically thread Ash tracers through Reactor.
* improvement(Ash.Reactor): Add undo to generic actions.
* docs: Improve reactor documentation.
* fix: Mimic copying `Ash.Notifier` seems to break the compiler for some reason.
2024-03-02 10:26:25 +13:00
Zach Daniel
650205a9bc
fix: ensure calculation arguments are not ignored when parsing filters
...
fixes #917
2024-02-29 00:41:24 -05:00
Zach Daniel
1a99098f52
fix: ensure that policies are applied to aggregates referenced in calculations
2024-02-26 13:00:12 -05:00
Zach Daniel
0e1fe24f46
fix: ensure actor context is set in filter
2024-02-25 08:24:19 -05:00
Zach Daniel
eab194fac5
fix: properly handle limit/offset for aggregates
2024-02-24 20:21:13 -05:00
Zach Daniel
0fd4e36b2e
add test for read_one
and limit
2024-02-23 08:46:17 -05:00
Zach Daniel
701f9b4cc6
fix: honor soft destroys for atomic bulk destroys
2024-02-22 08:02:01 -05:00
Zach Daniel
3027afe5fc
fix: pass correct options into Api.stream!
for bulk_destroy
2024-02-21 08:09:20 -05:00
Robert Graff
8fd0106528
test: add test for bulk_destroy with policy and query ( #908 )
2024-02-21 08:00:20 -05:00
Zach Daniel
944f69b16e
fix: properly annotate run_flow
's recursive DSL tag
...
docs: update spark & docs
2024-02-16 21:25:18 -05:00
Jechol Lee
3a353c2fa0
test: Reproduce run_flow is not counted as step inside map, branch ( #902 )
2024-02-16 20:21:22 -05:00
Zach Daniel
a06912f9b0
fix: honor not_found_error?
in read_one
...
improvement: pass `tenant` to context in custom changes
improvement: `Ash.context_to_opts` now checks for a `tenant`
2024-02-16 17:56:23 -05:00
Jechol Lee
b4ade107cd
test: Reproduce flow custom step has no tenant in context ( #901 )
2024-02-16 17:47:54 -05:00
Zach Daniel
f847f0d971
test: update test w/ not_found_error?
fix
2024-02-15 23:38:52 -05:00
Zach Daniel
ba2ab31f8d
test: correct flow tests
2024-02-15 23:30:09 -05:00
Jechol Lee
aa7278fe79
test: Reproducing a bug where the flow does not honor tenant ( #900 )
2024-02-15 23:26:44 -05:00
Jechol Lee
e214043218
chore: Rename test/flow_test to test/flow ( #899 )
2024-02-15 23:23:57 -05:00
Jechol Lee
896725597b
test: Reproducing a bug where Flow ignores the authorization setup. ( #895 )
2024-02-15 08:57:11 -05:00
Zach Daniel
3d30fd848f
fix: ensure we retain the sort order of embedded resources
...
fixes #883
2024-02-13 13:55:07 -05:00
Dmitry Kulakov
5846b70315
feat: allow using custom delimiters for pubsub topics
2024-02-11 16:45:05 -04:00
Zach Daniel
45999cac07
chore: test fix for after transaction hooks
2024-02-11 11:44:11 -05:00
Zach Daniel
2b7a99905c
improvement: support policies requiring original data
2024-02-09 17:19:45 -05:00
Zach Daniel
0893518f39
improvement: change atomicity requirements when datalayers don't support it
...
test: make tests pass on 3.0
2024-02-08 15:17:32 -05:00
Dmitry Maganov
5eccdcd7f8
improvement: add on_match: :update_join
to manage_relationship
( #875 )
2024-02-08 11:18:32 -05:00
Dmitry Maganov
d47eb086a2
fix: continue cleanup in ManagedRelationshipHelpers
( #873 )
2024-02-07 14:56:04 -05:00
Zach Daniel
2cd6360379
fix: fix pattern match error on certain policy conditions
...
improvement: various policy behavior cleanups
2024-02-06 19:30:18 -05:00
Zach Daniel
e707758c93
fix: retain metadata on updates, atomic and otherwise
...
fix: properly load expression -> runtime calculation deps
2024-02-01 10:21:22 -05:00
Zach Daniel
fc3cbc4e2c
improvement: change nested field filtering to be done with at_path
2024-01-31 15:41:10 -05:00
Zach Daniel
f7716c5222
improvement: support referencing non-array embeds in input filters
2024-01-31 12:11:36 -05:00
Zach Daniel
6602ae63e6
fix: support expression calculations referencing runtime calculations
2024-01-30 16:34:17 -05:00
Zach Daniel
550a9c1424
chore: fix file name
2024-01-30 15:23:04 -05:00
Zach Daniel
9f748b5c55
test: update authorizer tests
...
fix: properly handle the case where all valid scenarios are pruned
2024-01-30 13:11:47 -05:00
Barnabas Jovanovics
406a076ef1
test: add test that shows expr condition does not work with access_type :strict ( #858 )
2024-01-30 12:53:23 -05:00
Zach Daniel
9e02b0d0c7
improvement: introduce require_atomic?
, which defaults to false
in 2.0, true
in 3.0
...
fix: properly prevent the atomic handling of manual update actions
improvement: better support around the mixing of atomic and non atomic changes/validations
2024-01-30 12:32:41 -05:00
Zach Daniel
c02bced508
improvement: support loading and selecting in bulk operations
2024-01-29 14:29:50 -05:00
Dmitry Maganov
c40f762eee
fix: use correct option for relationship in atomic relate_actor
( #855 )
...
---------
Co-authored-by: Zach Daniel <zachary.s.daniel@gmail.com>
2024-01-27 09:53:03 -05:00
Barnabas Jovanovics
fb3e7050a1
fix: only count resources the actor is allowed to see ( #853 )
...
* fix: only count resources the actor is allowed to see
* remove specc added by vscode
2024-01-26 13:33:03 -05:00
Barnabas Jovanovics
f2994502b9
add test for selecting policy ( #852 )
2024-01-25 11:08:31 -05:00
Jechol Lee
0d504ec429
test: Remove unnecessary authorize?: false in belongs_to_test ( #849 )
2024-01-25 10:50:37 -05:00
Zach Daniel
1807523ba2
improvement: support transactions in bulk updates
2024-01-23 21:36:17 -05:00
Zach Daniel
878011bd3e
improvement: count_nils/1
function
...
improvement: `present/absent` atomic implementation
improvement: add `atomic_ref/1` template helper
2024-01-23 19:13:14 -05:00
Nduati Kuria
d229ade9fc
Add :decimal
aggregate support to DataLayer.Ets
[WIP] ( #841 )
...
* Add `:decimal` aggregate support to `DataLayer.Ets`
* Add regression test
* Fix dialyzer
* Handle nils in `:avg` calculation
* Refactor nested ifs
* Refactor test
2024-01-22 16:03:34 -05:00
Zach Daniel
7aaea7bd55
fix: only load through calculations in the correct order
2024-01-20 13:53:35 -05:00
Zach Daniel
e5d78ae074
fix: get tests passing for bulk creates again
2024-01-19 10:49:26 -05:00
Zach Daniel
c48cb08026
improvement: rewrite read actions to not use Ash.Engine
( #836 )
2024-01-19 00:05:42 -05:00
Zach Daniel
4c96fdd40f
fix: don't ignore stream batch size
2024-01-13 21:48:11 -05:00
Zach Daniel
59e50f8dfa
fix: set tenant attribute in bulk create
...
fixes : #830
2024-01-12 08:19:55 -05:00
Jechol Lee
250c4ab8c8
improvement: support Ash.CiString in string_join ( #832 )
2024-01-12 00:21:30 -05:00
Zach Daniel
bbd866956d
improvement: authorize each related join using join_filters
2024-01-12 00:17:37 -05:00
Rebecca Le
0a4a7c057d
feat: Allow :self
as an option when requesting a relative page from a given page ( #833 )
2024-01-12 00:16:41 -05:00
Zach Daniel
35573a6f4e
improvement: support join_filters
in aggregates
2024-01-11 14:57:22 -05:00
Zach Daniel
5b82ce293f
fix: authorize aggregate references in calculations
2024-01-10 07:11:02 -05:00
Alan Heywood
dbb4a38ea3
fix: only put keywords to be interpolated in message in error vars ( #821 )
...
* fix: only put keywords to be interpolated in message in error vars
---------
Co-authored-by: Zach Daniel <zachary.s.daniel@gmail.com>
2024-01-08 18:08:17 -05:00
Zach Daniel
a12131cf70
improvement: simplify aggregate loading, remove Ash.Engine
from it
...
improvement: add atomic implementation for builtin `increment` change
improvement: simplify related path authorization, use same tool as aggregates now use
2024-01-08 15:31:09 -05:00
Zach Daniel
6061a2a16a
improvement: add some atomic implementations
2024-01-03 16:48:15 -05:00
Zach Daniel
40aa17eab8
fix: ensure __source__
is set on nested embedded attributes
2023-12-28 14:47:40 -05:00
Robert Graff
69ff044214
test: pass the source context with data to embedded resource validations ( #811 )
2023-12-28 13:25:49 -05:00
Dmitry Maganov
a6d381a171
test: fix typo in a test name ( #815 )
2023-12-28 12:07:55 -05:00
Zach Daniel
4ee80297d7
improvement: support using the new api
option in actions
2023-12-27 18:14:29 -05:00
Zach Daniel
31879077b7
chore: comment out test for 3.0 fix
2023-12-27 17:48:13 -05:00
Zach Daniel
3e296a4bba
Revert "chore: comment out test for now
...
This reverts commit cc21661559
.
2023-12-27 17:47:50 -05:00
Zach Daniel
17afb821a7
fix: don't include unknown authorize?
value in changesets
2023-12-27 17:37:51 -05:00
Zach Daniel
14d4e26d9c
chore: remove IO.inspect
2023-12-27 17:36:09 -05:00
Zach Daniel
cc21661559
chore: comment out test for now
2023-12-27 17:28:52 -05:00
Rohan Relan
750dc17286
test: Adds a test to ensure authorization occurs when the actor is set and authorization? is by_default ( #813 )
...
Co-authored-by: Rohan Relan <roresemail@gmail.com>
2023-12-27 10:27:22 -05:00
Zach Daniel
eb05e9be63
improvement: support streaming without keyset pagination
...
use the new `allow_stream_with` and `stream_with` options to control
what strategy may be used to stream query results.
2023-12-21 08:35:49 -05:00
Zach Daniel
ed887413d7
improvement: base case iterative bulk destroy implemented
2023-12-20 21:08:40 -05:00
Zach Daniel
8c17434803
improvement: add iterative, streaming implementation for bulk updates
2023-12-20 17:33:43 -05:00
Zach Daniel
2233a33523
improvement: support tenancy on manual actions
...
docs: update cheat shets
fix: honor tenant option on aggregates
closes #805
2023-12-16 10:33:10 -05:00
Zach Daniel
3be83d6ca4
improvement: lay the groundwork for fully atomic actions
2023-12-16 10:14:02 -05:00
Zach Daniel
52a62c7c45
chore: fix tests
2023-12-15 15:45:23 -05:00
Zach Daniel
e22c6c7927
fix: ensure actions always raise an error class
2023-12-15 15:33:10 -05:00
Zach Daniel
ad22eeb7e9
improvement: rewrite creates to not use Ash.Engine
2023-12-15 15:10:01 -05:00
Thales Grilo
9d2da58fb2
improvement: Adds %Ash.NotSelected{} to ash 3 ( !634 ) ( #804 )
...
* ✨ create Ash.NotSelected, add test
* ✅ add ash_three test
* 👌 fix formatting
* 👌 add missing field value
---------
Co-authored-by: thales <thales@uplearn.co.uk>
2023-12-14 16:14:15 -05:00
Robert Graff
014621cc09
test: reproduce bug casting embedded union arguments ( #803 )
2023-12-14 09:04:56 -05:00
Zach Daniel
d09c694132
fix: thread context through when setting source constraint on embeds
2023-12-13 17:11:52 -05:00
Robert Graff
e13bb6e0b4
test: Failing test for threading source information through embedded attributes ( #801 )
2023-12-13 16:47:11 -05:00
Zach Daniel
7298a4b51b
improvement: honor field policies in sort expressions
2023-12-13 15:08:39 -05:00
Zach Daniel
5c0275a78b
test: add test for simple data layer pagination
2023-12-11 19:58:14 -05:00
Zach Daniel
c38cba51b0
fix: test failures and credo issue
2023-12-10 13:13:06 -05:00
Jechol Lee
30deb8c32e
test: Remove unnecessary 'authorize?: false' and explicitly specify the filter policy results. ( #798 )
2023-12-07 20:22:46 -05:00
Zach Daniel
c7e6133317
improvement: support embed_nil_values?
for trimming down stored embeds
2023-12-06 10:29:39 -05:00
Robert Graff
636f99fb2d
test: Add test for updating embedded union values ( #796 )
2023-12-06 10:16:19 -05:00
Jechol Lee
7b70c3a58e
test: Fix ParentTest ( #793 )
2023-12-05 01:36:40 -05:00
Jechol Lee
86e171a0c1
test: various test improvements ( #795 )
2023-12-05 01:34:21 -05:00
Jechol Lee
728226bfee
test: Fix typo in MultitenancyTest ( #789 )
2023-12-01 13:02:06 -05:00
Darren Black
7106c61545
test: Failing test for Api.get ( #786 )
2023-11-29 20:05:36 -05:00
Zach Daniel
be935723d2
fix: properly resolve nested calculation dependencies
2023-11-24 07:23:38 -05:00
Jeremy Grant
1ce05562aa
fix: change_attribute failing on a union attribute ( #778 )
2023-11-20 19:10:35 -05:00
Zach Daniel
b9f804db10
fix: properly set actor context on calc expressions in ets data layer
2023-11-16 08:18:39 -05:00
Daniel Newman
8103831cf6
Bug: Actor not being passed
2023-11-15 17:05:31 -05:00
Simon Bergström
b0d5c08f5d
fix: properly include relationship name message when relationship cannot be found ( #770 )
2023-11-13 17:04:35 -05:00
Barnabas Jovanovics
abb0854ae9
fix: remove destroyed or unrelated data from the relationship ( #767 )
2023-11-13 13:58:09 -05:00
Eduardo B. A
1775ab5a14
feat: Expand upsert_fields option ( #761 )
...
With this change, upsert_fields accepts the following options:
* `nil`: upsert fields not set;
* `:replace_all`: all fields from resource will be updated;
* `{:replace_all_except, [fields]}`: all fields from resource except fields inside `fields` will be updated;
* `{:replace, [fields]}`: only fields inside `fields` will be updated.
2023-11-13 13:23:16 -05:00
Zach Daniel
7b50a401d8
fix: optimize and make Ash.Type
more consistent
2023-10-26 22:04:57 -04:00
Robert Graff
a48d43e79d
fix more handle change use cases ( #757 )
2023-10-25 17:47:50 -04:00
Zach Daniel
539f5a1727
fix: remove invalid usages of unsafe_change_attribute/3
...
ci: test against `ash_paper_trail`
2023-10-25 13:06:04 -04:00
Robert Graff
0e538470a2
test: regression test for Ash.Changeset.changing_attribute?/2
( #755 )
2023-10-25 12:56:45 -04:00
Robert Graff
f03b6a4370
fix: handle builtin types in unions ( #752 )
2023-10-25 08:31:25 -04:00
Frédérick Capovilla
76783b355b
feat: Add unknown argument error when passing an unknown key to an action. ( #750 )
...
* improvement: Add ash_three? feature flag for Ash 3.0 related behaviors.
* test: Add the ash_three test tag to exclude tests targetting Ash 3.0
2023-10-24 12:27:33 -04:00
Zach Daniel
7eac076581
chore: update dialyzer & cleanup dead code
2023-10-21 23:30:33 -04:00
Zach Daniel
63dbf2603f
chore: format
2023-10-21 23:20:13 -04:00
Zach Daniel
9ad876af20
improvement: add Ash.Test.assert_has_error
and Ash.Test.refute_has_error
2023-10-21 23:14:45 -04:00
Zach Daniel
dec32f47ee
improvement: support to_error_class
taking changeset/query/input
2023-10-21 22:55:45 -04:00
Frédérick Capovilla
60d12f86da
fix: Change heading levels in generated livebook to have only one H1 ( #747 )
2023-10-21 22:32:46 -04:00
Jordan Hewitt
003d5eb0e3
fix: code gen interfaces check type first argument ( #749 )
...
* reproduced reported error message.
* remove path matching from code interface in order to make error error from issue 679 more clear.
---------
Co-authored-by: Jordan <srcrr-gitlab@ipriva.com>
2023-10-21 19:52:37 -04:00
Zach Daniel
2dbebf39e1
fix: properly determine resource from Ash.get!/2
2023-10-20 06:22:32 -04:00
Zach Daniel
1ab5a35d7f
improvement: support an api
option to use Ash.Resource
( #715 )
...
* improvement: support an `api` option to `use Ash.Resource`
improvement: add functions to `Ash` for resources w/ configured apis
improvement: default code_interface.define_for to resource's ash api
2023-10-20 06:07:34 -04:00
Zach Daniel
ff88ce68b4
improvement: rewrite bulk creates, optimize changeset functions ( #744 )
2023-10-18 14:07:44 -04:00
Zach Daniel
d9bacc1554
fix: handle new type constraints properly
2023-10-17 12:50:14 -04:00
Pierre Le Gall
e14e1b2e29
improvement: set default many to many options ( #737 )
...
Many to many relationship `source_attribute_on_join_resource`
and `destination_attribute_on_join_resource` are now guessed
by there module name if not explicitly set in the relationship.
2023-10-17 10:03:21 -04:00
Zach Daniel
52337b7bff
improvement: various optimizations for bulk create actions
2023-10-16 23:50:05 -04:00
Zach Daniel
f53626e65d
improvement: support max_concurrency
option on bulk creates
...
improvement: better error message on missing identities
improvement: better error message on invalid data passed to `YourApi.load`
2023-10-16 14:53:27 -04:00
Zach Daniel
6e0be43c51
fix: properly authorize access to query aggregates in all cases
2023-10-11 19:44:50 -04:00
Zach Daniel
1ab4b6e69a
improvement: support atomics on upserts
2023-10-11 15:09:06 -04:00
Zach Daniel
3782f1cfe2
fix: honor authorize?
option for calls to aggregate
2023-10-10 11:10:58 -04:00
Zach Daniel
fbe6b21bf0
improvement: support to-one reference paths in calculations
2023-10-09 18:50:15 -04:00
Zach Daniel
06d152c415
chore: remove IO.inspect
2023-10-07 17:08:12 -04:00
Zach Daniel
32620dfd52
improvement: add Ash.Sort.expr_sort
. In 3.0 sort should be a macro
2023-10-07 09:16:52 -04:00
Zach Daniel
04c9249f24
fix: properly perform field authorization on loaded through types
2023-09-28 10:23:16 -04:00
Barnabas Jovanovics
4fb6da6eee
test: update test to load forbidden field through union ( #713 )
2023-09-28 08:36:37 -04:00
Zach Daniel
a00806eeb0
fix: static checks with conditions could be overly or insufficiently restrictive
2023-09-27 14:40:40 -04:00
Barnabas Jovanovics
a1ad5d5476
add test showing the problem with expressions in field_policy conditions ( #710 )
2023-09-27 18:58:25 +02:00
Barnabas Jovanovics
9e16109950
feat: expose query or changeset to field policies ( #701 )
2023-09-25 11:13:36 -04:00
Zach Daniel
93fc4a35b2
improvement: rework utc_datetime
to datetime
...
the old types are now newtypes over the new type
fixes : #704
2023-09-25 11:11:56 -04:00
Zach Daniel
2d9f9ee362
improvement: deprecate old school manual actions
...
note: these have been deprecated for a very long time, removing them will not
be considered a breaking change (and there will be clear compile errors)
2023-09-25 09:40:29 -04:00
Zach Daniel
b7b2f586a1
chore: format test
2023-09-22 17:05:07 -04:00
Zach Daniel
b13c7f0e53
improvement: add Ash.Query.around_transaction/2
2023-09-22 16:46:43 -04:00
Zach Daniel
1d43b26127
chore: move validate_relationship_attributes to a verifier
2023-09-20 16:51:38 -04:00
Zach Daniel
b0bd2d23d9
improvement: support map_with_tag
storage mode for Ash.Union
.
...
closes #694
2023-09-18 10:13:22 -04:00
Zach Daniel
9102966d05
test: update tests to account for no authorizers == authorized
2023-09-18 10:09:27 -04:00
Zach Daniel
91013c2de0
improvement: support stacktraces in set_error
2023-09-12 11:26:11 -04:00
James Harton
5f6920ef92
improvement: Allow resources to opt out of the primary key requirement. ( #687 )
...
This is experimental and will likely cause breakages. It's to support time series tables.
2023-09-06 10:21:42 +12:00
Zach Daniel
567dcf6372
fix: better handling for negate error messages
2023-09-04 16:01:48 -04:00
Zach Daniel
69623a1efe
chore: cleanups for new mix task
2023-09-04 01:23:57 -04:00
Barnabas Jovanovics
b661022736
fix: sort operator names in keyset ( #684 )
2023-09-01 06:53:01 -04:00
Zach Daniel
c5ea541b2d
chore: rework atomics to atomic_update
change and function
...
improvement: add `Ash.context_to_opts/1-2`
2023-08-29 14:39:38 -04:00
Zach Daniel
18cb24e7f7
improvement: implement atomics, expression-based changes ( #682 )
...
there is still a lot of potential work that needs to be on this front.
1. supporting atomics on create actions.
2. supporting atomics in upserts (this one may actually be much easier than the first one, for postgres specifically, due to ecto implementation details)
3. discovering places atomics can be more nicely integrated into existing changes, validations, policies
2023-08-28 16:05:26 -04:00
Zach Daniel
7d5fd04e5c
fix: ensure that errors/records return the proper value in bulk creates
...
closes #681
2023-08-25 08:59:24 -04:00
James Harton
269889c34b
fix(Ash.Filter): Don't overly constrain related references. ( #678 )
...
We now only apply related policies to filter statements based on references
that are explicitly annotated as inputs. This is the same logic that backs
protecting access in filters for field policies.
2023-08-21 19:39:07 -04:00
Tchowa Franck A
7e47bfb60f
improvement: validate all actions and accept/reject fields at once. ( #674 )
2023-08-18 20:47:35 -04:00
Tchowa Franck A
f302dca003
Feature: Ensure aggregate field is attribute or calculation. ( #671 )
2023-08-17 18:02:05 -04:00
Zach Daniel
b51dbe49c9
improvement: storage_type/0 -> storage_type/1
2023-08-17 17:52:00 -04:00
Zach Daniel
8233634bb1
improvement: properly set path into error instead of on error messages
...
TBD: this may break some people's tests, and so may need to be
reverted or released as part of 3.0
2023-08-15 16:23:06 -07:00
Zach Daniel
8c1f334075
improvement: expose union errors with path when tag is set
2023-08-15 14:07:28 -07:00
Barnabas Jovanovics
f85bc95ff5
chore: release version v2.14.0 ( #669 )
2023-08-09 19:43:55 +02:00
Zach Daniel
7ae9244d01
fix: don't optimized in/== predicates across incorrect boolean expressions
2023-08-08 12:17:07 -07:00
Zach Daniel
6daae630f4
fix: various fixes with runtime evaluation of aggregates
...
fix: handle mnesia transaction errors properly
2023-08-06 00:41:29 -04:00
Zach Daniel
cf99929230
improvement: initialize change opts in bulk actions
...
fix: better error message in `validate_related_resource_inclusion`
test: add test for arguments in bulk create actions
2023-08-02 12:41:54 -04:00
Zach Daniel
bda7c56543
improvement: support parent/1
in relationships
2023-07-26 16:46:22 -04:00
Zach Daniel
da73502a2f
fix: before/after batch callbacks are no longer broken
...
test: add tests for those callbacks being executed
2023-07-22 19:51:27 -04:00
Zach Daniel
e5563ce664
fix: Keyword.fetch
on keywords, fix test name
2023-07-19 11:18:20 -04:00
Zach Daniel
7f3ec1b8bf
improvement: support distinct_sort
2023-07-19 11:06:01 -04:00
Zach Daniel
3c42062861
fix: allow the query & related fields to be read before authorization status is complete
2023-07-18 15:23:27 -04:00
Mariusz Morawski
e356691765
test: Add test that covers issue 652 ( #657 )
2023-07-18 14:48:26 -04:00
Zach Daniel
5b2efe5e5c
improvement: support distincting on calculations
...
improvement: support distinct in ets data layer for testing
2023-07-18 14:35:25 -04:00
Zach Daniel
c0d8a86987
improvement: support resources directly in API modules
...
improvement: compile time warning on resources not detected in any apis
2023-07-13 01:38:21 -04:00
Zach Daniel
7114b5efbb
improvement: exists
type aggregate
2023-07-13 00:08:51 -04:00
Zach Daniel
2634d3d830
improvement: add at/2
function
2023-07-12 16:53:43 -04:00
Zach Daniel
d27e871b8f
improvement: add string_split
expression
2023-07-12 15:11:21 -04:00
skanderm
925f5c1f9a
fix: incorrect error for casting binary UUID ( #653 )
2023-07-11 20:35:01 -04:00
Zach Daniel
8e12a14b25
improvement: add field_policy_bypass
...
fix: fix and improve policy breakdown logs
improvement: optimize field selection/loading when possible
2023-07-11 10:28:07 -04:00
Barnabas Jovanovics
c442d83534
test: add test for aggregate field policy ( #644 )
2023-07-10 09:00:55 -04:00
Zach Daniel
be75743b13
fix: properly detect selected attributes for changeset field policies
2023-07-06 10:58:09 -04:00
Barnabas Jovanovics
8837bb0b0d
test: add test case for create action ( #641 )
2023-07-06 10:39:24 -04:00
Mariusz Morawski
5ed2109e33
improvement: Add Negate
validation ( #636 )
...
* Add `Negate` validation
---------
Co-authored-by: Zach Daniel <zachary.s.daniel@gmail.com>
2023-07-05 16:25:51 -04:00
Alan Heywood
4ab7e84e4f
fix: typo in at_most validation message ( #640 )
2023-07-04 08:59:12 -04:00
Eduardo B. A
5fe72d4703
feat: Adds Ash.Changeset around_transaction ( #632 )
2023-06-27 22:13:50 -04:00
Zach Daniel
25f899d6f4
improvement: support specifying calculation as an option
2023-06-24 06:55:38 -05:00
Zach Daniel
51a86cd58d
fix: fix field policy expressions
...
fix: handle various inconsistencies in runtime expression runner
2023-06-22 16:26:03 -04:00
Zach Daniel
4376cf9adb
chore: fix reserved name test
2023-06-22 14:24:50 -04:00
Zach Daniel
c93c4b88f7
chore: fix credo/dialyzer
2023-06-22 14:19:40 -04:00
Zach Daniel
0b6d93c7c4
feat: add field_policies
...
see included documentation for more information on how field policies
work.
2023-06-22 14:00:11 -04:00
Zach Daniel
1a9b2c8406
improvement: fix loading w/ only nil values
2023-06-22 10:37:25 -04:00
Abhishek Tripathi
06329b97cf
improvement: add verifier for identity fields. ( #626 )
...
* improvement: adds verifier for identity fields.
---------
Co-authored-by: abhishek <abhishek.tripathi@tinymesh.in>
2023-06-20 01:05:41 -04:00
Zach Daniel
a7d069ae30
fix: properly set notification_data from loaded record
2023-06-14 20:40:04 -04:00
Zach Daniel
3f3a588df8
fix: properly handle lazy loaded many to many relationships
2023-06-14 19:52:05 -04:00
Dmitry Maganov
1ca4d9870a
fix: honor not_found_error?: true
opt in code interface get actions ( #620 )
2023-06-14 09:43:51 -04:00
Zach Daniel
0e12686c61
fix: ensure attributes for keyset pagination are selected
2023-06-14 07:38:43 -04:00
Dmitry Maganov
984968d8ba
improvement: add support for generic actions in api.can
( #617 )
2023-06-13 09:35:27 -04:00
Dmitry Maganov
939b25d727
feat: generate some action helpers with code interface ( #614 )
2023-06-12 22:59:17 -04:00
Zach Daniel
d47dbe239c
improvement: properly pass calculation args in keyset filters
2023-06-11 20:48:42 -04:00
RaspberryLambda
ffaf6d57df
* improvement: add data layer introspection to Ash.Resource.Info ( #610 )
...
---------
Co-authored-by: Daniel Stewart <mgdog1@googlemail.com>
2023-06-10 13:17:17 -04:00
Zach Daniel
be57b909b5
fix: honor query limit when streaming
2023-06-10 13:09:45 -04:00
Zach Daniel
25acc2d793
improvement: better keyset pagination behavior on first and last pages
2023-06-09 15:08:49 -04:00
Zach Daniel
6320dad188
fix: various fixes to data loading
...
improvement: `Ash.Query.accessing/2` to get a list of fields being accessed
improvement: builting `LoadAttribute` and `LoadRelationship` calculations
2023-06-09 00:16:27 -04:00
Zach Daniel
907aec5e82
improvement: support loading through types
...
Will document this in a separate PR. The broad strokes are this:
1. to load through an attribtue, `load(attribute: [:nested: :stuff])`
2. to load through a calculation, `load(calculation: {:%{...input}, nested: :stuff})`
3. union types support loading through them, and is done first by keying by the type name, i.e: `load(union: [type_name: [nested: :stuff])`.
4. union types support specifying a load statement for all types with `load(union: [*: [nested: :stuff]])`
2023-06-07 21:54:17 -04:00
Adam Harris
87045f3984
chore: add failing test to illustrate calculation issue
2023-06-07 10:13:08 -04:00
Zach Daniel
8e7815388e
improvement: handle nil
s in memory the same way sql would have
2023-06-05 16:50:27 -04:00
Barnabas Jovanovics
5477102104
fix: also do not autogenerate values for optional fields that have a generator ( #599 )
2023-06-05 08:57:22 -04:00
Barnabas Jovanovics
1185b615f8
fix: Only create values for attributes that did not get a generator ( #595 )
2023-06-02 08:18:02 -04:00
Dmitry Maganov
adb6cefac1
fix: remove field name from string length error message ( #594 )
...
* fix: remove field name from string length error message
* fix: remove old unused `Error.Changes.UnknownError`
* fix: do not capitalize ash error messages
* fix: change error kind code for `Ash.Error.Forbidden.Policy`
2023-06-01 02:29:19 -04:00
Zach Daniel
5af9dc6696
fix: properly honor the return_errors?
option
2023-05-25 09:46:27 -04:00
James Harton
7326ca330e
improvement(Ash.Type.Module): Add :module
type. ( #578 )
2023-05-15 07:26:52 -04:00
Zach Daniel
f04ffd5ebd
improvement: support bulk upserts
2023-05-02 21:56:15 -04:00
Zach Daniel
523452cb94
docs: basic actions -> generic actions
2023-05-02 20:00:18 -04:00
Zach Daniel
1e61ae2d3c
improvement: finishing initial touches on bulk actions
2023-05-02 17:24:24 -04:00
Zach Daniel
0ced9c7639
fix: assorted bulk create fixes
2023-05-02 14:04:08 -04:00
Zach Daniel
80f696417d
improvement: bulk create actions
...
This is not currently supported by any data layer other than ETS
2023-05-02 13:19:00 -04:00
Zach Daniel
2843224f06
fix: handle invalid input in basic actions
2023-05-02 02:07:53 -04:00
Zach Daniel
49949ff58f
improvement: initial support for basic actions
2023-05-02 01:54:53 -04:00
Zach Daniel
fbd2b2f50c
fix: set flow argument defaults
2023-04-27 13:42:18 -04:00
Zach Daniel
fbc341b3a0
feat: add Api.stream!/1
2023-04-26 17:12:21 -04:00
Zach Daniel
38ec164e3e
improvement: include resource validations by default
...
improvement: validate explicit api configurations, with good error messages
2023-04-25 21:31:01 -06:00
Frank Dugan III
2e5f045f72
feat: add fields/1
and public_fields/1
to Ash.Resource.Info ( #569 )
2023-04-20 12:27:13 -06:00
Zach Daniel
ba5a7e2cb7
improvement: automatically gather up notifications
2023-04-12 17:35:17 -04:00
Zach Daniel
29096c27ae
fix: properly return errors on invalid calculation arguments
2023-04-08 03:39:41 -04:00
Barnabas Jovanovics
b5e0cbb3cc
improvement: add constraints to maps ( #556 )
2023-04-07 09:53:41 -04:00
Zach Daniel
a20ee0abf7
chore: fix tests/stacktrace setting
2023-04-06 10:23:17 -04:00
Zach Daniel
80616781d6
Revert "chore: fix tests"
...
This reverts commit 67305a6ec8
.
2023-04-06 09:38:21 -04:00
Zach Daniel
67305a6ec8
chore: fix tests
2023-04-06 09:32:10 -04:00
Zach Daniel
92208d8f84
chore: fix tests and add_expression_part
2023-04-05 20:49:28 -04:00
Zach Daniel
1ecde072f0
chore: consider strings in ref
2023-04-05 18:37:42 -04:00
Zach Daniel
a6e3ff233e
fix: various ash flow return value fixes
2023-04-04 15:36:08 -04:00
Tommaso Patrizi
ad0a0ee8f7
test: tests for custom steps returning nil even when there is a right result ( #552 )
...
Co-authored-by: Tommaso Patrizi <tommasop@gmail.com>
2023-04-04 13:33:07 -04:00
Mariusz Morawski
a0287f96a0
fix: Fix set_new_attribute by adding missing option to set_attribute ( #553 )
2023-04-04 10:35:30 -04:00
Alan Heywood
698cbd1f4c
improvement: Add :field option to relate_actor change ( #546 )
2023-04-02 21:50:32 -04:00
Zach Daniel
a9db35e79f
fix: properly handle nested calculation selects
2023-03-31 12:36:20 -04:00
Zach Daniel
7f1ee67dde
improvement: update spark to fix deeply nested DSLs
2023-03-31 11:54:44 -04:00
Zach Daniel
648572386a
improvement: properly set related resource
2023-03-30 08:27:37 -04:00
Zach Daniel
43d0233ae9
chore: fix test
2023-03-29 21:46:30 -04:00
Zach Daniel
1db7025b41
test: add a test for calc -> calc -> attribute chain
...
chore: simplify some code
2023-03-29 21:34:50 -04:00
Alan Heywood
6e76a91215
improvement: add :subfield option to relates_to_actor_via ( #540 )
2023-03-29 12:11:23 -04:00
Zach Daniel
b4163127f9
improvement: add accessing_from/2
builtin check
2023-03-29 09:19:49 -04:00
Zach Daniel
24d802cd4b
fix: use values when already loading aggregates
2023-03-29 08:02:10 -04:00
Zach Daniel
ad347ca38b
improvement: rewrite calculation loader
...
Calculation loading is complex because different calculations can
depend on differently parameterized things. FOr example:
```elixir
def load(_, _, _), do: [foo: %{arg: 1}]
def load(_, _, _), do: [foo: %{arg: 2}]
```
The previous naive implementation would simply merge all of the calculation loads, which naturally would not work. Now we ensure that we load each requirement in isolation.
2023-03-28 20:34:15 -04:00
Zach Daniel
ed45a72ea6
improvement: add skip_global_validations?
option for actions
2023-03-21 13:33:48 -04:00
Zach Daniel
65f21e76be
fix: datetime_add was actually datetime_subtract in elixir
2023-03-21 09:37:10 -04:00
James Harton
171967d6de
improvement: Add get_by
option to read actions. ( #530 )
2023-03-21 18:03:06 +13:00
Zach Daniel
8b722e6460
fix: various fixes in aggregate authorization behavior
...
improvement: add `:read_action` and `:authorize?` configurations for resource aggregates
2023-03-17 12:02:37 -04:00
James Harton
a8346907c1
improvement: Add before_action/1
and after_action/1
to Ash.Resource.Preparations.Builtins
. ( #526 )
2023-03-13 19:20:41 -04:00
Zach Daniel
5e5511aa60
chore: fix tests
2023-03-13 18:41:38 -04:00
Zach Daniel
a559a0cd3f
improvement: add Ash.Type.NewType
2023-03-13 17:44:27 -04:00
Zach Daniel
b899a6ecf3
improvement: optimize policy check running with laziness
...
Implemented lazy evaluation of individual checks, so that checks that
are demonstrably irrelevant when building policies are not checked at all.
This will often mean no need to visit the sat solver at all, or only with
a very minimal set of filter checks.
2023-03-10 13:29:29 -05:00
James Harton
ee99bf367f
improvement: Add builtin changes for lifecycle hooks. ( #523 )
2023-03-09 19:59:39 -05:00
Zach Daniel
c643e9a88f
improvement: add Api.can?
and Api.can
2023-03-08 16:34:44 -05:00