Commit graph

128 commits

Author SHA1 Message Date
Zach Daniel
ec76778b49 chore: backport fixes from 2.0 2024-04-04 14:45:03 -04:00
Zach Daniel
f8384e44b5 improvement: add skip_unknown_inputs option, use it for embeds in unions 2024-03-28 16:29:37 -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
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
d013818c0a improvement: handle pkey-less resources when attaching fields
improvement: set lazy defaults when applying changeset attributes
2024-01-21 00:45:35 -05:00
Zach Daniel
3db822d775 improvement: optimize embedded resource creation 2024-01-19 09:58:54 -05:00
Zach Daniel
072486bebd docs: revamp hexdocs
fix: use current read action for counting
2024-01-12 14:07:35 -05:00
Zach Daniel
63c15bbfe9 improvement: error on using relate_actor with :many cardinality relationships 2024-01-10 05:56:22 -05:00
Zach Daniel
3be83d6ca4 improvement: lay the groundwork for fully atomic actions 2023-12-16 10:14:02 -05:00
Zach Daniel
14db149473 chore: update spark 2023-12-12 20:38:51 -05:00
Zach Daniel
e680867be9 fix: don't reorder global validations/changes
fix: use latest spark, and new persisters callback
fix: properly validate belongs_to relationships
2023-10-25 17:45:55 -04:00
Zach Daniel
7f7469eb9f improvement: various performance improvements 2023-10-17 01:08:26 -04:00
Zach Daniel
969ebf7f3f docs: update spark to fix docs 2023-10-11 09:30:22 -04:00
Zach Daniel
1042ea14fd chore: use uuids instead of unique integer for performance reasons 2023-10-03 13:42:18 -04:00
Zach Daniel
5c8f96231e docs: finalize initial cheat_sheet/docs pattern 2023-09-26 23:13:40 -04:00
Zach Daniel
55f15c8427 chore: update ex_doc 2023-09-21 18:52:11 -04:00
Zach Daniel
0a1f56d58b chore: update cheat_sheets 2023-09-20 16:29:47 -04:00
Zach Daniel
17b1a0b2df fix: properly wrap [tracer] in Ash.Flow 2023-09-20 13:31:58 -04:00
Zach Daniel
4764094145 docs: improve doc cheat sheets 2023-09-15 12:16:54 -04:00
Zach Daniel
b9488dbbcb chore: release version v2.14.17 2023-09-15 11:41:41 -04:00
Zach Daniel
ab52855600 improvement: recommit the dsl cheatsheets, and update ash-ci 2023-09-14 17:16:35 -04:00
Zach Daniel
6e2d1fd0ac docs: greatly improved DSL documentation in hex 2023-09-13 22:17:18 -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
0b6d93c7c4 feat: add field_policies
see included documentation for more information on how field policies
work.
2023-06-22 14:00:11 -04:00
Barnabas Jovanovics
b5e0cbb3cc
improvement: add constraints to maps (#556) 2023-04-07 09:53:41 -04:00
Zach Daniel
7f1ee67dde improvement: update spark to fix deeply nested DSLs 2023-03-31 11:54:44 -04:00
Zach Daniel
b425b243f5 improvement: update spark for latest doc improvements 2023-02-05 18:08:01 -05:00
Zach Daniel
a2a04f66af chore: clean up unused dependencies from lockfile 2023-02-01 01:01:23 -05:00
Zach Daniel
e900d00de8 ci: remove tweets/switch to standardized CI pipeline 2023-01-31 11:15:09 -05:00
Zach Daniel
306ecd01e4 chore: update to latest spark 2023-01-27 15:50:47 -05:00
Zach Daniel
167dba67ca improvement: upgrade to latest spark for compile time improvements
improvement: improve compile times by reorienting some compile deps
2023-01-27 15:32:28 -05:00
Zach Daniel
5006e79593 chore: release version v2.5.4 2023-01-18 00:41:08 -05:00
Zach Daniel
b2fb3b4254 chore: release version v2.5.0 2023-01-10 21:52:36 -05:00
Zach Daniel
f9ed91953b fix: import builtins at the action level, not the section level 2022-12-22 19:09:47 -05:00
Zach Daniel
41fc04dd85 improvement: update spark 2022-12-15 03:57:59 -05:00
Zach Daniel
b1bbd979d4 fix: don't lock specific nimble options version 2022-12-07 16:50:56 -05:00
Zach Daniel
a6ca9511c7 fix: set proper types in transaction reasons 2022-12-01 12:06:51 -05:00
Zach Daniel
a2fc21a218 chore: fix dialyzer 2022-11-15 21:39:57 -05:00
Zach Daniel
d8ae4da1b3 docs: use new spark doc index guide order 2022-11-15 14:47:25 -05:00
Zach Daniel
665a9fb5c4 improvement: optimize sat solving
1. only convert to CNF once
2. group predicates that only appear in specific combinations to limit amount of variables provided to the sat solver

Number 2 above does technically slow down all cases a bit, but the optimization is really important when it matters. And cases that don't need this optimization still happen on the order microseconds anyway.
2022-11-15 01:45:55 -05:00
Zach Daniel
1dcb9dd8c4 docs: library links 2022-11-03 08:19:35 -07:00
Zach Daniel
a0e5b2cb7d docs: small docs tweaks
improvement: update to latest spark
2022-11-03 00:47:24 -07:00
Zach Daniel
85e121bcd7 chore: update to latest spark 2022-10-30 22:11:56 -04:00
Zach Daniel
8cbd766172 feat: support anonymous functions in DSL
improvement: add more ergonomic manual action definitions.

The old method will likely be deprecated some time in the future (there is no rush really, they both work).
2022-10-30 21:00:57 -04:00
Zach Daniel
1718314f40 chore: update spark 2022-10-28 10:34:43 -05:00
Zach Daniel
e52d7187d8 improvement: more additions to the resource builder, update spark
test: add a test for loading many to many relationships on code interface actions
2022-10-28 10:18:01 -05:00
James Harton
2d6762ae61
feat(Ash.PlugHelpers): standardise conn interface for actors/tenants. (#432) 2022-10-27 17:52:42 -05:00
Zach Daniel
6b9cff5d43 feat: add Ash.Resource.Builder, the start of DSL builder utilities of rextension writing 2022-10-24 12:04:56 -06:00
Zach Daniel
986e08e0c2 fix: properly compare against decimal values
improvement: support floats & decimals in the `compare` validation
2022-10-21 10:46:46 -04:00