Commit graph

536 commits

Author SHA1 Message Date
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