Commit graph

167 commits

Author SHA1 Message Date
Zach Daniel
4fc53baf5f improvement: add eager validate identities
improvement: percolate `nil` values in operators in ash expresion language (like SQL)
chore: more docs work
2022-04-06 12:00:32 -04:00
Zach Daniel
7c13322aa4 improvement: add return_destroyed? option 2022-04-05 12:42:50 -04:00
Zach Daniel
6c523b9752 continue working on docs 2022-04-04 14:55:05 -04:00
Zach Daniel
022708c6b5 improvement: add api option to relationships
improvement: make default actions and primary actions far more explicit

this begins the official 2.0.0 work
2022-04-04 01:48:37 -04:00
Zach Daniel
7ba9715f27 fix: fix hanging issue when adding engine requests 2022-03-20 01:08:39 -04:00
Zach Daniel
a53b61ddf4 feat: add Ash.Flow
feat: support recursive DSL entities.
improvement: unimport to avoid name collisions in nested DSLs
2022-03-15 17:42:29 -04:00
Zach Daniel
ba1b39536e feat: manual relationships
fix: make the formatter safer, again
2022-02-20 22:46:39 -05:00
Zach Daniel
83b2d13910 improvement: track defaults being set 2021-11-24 19:09:39 -05:00
Zach Daniel
034ed97efe fix: simplify and improve allow_nil checking 2021-11-09 03:26:50 -05:00
Zach Daniel
f16ffb3782 improvement!: breaking!: explicitly setting a value to nil on create no longer falls back to the default value
This behavior is more expected than silently switching back to the default, but it does have the potential
to cause issues for those relying on the old behavior. To get the *old* behavior, you'd want to add a change
that does something like `if is_nil(Ash.Changeset.get_attribute(changeset, :attribute)) do` to check if
it should set the value, and then uses `Ash.Changeset.change_attribute/2` to make the change
2021-11-09 00:39:19 -05:00
Zach Daniel
922c87ea85 improvement: add resource registry validation
fix: move related field validations to resource
fix: remove join_attributes, which didn't do anything anyway
2021-10-11 15:14:33 -04:00
Zach Daniel
ff756b72a7 improvement: deprecation!
A deprecation warning will be shown at compile time to illustrate
a change from listing all of your resources in an api to listing
them in a registry and connecting that registry to the api
2021-10-07 02:41:02 -04:00
Michael St Clair
8af32a0053
chore: Bring over changes committed to master branch (#271)
Co-authored-by: kernel-io <git@omnium.co>
Co-authored-by: Zach Daniel <zach@zachdaniel.dev>
Co-authored-by: kernel-io <kernel-io@users.noreply.github.com>
2021-10-01 23:27:35 -04:00
Zach Daniel
650b256b2a test: fix tests w/ new get change 2021-09-09 02:18:26 -04:00
Zach Daniel
46f17dcc51 test: test manage_relationship on update 2021-08-05 00:46:53 -04:00
Zach Daniel
1c83f96d27 fix: allow before_action to manage belongs_to relationships 2021-08-04 11:35:32 -04:00
Darren Black
f3b622744d
chore: Failing test for updating a relation in a change (#258) 2021-08-04 10:53:55 -04:00
Zach Daniel
8e11a63e83 fix: load belongs to relationships before managing them 2021-08-03 03:26:01 -04:00
Zach Daniel
9477f0e82a improvement: add {:arg, :name} input for set_attribute 2021-06-25 13:51:17 -04:00
Zach Daniel
d45a9dbbfa improvement: support calculation sorts 2021-06-05 18:11:09 -04:00
Zach Daniel
d247004610 feat: expression based calculations for filterable/sortable calculations
fix: aggregate authorization issues
improvement: tons of improvements across the board
2021-06-04 01:40:11 -04:00
Zach Daniel
231eeafd30 feat: expression calculations for sorting/filtering
improvement: small improvements/fixes across the board
2021-06-04 01:37:11 -04:00
Zach Daniel
d9debc07f1 fix: properly process managed belongs to relationships 2021-05-28 03:12:14 -04:00
Zach Daniel
4662c23f68 improvement: calculation.select/2 + select calculation option 2021-05-20 16:42:26 -04:00
Zach Daniel
dd40b24bf9 improvement: transactions for reads, notifications from read callbacks 2021-05-14 11:25:42 -04:00
Zach Daniel
69afdfce25 improvement: utility manage_relationship_source context 2021-05-10 18:03:36 -04:00
Frank Dugan III
a796e0d308
refactor: remove references to "side loading" (#236) 2021-05-09 17:24:48 -04:00
Zach Daniel
097447bf38 fix: run action changes on destroy
test: test manual actions
fix: pattern match manage_relationship notifications fix
2021-05-09 16:56:44 -04:00
Zach Daniel
f8604717bd fix: limit 1 on to one side load queries 2021-05-07 01:07:01 -04:00
Zach Daniel
46fb08f085 improvement: support sorted relationships 2021-05-07 00:28:51 -04:00
Zach Daniel
53ceb5b753 fix: compile time fixes
improvement: add `require_attributes` to create/update/destroy
2021-04-23 11:41:13 -04:00
Jason Axelson
f6fa5a98dd
improvement: Add detailed parameter checking for Api read functions (#229) 2021-04-18 19:45:38 -04:00
Jason Axelson
a4262965ea
chore: Enable Credo's Readability.StrictModuleLayout (#228)
Enforce layout of module parts
2021-04-18 19:41:49 -04:00
Zach Daniel
d6ee71ce53 feat: support Ash.Query.distinct/2
feat: add `build/2` query preparation
fix: manage_relationships *before* after_action callbacks
2021-03-31 17:13:20 -04:00
Zach Daniel
29b2c821fe fix: don't overwrite managed belongs_to relationships 2021-03-29 14:48:42 -04:00
Zach Daniel
11d658d077 fix: fix required relationships and add test 2021-03-28 13:44:21 -04:00
Zach Daniel
2f9fafcbc7 feat: add manage relationship types
improvement: don't accept relationships on actions anymore

improvement: require arguments

This probably broke a lot of people's setups, but it was a
necessary change. Better to get this stuff out while we're
still beta
2021-03-25 11:33:32 -04:00
Zach Daniel
a1c5f1d06f fix: validate required attributes *after* before_action hooks 2021-03-16 23:09:36 -04:00
Zach Daniel
f6026c6895 fix: allow_nil?: false + default interaction 2021-03-14 23:06:18 -04:00
Zach Daniel
db47a15cf7 fix: properly validate allow_nil?: false on update
fix: properly validate `allow_nil?: false` private attributes
2021-03-13 09:25:13 -05:00
Zach Daniel
72b5a57a25 feat: functional interface on the Api module
feat: resource aliases
improvement: require completely unique action names
2021-03-08 00:59:32 -05:00
Zach Daniel
e90fdad34a feat: support Ash.Query.select/3 and Ash.Changeset.select/3 2021-03-07 14:09:51 -05:00
zimt28
e10b273ce4
Ecto.UUID -> Ash.UUID (#188) 2021-02-23 12:27:49 -05:00
Zach Daniel
d42c778a0d improvement: many compile time fixes via code splitting
feat: refactored manage_relationship options/behavior
2021-02-22 20:44:03 -05:00
Zach Daniel
dd26beb79b chore: add more authorization tests
chore: improve authorization test helper

improvement: support `{:filter, _}` authorization results for changesets
2021-01-28 14:49:08 -05:00
Zach Daniel
f6f5d194bf feat: freeform expressions
feat: validatiosn in actions

feat: query arguments

feat: add `Ash.Query.for_read/3`

feat: return changeset with API errors

feat: add case insensitive string `CiString`/`:ci_string`

feat: support `context/1` and `arg/1` in filter templates

feat: support targeting notifications with the `for` option

feat: add `ago/2` query function

feat: add basic arithmetic operators (+, *, -, /)

feat: `sensitive?` option for attributes

feat: `sensitive?` option for arguments

feat: `private` arguments, which can’t be set using `for_<action>`

feat: add `prevent_change` which will erase changes just before the changeset is committed

feat: add `match?` validation that supports a custom error message

feat: add `interval` type to support `ago/2` function

feat: add `url_encoded_binary` type

feat: add `function` type

improvement: `changing?` is now a validation

improvement: add `Transformer.get_persisted/3`

improvement: add `api` field to `Notification`

improvement: standardize errors, add `to_error_class`

improvement: use `Comp` everywhere

Improvement: use action on changeset if set by `for_<action_type>`

improvement: `action_failed?` field on change sets

improvement: remove ability for data layers to add operators (for now at least)

Improvement: Changeset.apply_attributes/2 now returns an error tuple

Improvement: add a bunch of new/informative errors

improvement: runtime filter now uses left join logic (a naive implementation of it)

improvement: support more filter templates in resources

Improvement: basic/naive type system for operators/functions

Fix: properly expand module aliases for options w/o compile time dependency

chore(engine): track changeset changes for the request with `manage_changeset?: true`
2021-01-21 15:22:50 -05:00
zimt28
31cb4f4be3
improvement: Improve attribute defaults (#164) 2021-01-12 15:40:55 -05:00
Zach Daniel
6a26a583de
feat: Add Embedded Resources (#170) 2021-01-12 15:05:56 -05:00
zimt28
4404da93ce
fix: Correct error message (#163) 2021-01-09 11:36:01 -05:00
Zach Daniel
17046a02a1 chore: update tests 2021-01-07 22:35:10 -05:00
Zach Daniel
9e5250a920 chore: test binary type 2021-01-06 22:46:53 -05:00
Zach Daniel
d600c55509
feat: support :first aggregate (#153)
feat: support more sort orders
2020-12-28 19:18:01 -05:00
Zach Daniel
281fced422 fix: uuid/id pkeys should allow_nil 2020-12-26 18:30:51 -05:00
Kyle Nguyen
0f47d808e3
fix: do not require private attributes in create api (#143) 2020-11-08 11:49:03 -05:00
Zach Daniel
c493c1616b
feat: add uuid_primary_key/2 and integer_primary_key/2 2020-11-07 00:31:13 -05:00
Zach Daniel
2333d01ddf
feat: multitenancy! and tons of various fixes (#139) 2020-10-28 01:14:17 -04:00
Zach Daniel
1bf2058233
fix: various fixes and improvements 2020-10-20 18:50:11 -04:00
A.shalaby
9020d3b36d
feat: Optimize relashionship records replacement (#135)
Co-authored-by: Zach Daniel <zachary.s.daniel@gmail.com>
2020-10-19 19:10:05 -04:00
Zach Daniel
eb25d5b826
feat: add notifiers (#133) 2020-10-15 00:54:02 -04:00
Zach Daniel
f8fadc67e6
feat: Add pagination (#131) 2020-10-11 23:55:47 -04:00
Zach Daniel
d928ca5f6e
feat: expression based filter 2020-10-08 01:22:55 -04:00
Zach Daniel
243c9f05a2
feat: required belongs_to relationships (#107)
fix: various delegate data layer improvements

fix: engine halting issues

feat: support filter templates on read actions

feat: builtin concat calculation
2020-09-01 23:34:55 -04:00
Zach Daniel
9a3962d47a
feat: add changes to actions (#106) 2020-08-30 03:15:16 -04:00
Zach Daniel
a58367414d
feat: add accept option to create/update actions (#105) 2020-08-28 02:58:03 -04:00
Zach Daniel
9f9935dead
feat: add Ash.NotLoaded back, simpler defaults 2020-08-27 18:36:28 -04:00
Zach Daniel
036e0c2a88
feat: add one_of validation 2020-08-27 00:30:09 -04:00
Zach Daniel
3373d72899
feat: support inner lateral joins (#100)
Specifically, this allows us to behave correctly when loading
relationships w/ a limit or offset
2020-08-26 00:16:08 -04:00
Zach Daniel
385ec0b423
feat: add identities, to enhance get calls (#99) 2020-08-25 02:06:01 -04:00
Zach Daniel
be74d1e7eb
feat: add named aggregates 2020-08-08 16:17:52 -04:00
Zach Daniel
9d51ec6300
feat: allow editing join association attributes 2020-07-16 19:17:01 -04:00
Zach Daniel
b549337dc2
fix: use proper errors everywhere 2020-07-15 17:06:27 -04:00
Zach Daniel
28982f03fd
feat: various small refactors + validations 2020-07-15 01:38:42 -04:00
Zach Daniel
2cf41b966e
feat: refactor changes into changesets 2020-07-12 02:25:53 -04:00
Zach Daniel
253b1c2e7a
feat: lots of docs, simplify query generation 2020-07-09 02:55:09 -04:00
Zach Daniel
b5120a42b5
feat: list types 2020-06-30 23:57:24 -04:00
Zach Daniel
8438795f96
fix: require that resources have primary keys 2020-06-30 00:31:07 -04:00
Zach Daniel
b5c3f7acc4
fix: fix tests, add tests for gt/lt filters 2020-06-28 23:36:38 -04:00
Zach Daniel
c89acce635
fix: remove reverse relationships 2020-06-22 00:34:44 -04:00
Zach Daniel
e6e9f88710
fix: many filter/side load fixes/improvements 2020-06-21 23:26:47 -04:00
Zach Daniel
1033677259
feat: boolean filter refactor (#78)
feat: predicate behaviour
2020-06-18 22:59:30 -04:00
Zach Daniel
6dc699d8a6
feat: rebuild DSL inner workings for extensibility (#70) 2020-06-14 02:39:11 -04:00
Zach Daniel
5f2019027d
improvement: add date support (#68) 2020-06-12 22:39:20 -04:00
Zach Daniel
1cc143e7fa
test: adjust tests for removal of name/type (and defaults) 2020-06-04 23:34:44 -04:00
Zach Daniel
7c987b32bb
chore: wrap up remaining lint errors 2020-06-02 01:47:25 -04:00
Zach Daniel
b5c2fe6cf6
chore: remove ashton in favor of nimble_options 2020-06-01 01:14:23 -04:00
Zach Daniel
1cc096e621
improvement: huge query/filter overhaul 2020-05-13 11:54:44 -04:00
Zach Daniel
596a8e3d75
improvement: remove pagination, add query struct (unused) 2020-05-09 22:23:23 -04:00
Zach Daniel
7a28c7b9bd
feat: add timestamps/0 to attributes 2020-05-01 10:22:31 -04:00
Zach Daniel
2dea5d6d33
WIP on new error system. Only a few tests left to fix 2020-05-01 02:21:46 -04:00
Zach Daniel
24d1bd03c4
WIP 2020-04-19 23:15:52 -04:00
Zach Daniel
ed2b24d590
WIP 2020-01-14 14:00:38 -05:00
Zach Daniel
a831af570d
WIP 2020-01-13 13:16:24 -05:00
Zach Daniel
5f2c134060
WIP 2020-01-01 04:51:56 -05:00
Zach Daniel
add170ccc3
fixing tests/errors 2019-12-24 01:29:01 -05:00
Zach Daniel
41faa751c1
finish up relationship update tests 2019-12-23 15:51:01 -05:00
Zach Daniel
50941958e6
WIP, action tests 2019-12-23 13:17:22 -05:00
Zach Daniel
e0cc81c2e7
finally starting to stablize a bit. Still need to finish pg datalayer and
authorization. Realized that `get` `update` and `destroy` logic isn't
going to be as easy as filter based logic. Still not sure how to
handle it really.
2019-12-22 04:06:33 -05:00
Zach Daniel
a93c1b60cb
WIP, making filters work, for the most part 2019-12-22 03:17:29 -05:00
Zach Daniel
4e2e013f96
adding some tests, working on relationship stateful changes 2019-12-20 00:30:27 -05:00
Zach Daniel
fc259c9012
WIP 2019-12-19 23:19:34 -05:00