Commit graph

252 commits

Author SHA1 Message Date
Zach Daniel
80b48335ec docs: fix typo 2024-04-04 22:06:59 -04:00
Zach Daniel
0a469257f0 docs: continue work on docs 2024-04-04 21:31:18 -04:00
Zach Daniel
82802890b2 docs: update wording of model your domain, derive the rest 2024-04-04 20:35:13 -04:00
Zach Daniel
950ff3d060 fix: set tenant in bulk creates after setting up changeset 2024-04-04 20:34:37 -04:00
Zach Daniel
b7ca907224 docs: alter wording of what-is-ash.md 2024-04-04 20:00:00 -04:00
Zach Daniel
61b1b2a359 docs: update what-is-ash.md 2024-04-04 19:45:52 -04:00
Zach Daniel
3cfa980762 docs: start on docs overhaul 2024-04-04 16:24:55 -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
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
Dmitry Kulakov
5846b70315 feat: allow using custom delimiters for pubsub topics 2024-02-11 16:45:05 -04:00
Alexander Richard Römpke
f7024f2b6c
docs: Update constraints.md (#869)
The username is not an argument, i replaced it with the argument title.
2024-02-06 09:45:32 -05:00
Steve Frank
7bb3addb38
docs: Add 'use Ash.Resource.Validation' to documentation (#865) 2024-02-02 12:27:15 -05:00
Zach Daniel
8e82d9588f chore: better handling of atomic validations 2024-01-29 17:55:56 -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
072486bebd docs: revamp hexdocs
fix: use current read action for counting
2024-01-12 14:07:35 -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
Rebecca Le
13f8a0c0cb
docs: Rewrite some of the pagination guide to be a bit clearer (#829)
* docs: Rewrite some of the pagination guide to be a bit clearer

---------

Co-authored-by: Zach Daniel <zachary.s.daniel@gmail.com>
2024-01-11 10:04:20 -05:00
Rohan Relan
426e471cbe
docs: Update security.md to fix bug in showing when to pass the actor (#817) 2024-01-05 10:07:43 -05:00
Zach Daniel
fe2156a9ac imorovement: support bulk action callbacks in the data layer 2023-12-31 00:49:22 -05:00
Chakib Ouhajjou
c7738255f0
docs: Sorting for hex documentation added (#810) 2023-12-27 10:22:59 -05:00
Zach Daniel
d390d65146 improvement: simplify used aggregate detection
improvement: add `lazy/1` to expressions
docs: add expression docs
2023-12-22 19:06:13 -05:00
Igor Barakaiev
15a607eea2
docs: Add a cross-API many-to-many example to the documentation (#800)
* Add a cross-API many-to-many example
---------

Co-authored-by: Zach Daniel <zachary.s.daniel@gmail.com>
2023-12-10 13:01:58 -05:00
Zach Daniel
c7e6133317 improvement: support embed_nil_values? for trimming down stored embeds 2023-12-06 10:29:39 -05:00
Darren Black
a6f96960ee
docs: Manual actions doco (#788)
* Manual action documentation tweaks

* More
2023-12-01 09:40:52 -05:00
Zach Daniel
1cb544ddfa docs: small tweak to lifecycle example 2023-11-17 03:23:52 -05:00
Zach Daniel
d738e56fac chore: format 2023-11-16 15:20:28 -05:00
Zach Daniel
09d4d380c2 chore: add lifecycle cheat-sheet 2023-11-16 15:15:28 -05:00
Bryan Bryce
37058a5b78
doc: Fix module reference in Relationship Guide (#774) 2023-11-14 17:19:19 -05:00
James Harton
173f4ae5ad
docs: Spelling fix (wether -> whether). (#764)
Wether: noun
  1. A castrated male sheep or goat.

Whether: conjuction
  1. Used to indirect questions to introduce one alternative.
  2. Used to introduce alternative possibilities.
  3. Either.
2023-11-09 15:52:13 +13:00
James Harton
050af513fd
docs: Add note about returning resources from generic actions. (#763) 2023-11-06 10:49:13 +13:00
Zach Daniel
291dea3de9 docs: update docs for pub sub 2023-10-27 13:22:33 -04:00
Barnabas Jovanovics
b843de6d78
docs: explicitly mention read action (#754) 2023-10-25 11:20:08 -04:00
user20230119
a4f9115e63
docs: fix typos for attribute, writable and update_default (#753) 2023-10-25 10:08:14 -04:00
Frédérick Capovilla
bb666ee94e
docs: link to the ash_postgres references documentation in the Relationships guide (#748)
---------

Co-authored-by: Zach Daniel <zachary.s.daniel@gmail.com>
2023-10-21 22:39:15 -04:00
Marcus Wood
95966db148
docs: Fix typo in expressions topic (#732) 2023-10-11 08:24:31 -04:00
Veljko Simakovic
37b0c4d9d0
docs: Improve pagination guide (#719)
Added a section at the bottom which details where the options are and clears up the need to setup actions and how to query for pagination.
2023-10-02 18:56:48 -04:00
Zach Daniel
e1ac4150a9 docs: add additional docs for validations 2023-09-29 10:11:14 -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
9d0359a2ed docs: add primers to docs 2023-09-20 18:01:33 -04:00
Zach Daniel
6e2d1fd0ac docs: greatly improved DSL documentation in hex 2023-09-13 22:17:18 -04:00
Zach Daniel
1f319faf97 improvement: support trace_type?/2 in tracers 2023-09-12 11:54:04 -04:00
Zach Daniel
47fbf4b35a improvement: support multiple tracers, instead of just one 2023-09-12 10:54:42 -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
6381171eb6 improvement: add topic docs for atomics 2023-08-28 16:19:07 -04:00
Zach Daniel
456588bd07 docs: add in-line aggregates to expression calculation docs 2023-08-22 14:49:16 -04:00
Tchowa Franck A
f07c5c41ea
Update documentation to include user_id in query. (#670) 2023-08-12 10:57:12 -07:00
Zach Daniel
1871e19fa9 improvement: added round/1 and round/2 to expressions 2023-07-27 11:49:02 -04:00
Zach Daniel
bda7c56543 improvement: support parent/1 in relationships 2023-07-26 16:46:22 -04:00
Anuvrat Parashar
ff366a728b
docs: refer to variable instead of constant in the function body (#663)
Co-authored-by: Anuvrat Parashar <anuvrat@essentia.dev>
2023-07-20 02:36:12 -04:00
Zach Daniel
8c9b636886 docs: fix docs typo 2023-07-13 00:11:28 -04:00
Zach Daniel
7114b5efbb improvement: exists type aggregate 2023-07-13 00:08:51 -04:00
Zach Daniel
8379e8c94f docs: document at/2 expression 2023-07-12 16:54:20 -04:00
Zach Daniel
d27e871b8f improvement: add string_split expression 2023-07-12 15:11:21 -04:00
Zach Daniel
b86c66b505 fix: don't allow is_nil as an expression operator 2023-06-28 16:41:34 -04:00
Zach Daniel
2c129a7ab7 fix: select after setting notification data
resolves a bug where attributes were not selected for create notifications

docs: add validations guide

closes #631
2023-06-28 11:03:51 -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
43585d5617 docs: explain nil handling in expressions better 2023-06-05 17:11:32 -04:00
Zach Daniel
c62e76a3d2 docs: fix broken link in security guide 2023-05-29 10:06:34 -04:00
Barnabas Jovanovics
1ddba9499c
docs: fix typo (#585) 2023-05-24 08:41:57 -04:00
Zach Daniel
db715f5153 docs: remove reference to filter option in Query.aggregate 2023-05-10 23:17:46 -04:00
Alan Heywood
40cd0a697d
docs: add simple notifiers to the notifications guide (#571) 2023-05-04 02:09:26 -04:00
Zach Daniel
e05b5058dc docs: bulk actions docs 2023-05-02 20:08:25 -04:00
Zach Daniel
523452cb94 docs: basic actions -> generic actions 2023-05-02 20:00:18 -04:00
Zach Daniel
3a6d79e1c6 improvement: bulk create improvements, docs 2023-05-02 19:48:29 -04:00
Zach Daniel
2e543bc212 docs: describe basic actions 2023-05-02 02:01:12 -04:00
Zach Daniel
49949ff58f improvement: initial support for basic actions 2023-05-02 01:54:53 -04:00
Zach Daniel
13591a4681 chore: docs & deprecations 2023-04-13 09:24:37 -04:00
Zach Daniel
ed45a72ea6 improvement: add skip_global_validations? option for actions 2023-03-21 13:33:48 -04:00
Zach Daniel
a559a0cd3f improvement: add Ash.Type.NewType 2023-03-13 17:44:27 -04:00
Rebecca Le
d6178a026c
docs: rewrite Policies guide to be clearer (#524)
Co-authored-by: Zach Daniel <zachary.s.daniel@gmail.com>
2023-03-10 12:50:25 -05:00
Nick Bosch
360d72d506
docs: improve relationships topic guide (#521) 2023-03-09 19:06:10 -05:00
Axel Baudot
6a95ae388a
docs: add drop-in configuration code snippet for the Spark formatter plugin. (#522) 2023-03-09 15:31:51 -05:00
Zach Daniel
fcda41eb14 docs: update actions guide 2023-03-03 13:12:17 -05:00
Zach Daniel
44d744daba improvement: add new date expressions
chore: fix dialyzer
2023-03-03 11:08:38 -05:00
Zach Daniel
41ea63aed3 improvement: support record's as calculate arguments 2023-02-24 10:54:25 -05:00
Darren Black
bc1f8382ab
improvement: Implement string_join expr function (#515) 2023-02-21 09:40:58 -05:00
Rebecca Le
313fdb6c18
docs: Add Glossary guide (#502) 2023-02-20 20:20:04 -05:00
Chris Hopkins
78fa58c2b9
docs: Attribute documentation topic (#514) 2023-02-17 10:03:23 -05:00
Zach Daniel
73c3b1a629 docs: update calculation example with better arg 2023-02-12 11:12:19 -05:00
Zach Daniel
2c8b07fd0b docs: add load/3 to calculation docs 2023-02-12 10:52:27 -05:00
Zach Daniel
85a66b1d85 improvement: add before_transaction and after_transaction 2023-02-10 14:12:19 -05:00
Isaak Tsalicoglou
d1cc4db5d4
docs: Update flows.md to fix copy/paste error of action atom (#507) 2023-02-09 09:22:16 -05:00
Zach Daniel
0632c76606 docs: update elixir_sense docs 2023-02-05 22:34:10 -05:00
Rebecca Le
e8563a03eb
docs: Render api_short_name visibly in the Monitoring guide (#500) 2023-01-31 23:20:51 -05:00
Zach Daniel
28b7def5c9 improvement: no async loads except when loading on initial data 2023-01-30 00:06:34 -05:00
Zach Daniel
7ea8c38095 docs: add config to getting started guide, fix dsl links 2023-01-25 10:16:32 -05:00
Zach Daniel
45ad1c6afa docs: document pub_sub debug option
fix: properly prepend the prefix to the topic
2023-01-20 11:31:31 -05:00
Zach Daniel
897308ba3a
improvement: update docs to new links formats for ash_hq (#483) 2023-01-18 00:34:20 -05:00
Zach Daniel
d471a94ccc fix: properly set the context option on changesets
docs: add section on `Ash.CodeInterface.define_interface/2`
improvement: add `action_is/1` builtin validation
2023-01-12 09:18:49 -05:00
Zach Daniel
70bc983b17 improvement: add Api.calculate/3 and define_calculation code interface builder 2023-01-08 23:39:12 -05:00
Zach Daniel
e804566cbf improvement: rename this to parent for clarity 2023-01-05 12:25:55 -05:00
Zach Daniel
c962bc7aa7 feat: add this/1 for use inside exists/2 (and other places eventually)
fix: various fixes to expression syntax
2023-01-04 12:17:40 -05:00
Zach Daniel
c32d3cc49a improvement: warn on potentially incompatible relationship attributes
improvement: add `default_belongs_to_type` configuration
2023-01-03 10:52:19 -05:00
Maxim Martynov
7841075f35
improvement: Add Ash.Error.Invalid.TenantRequired error (#471) 2022-12-29 23:05:41 -05:00
Mariusz Morawski
70b6a52b08
docs: Fix wrong policy explanation module in docs. (#465) 2022-12-20 03:19:01 -05:00
Justin Lane
f882889751
docs: Update Code Interface Doc (#461) 2022-12-15 21:47:32 -05:00
Zach Daniel
96409416cf improvement: more dependable notifications, support custom notifications better 2022-12-09 22:55:51 -05:00