Commit graph

81 commits

Author SHA1 Message Date
Zach Daniel
3c2f51224a chore: get build passing 2024-07-19 12:40:09 -04:00
Zach Daniel
dd5bf4a0c0 improvement: update spark for docs fixes, hide aggregate kind 2024-07-17 08:04:17 -04:00
Rebecca Le
a49d99b67f
docs: Set default value for include_nil? aggregate option (#1315)
* docs: Note that the `kind` option is pre-set for aggregates when using the DSL
2024-07-17 07:45:01 -04:00
Zach Daniel
5215c4e124 chore: fix build 2024-07-15 08:18:01 -04:00
Alessio Montagnani
7f2e7d3ec1
improvement: bring uuid version 7 into the core (#1253) 2024-06-23 18:16:20 -04:00
Zach Daniel
dc94f3a743 improvement: support nils_distinct? on identities
improvement: support `where` option on `identities`
improvement: allow calculations in identity keys

closes #1001
closes #1182
2024-05-24 00:24:42 -04:00
Zach Daniel
e63d80e645 fix: handle subquery-requiring calculations in calculate/2 2024-05-23 17:33:29 -04:00
Zach Daniel
feb187bdf6 improvement: add atomic_upgrade? flag to update/destroy actions
improvement: do not do atomic upgrade by default unless `require_atomic?` is `true`
improvement: allow configuring the read action used by atomic upgrades
2024-05-23 11:05:17 -04:00
ab3786ebf6
feat(Ash.Reactor): Add bulk_update step type. (#1185) 2024-05-22 15:26:51 +12:00
1d5d247d7a feat(Ash.Reactor): Add bulk_create step type. 2024-05-21 09:14:02 +12:00
Zach Daniel
751153990b docs: add alternatives guide 2024-05-16 09:38:31 -05:00
Zach Daniel
124a3c734e improvement: better types for checks, for spark autocomplete
chore: update spark
2024-05-14 11:38:33 -04:00
Zach Daniel
b48c989b15 fix: don't check required belongs to fields until after setting them in bulk creation
docs: fix doc links for code interface guide

fixes #1154
2024-05-12 14:12:24 -04:00
Zach Daniel
48c6438212 improvement: change default timeout to :infinity, for efficiency 2024-05-07 17:01:11 -04:00
Moxley Stratton
65ad0c6039
docs: Add doc text to the default option (#1077)
* Add doc text to  option

* Second version of the change

* Adjust docs for `:default`, and generate .md files

* Fix type
2024-05-01 16:03:09 -04:00
Sergey Moiseev
417d39e7de
Add documentation on disabling pagination (#1076) 2024-04-29 20:40:19 -04:00
Zach Daniel
28c75df7b8 improvement: support new data layer capability calculate/3
fix: solve for custom expressions and one-off calculations
2024-04-29 16:58:37 -04:00
Zach Daniel
69b5bd3d3c chore: update cheat sheets 2024-04-29 07:54:50 -04:00
Frank Dugan III
35961a793d
feat: leverage resource domain for eager/pre checking (#1040)
closes #1022
2024-04-22 17:15:27 -04:00
Riccardo Binetti
6d209e8836
feat: configurable multitenancy on read actions (#1030)
Allow making specific read actions able to optionally or totally bypass
multitenancy
2024-04-16 12:09:13 +01:00
Zach Daniel
bc69f904e2 improvement: support require_reference?: false on code interfaces
improvement: support `:filter` option on bulk create/destroy
2024-04-13 17:21:43 -04:00
Zach Daniel
bae263ca12 improvement: support omitting generic action return types 2024-04-10 13:46:44 -04:00
321f43bd05 feat(Ash.Reactor): Add new change step type which can be used to modify changesets. 2024-04-09 09:03:04 +12:00
2973c0db94 improvement(Ash.Reactor): Allow create to be provided an initial value.
The initial value can be either a resource or a changeset.
2024-04-09 09:03:04 +12:00
c67295de6e
improvement: Allow Reactor modules to be run directly from generic actions. (#993)
- Extends the generic action runner to detect when the `run` module is a Reactor and automatically executes it in the correct way.
- Adds a verifier that detects said actions and ensures that action arguments are present for all expected inputs.
2024-04-08 16:48:58 -04:00
Zach Daniel
4cbf2d3e14 docs: more restructuring, reviewing of guides 2024-04-08 13:39:45 -04:00
Zach Daniel
e91da15564 docs: moved around some documentation
docs: added changes guide
docs: moved around validations guide, removed extra one
2024-04-08 12:05:36 -04:00
Zach Daniel
d153b40dea docs: consolidate guides into relationships.md
improvement: add `Ash.Query.apply_to/3`
2024-04-07 15:31:26 -04:00
Zach Daniel
773e9cea91 docs: move identities guide 2024-04-07 14:50:18 -04:00
Zach Daniel
d2612a9ed8 docs: doc fixes, move code interface docs 2024-04-07 12:33:59 -04:00
Zach Daniel
49958975a1 chore: remove dedicated constraints guide, put it in Ash.Type 2024-04-07 10:52:18 -04:00
Zach Daniel
2226b00ca5 docs: more condensation/relocation of docs 2024-04-07 10:11:19 -04:00
Zach Daniel
f9eff8810f docs: refactor security guides 2024-04-06 17:40:05 -04:00
7721dc1c61
fix: multi-line DSL doc options in Ash.Reactor. (#974)
Closes #973.
2024-04-03 22:56:42 -04:00
Dmitry Maganov
43d2246530
improvement: support allow_nil_input dsl option in update/destroy (#964) 2024-04-01 17:26:21 -04:00
Zach Daniel
5967ed3a48 improvement!: 3.0 (#955)
* improvement!: use `%Ash.NotSelected{}` for unselected values

* improvement!: default `require_atomic?` to `true`

* improvement!: raise errors on unknown generic action arguments

* improvement!: default bulk strategy to `:atomic`

* improvement!: warnings on `require_atomic?` `true` actions
improvement!: revise `Ash.NotSelected` to `Ash.NotLoaded`
improvement!: errors on unknown action inputs across the board

* doc: clarify wording in notifiers.md

closes #889

* improvement!: default `api.authorization.authorize` to `:by_default`

* improvement!: require the api when constructing changesets

this commit also fixes some work from prior commits around
the default value for the `authorize` option

* improvement!: code_interface.define_for -> code_interface.api

`code_interface.define_for` is now `code_interface.api`. Additionally, it is set automatically if the `api` option is specified on `use Ash.Resource`.

* improvement!: remove registries

* improvement!: pubsub notifier default to `previous_values?: false`
improvement!: requires_original_data? callback defaults to false

* improvement!: rename Ash.Calculation -> Ash.Resource.Calculation
improvement!: improve `Ash.Query.Calculation.new` signature
improvement!: anonymous function calculations now take lists and return lists
improvement!: make callback contexts into structs
improvement!: pass context to builtin lifecycle hook changes
improvement!: calculation arguments are now in the `arguments` key of the context

* chore: fix build

* improvement!: remove `aggregates` and `calculations` from `Filter.parse` and `Filter.parse_input`

* improvement: update spark to 2.0

* improvement!: make picosat_elixir optional with `simple_sat`

* improvement!: rename api to domain

* docs: add more info to upgrading guide

* docs: tweak docs formatting

* improvement!: remove `Ash.Changeset.new!`

* docs: update docs for `Ash.Changeset.new/1`

* improvement!: deprecate `private?: false` in favor of `public?: true`

* doc: add upgrade guide for private -> public

* improvement: update reactor to 3.0

* improvement!: default `default_accept` is now `[]`

* improvement!: `Ash.CiString.new/1` returns `nil` on `nil` input

* improvement!(Ash.Reactor): Improve integration with Ash 3.0 changes.

* improvement!: clean up and reorganize `Ash` functions

this is in preparation of deprecating the functions that are defined
on the api

improvement!: remove context-based functionality

* chore: update docs references from `Ash.Domain` to `Ash`

* chore: fix bad merge

* chore: fix context access in atomic changes

* improvement!: Deprecate calling functions on (domain) api in favor of `Ash`

* improvement!: add `attribute_public?` and update `attribute_writable?` behavior

* improvement!: update atomic behaviors, default to invalid

* chore: update downcase docs

* improvement!: changeset.filters -> changeset.filter

* improvement!: remove deprecated functions

* improvement!: remove and simplify `Ash.Filter.TemplateHelpers`

* improvement: import Ash.Expr in modules where it is used
improvement: require Ash.QUery in modules where it makes sense

* fix!: keyword lists are no longer special cased in ash expressions

* improvement: add structs for more context implementations

* chore: small tweaks, finish `:all` -> `:*` conversion

* chore: update DSL docs for multitenancy.global?

* improvement: ensure selects are applied on destroys
chore: remove TODOs

* chore: some docs changes

* improvement!: introduce strict mode to calculations

* chore: update tests

* improvement: support custom expressions

* docs: document custom expressions

* chore: fix and test custom expressions and function fragments
docs: update relevant docs w/ the changes

* improvement!: reverse order of before action & before transaction hooks

* improvement!: default read actions are now paginatable

* improvement!: require explicit accept lists in default actions

* chore: update docs

* improvement!: remove Ash.Flow and Ash.Engine

* chore: unlock unused deps

* chore: don't use unused variable

* chore: include ash flow change in upgrade guide

* improvement!: standardize various exception keys and names

* improvement!: use `Splode` for errors

* improvement: update upgrade guide to include Splode

* feat: code interface on the domain

* improvement: only require primary key if resource has actions or fields
improvement: only build schema if resource has actions or fields
improvement: verify primary key in its own verifier

* improvement: add `resource/1` builtin check

* improvement!: move simple_notifiers to an option instead of a DSL builder
improvement!: update spark for better autocomplete, configure autocomplete for key functions
docs: replace `an domain` with `a domain`

* improvement: better code interface documentation

* fix: set tenant on query so that root calles to Api.aggreagte work as expected (#929)

* chore: fixes from previous improvements

* chore: update splode

* chore: update splode

* improvement!: swap position of sort order and arguments in calculation sorting

* improvement!: add `include_nil?` aggregate option, and default it to `false`

* improvement: support notifiers within actions

* improvement: support specifying multiple filters

* improvement: add `sortable?` flags to all fields
improvement: support multiple filters on relationships

* improvement: support sensitive? on calculations and arguments

* improvement: validate resources in inputs to code interface

* chore: don't require explicit accept lists when using `default_accept :*`

* chore: update spark

* chore: update public attribute handling per 3.0

* improvement: update reactor and tests

* chore: better error message

* chore: fix rebase issue

* chore: handle merge issues
improvement: don't require domain on relationships if destination has domain

* improvement!: errors on unknown inputs for calculations

* improvement: always choose to cast atomic

* improvement: support casting some embeds atomically

* improvement: various 3.0 updates, documented in upgrade.md

* chore: Add failing tests for loads with with explicit domains. (#948)

Co-authored-by: James Harton <james@harton.nz>

* improvement: ensure non-static dynamic domains works

* improvement: add Ash.ToTenant protocol

* chore: add docs for no ToTenant option

* fix: properly construct new query in `build/3`

* chore: update simple_sat dependency

* chore: don't reselect when missing primary keys

* chore: remove IO.inspect

* chore: update spark

* chore: update spark

* improvement: use `Keyword.put_new` in `Ash.Context.to_opts` (#953)

* improvement: support bulk and atomic operations in code interfaces

---------

Co-authored-by: James Harton <james@harton.nz>
Co-authored-by: WIGGLES <55168935+WIGGLES-dev@users.noreply.github.com>
Co-authored-by: Dmitry Maganov <vonagam@gmail.com>
2024-03-27 16:31:59 -04:00
Zach Daniel
aafeab5e94 fix: use proper logic for atomic present validations
improvement: cast atomic reference types, makes life easier for data layers
2024-03-19 00:04:57 -04:00
Zach Daniel
b7cb89c481 chore: ensure constrainted attributes appear in casted_*
chore: update dsl docs
2024-03-11 12:18:17 -04:00
e5f01bbd59
improvement(Ash.Reactor): Backport improvements from 3.0 branch. 2024-03-08 10:51:40 +13: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
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
944f69b16e fix: properly annotate run_flow's recursive DSL tag
docs: update spark & docs
2024-02-16 21:25:18 -05:00
Zach Daniel
5253c3c3f2 docs: update manual action cheatsheets 2024-02-16 16:52:59 -05:00
Rebecca Le
407eee5785
docs: Correct example used for manual actions (#886)
In my testing, arguments to a manual action are part of the `arguments` in the input to the `run` function - which is the action struct itself.
2024-02-14 09:35:34 -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
6288a60db3
docs: Update Ash.Notifier.PubSub DSL docs. 2024-02-12 10:04:06 +13: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
d7721d9b1e chore: docs & formatter 2024-01-29 18:03:56 -05:00
Dmitry Maganov
c8b1eaa8f0
fix: soft? in destroy action options is a boolean, not an atom (#851) 2024-01-24 14:52:31 -05:00
Dmitry Maganov
91c34c3939
fix: join_relationship in many to many can make through optional (#846) 2024-01-23 13:15:51 -05:00