Commit graph

857 commits

Author SHA1 Message Date
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
Zach Daniel
c2cb843be9 improvement: ignore destination field on some relationship inputs 2021-03-05 10:39:06 -05:00
Zach Daniel
e60e5bf281 fix: treat empty string as nil in manage_relationship
fix: be more conservative (and more correct) when optimizing predicates
2021-02-24 11:13:35 -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
zimt28
db533450ed
improvement: Guess destination_field for has many relationships (#187) 2021-02-15 13:32:44 -05:00
Darren Black
983a711837
improvement: Implement string length validation (#183)
Co-authored-by: Darren Black <darren@ifixsystems.com.au>
2021-02-08 18:16:32 -05:00
Zach Daniel
03b6714e6f improvement: set_context change/preparation
fix: support `manage_relationship` for `belongs_to`
2021-02-05 18:56:56 -05:00
Zach Daniel
142b3bf7f9 feat: add default_context
feat: add `manage_relationship/4`

feat: add relationship specific context (for postgres polymorphism)

feat: add `reject` (opposite of `accept`)

improvement: set `accept` by default
2021-02-04 17:15:15 -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
8e74ff62a6 fix: remove invalid boolean expression optimization
improvement: make form errors work better with phoenix

this involves temporarily making embed error messages *worse*
but we can improve them as we get more usage
2021-01-24 13:47:10 -05:00
Zach Daniel
61e6b7c80c fix: various ci_string improvements
feat: add `contains/2` query function
2021-01-23 22:28:56 -05:00
Zach Daniel
bb91fd4bc7 fix: add action filters in for_read/3
fix: don't let local runner processes mix up messages

fix: runtime filter filters properly
2021-01-22 16:41:32 -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
6ddae6850f
improvement: Add trim/allow_empty to string type (#171) 2021-01-15 20:41:21 -05:00
zimt28
31cb4f4be3
improvement: Improve attribute defaults (#164) 2021-01-12 15:40:55 -05:00
Zach Daniel
f2650d6d48 chore: use uuid_primary_key in sort_test 2021-01-12 15:40:21 -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
dbf9f82802 improvement: add Ash.Sort.parse_input/2
fix: fix small sort bugs
2021-01-08 14:22:31 -05:00
Zach Daniel
17046a02a1 chore: update tests 2021-01-07 22:35:10 -05:00
Zach Daniel
424d020a7d improvement: add for_<action> helpers 2021-01-07 21:35:40 -05:00
Zach Daniel
9e5250a920 chore: test binary type 2021-01-06 22:46:53 -05:00
Zach Daniel
250f51f14e chore: formatting 2020-12-30 12:53:24 -05:00
Zach Daniel
c1767e79b2 improvement: default actions 2020-12-30 11:55:40 -05:00
Zach Daniel
dcbbd21f0c improvement: add parse_input/3 to Ash.Filter 2020-12-30 00:49:32 -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
abff2e4b39 docs: update generated documentation to be single file 2020-12-26 23:54:36 -05:00
Zach Daniel
281fced422 fix: uuid/id pkeys should allow_nil 2020-12-26 18:30:51 -05:00
Zach Daniel
2c585d28a4 fix: fix filtering for ets + mnesia data layers 2020-12-23 14:16:23 -05:00
Zach Daniel
2b500071f3 improvement: support confirming arguments, test allow_nil? 2020-12-01 22:50:43 -05:00
Zach Daniel
0abf03065a feat: support arguments for actions 2020-12-01 22:09:37 -05:00
Zach Daniel
c6ea07896b test: various testing improvements 2020-12-01 00:51:24 -05:00
Zach Daniel
0e3333c05f chore: update tests 2020-11-30 23:23:34 -05:00
Zach Daniel
7c977d10c5 chore: update calculation tests 2020-11-30 23:18:39 -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
Kyle Nguyen
c732099240
feat: Add property: private? for attributes, relationships, aggregates, and calculations (#140) 2020-11-02 15:33:14 -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
b0bfec7e0f
feat: pubsub notifier (#134) 2020-10-17 13:06:27 -04:00
Zach Daniel
eb25d5b826
feat: add notifiers (#133) 2020-10-15 00:54:02 -04:00
Digit
78861b6a51
feat: Add :one_of constraint to the Atom type (#130) 2020-10-13 10:29:57 -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
0c216c284d
Module updates (#129) 2020-10-07 01:17:17 -04:00
Zach Daniel
114e64f8b4
feat: filter rewrite to op/function/ref based structure 2020-10-06 00:58:06 -04:00
WolfDan
1d6066f247
fix: add module name to errors (#127) 2020-10-05 10:40:22 -04:00
A.shalaby
a2f5db08f4
fix: Fix composite key in changeset functions (#125)
Co-authored-by: Zach Daniel <zachary.s.daniel@gmail.com>
2020-10-03 02:37:17 -04:00
A.shalaby
0f805803e1
test: add changeset_test (#123)
Co-authored-by: Zach Daniel <zachary.s.daniel@gmail.com>
2020-10-02 14:48:49 -04:00
mario
6d719516c2
feat: added description for missing resources (#117) 2020-09-25 08:20:58 -04:00
Zach Daniel
12891c3f38
test: add basic tests for resource entities 2020-09-23 21:26:16 -04:00
Zach Daniel
f41cc77549
Various Improvements (#113) 2020-09-19 15:46:34 -04:00
Zach Daniel
5552ce1f83
fix: remove delegate data layer (#112)
The delegation data layer was the wrong tactic. We should model
shared behavior as composition, not inheritance (which is essentially
what the delegation data layer turned into)
2020-09-06 01:16:21 -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
2ef877ee53
feat: initial calculation support (#98)
* feat: initial calculation support
2020-08-25 00:49:07 -04:00
Zach Daniel
a56fdbb3ff
feat: Add delegate datalayer (#97) 2020-08-22 18:44:05 -04:00
Mike Binns
90af0b0357
Add is_nil support to Ets/Mnesia (#94) 2020-08-20 21:27:32 -04:00
Zach Daniel
7b1c735ff3
feat: various custom datalayer features 2020-08-19 00:50:35 -04:00
Zach Daniel
a84ded1c72
test: add data_layer to resource tests 2020-08-19 00:49:41 -04:00
Mike Binns
d4465a2724
test(Ash.DataLayer.Ets): add unit tests (#93)
Closes #51
2020-08-18 15:46:53 -04:00
Zach Daniel
be74d1e7eb
feat: add named aggregates 2020-08-08 16:17:52 -04:00
Zach Daniel
28c236452d
feat: aggregations! 2020-07-23 01:09:59 -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
41b8c94964
feat: validate relationship keys 2020-07-09 00:20:32 -04:00
Zach Daniel
b5120a42b5
feat: list types 2020-06-30 23:57:24 -04:00
Zach Daniel
05848d5f4a
feat: refactor ash types to modules, add constraints 2020-06-30 17:29:43 -04:00
Zach Daniel
24d66b3f39
fix: test/improve parallelizable requests 2020-06-30 01:19:20 -04:00
Zach Daniel
8438795f96
fix: require that resources have primary keys 2020-06-30 00:31:07 -04:00
Zach Daniel
807b16e268
fix: move to simpler transaction logic 2020-06-29 17:42:01 -04:00
Zach Daniel
05f2d9ad64
WIP 2020-06-29 17:20:29 -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
1ed9d3c5fa
WIP 2020-05-27 00:29:54 -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
vherr2
03a80e0001 test(type test): skips failing type test
Skips failing test to clarify supported state of trunk
2020-05-09 15:47:18 -07: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
51fcf1a498
WIP 2020-04-28 00:12:57 -04:00
Zach Daniel
61c0ffee50
WIP 2020-04-25 23:56:21 -04:00
Zach Daniel
2e0aa229be
WIP 2020-04-24 10:27:47 -04:00
Zach Daniel
ec404bc89f
WIP 2020-04-20 00:43:33 -04:00
Zach Daniel
24d1bd03c4
WIP 2020-04-19 23:15:52 -04:00
Zach Daniel
bee1150385
WIP 2020-04-12 18:52:52 -04:00
Zach Daniel
3a6543a9b3
WIP 2020-04-05 06:25:17 -04:00
Zach Daniel
ed2b24d590
WIP 2020-01-14 14:00:38 -05:00
Zach Daniel
c6521a668c
WIP 2020-01-13 13:39:55 -05:00
Zach Daniel
a831af570d
WIP 2020-01-13 13:16:24 -05:00
Zach Daniel
ebd8291631
WIP 2020-01-11 00:09:52 -05:00
Zach Daniel
9bb19f95ad
WIP 2020-01-10 12:27:16 -05:00
Zach Daniel
a6ca37f537
WIP 2020-01-06 23:01:15 -05:00
Zach Daniel
5f2c134060
WIP 2020-01-01 04:51:56 -05:00
Zach Daniel
442d6f720e
WIP 2020-01-01 04:39:10 -05:00
Zach Daniel
e31718510b
WIP 2019-12-30 22:48:17 -05:00
Zach Daniel
e5ccacfc76
WIP 2019-12-29 17:28:51 -05:00
Zach Daniel
b1a997ea55
WIP 2019-12-29 17:28:28 -05:00
Zach Daniel
cf40fe0222
WIP 2019-12-29 01:56:47 -05:00
Zach Daniel
56a1b3e658
WIP 2019-12-29 01:31:50 -05:00
Zach Daniel
08ef1a0eb1
WIP 2019-12-28 13:52:47 -05:00
Zach Daniel
4aee8095d4
WIP 2019-12-27 16:10:55 -05:00
Zach Daniel
4d3688532f
WIP 2019-12-26 16:33:35 -05:00
Zach Daniel
694b7b362e
WIP 2019-12-26 03:42:35 -05:00
Zach Daniel
80545c416c
WIP 2019-12-24 02:53:56 -05:00
Zach Daniel
add170ccc3
fixing tests/errors 2019-12-24 01:29:01 -05:00
Zach Daniel
6702c8eb3a
finishing up action tests 2019-12-23 23:22:31 -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
Zach Daniel
2f85a1385f
wildin out man 2019-12-15 18:20:44 -06:00
Zach Daniel
201e068235
whirlwind 2019-12-12 01:19:22 -05:00
Zach Daniel
d29afca057
WIP 2019-12-10 00:08:59 -05:00
Zach Daniel
6ba4afa1d6
WIP 2019-12-09 02:07:23 -05:00
Zach Daniel
b776d06c2d
WIP 2019-12-09 01:44:07 -05:00
Zach Daniel
b861568321
WIP 2019-12-08 23:05:56 -05:00
Zach Daniel
ee05955af8
WIP 2019-12-08 14:02:09 -05:00
Zach Daniel
a2e007697a
working on defaults, updating error messages 2019-12-08 01:21:09 -05:00
Zach Daniel
0cd0748ead
WIP 2019-12-07 16:33:31 -05:00
Zach Daniel
83d1761dd8
test the api dsl 2019-12-07 03:38:35 -05:00
Zach Daniel
4e527865e7
WIP 2019-12-07 02:42:14 -05:00
Zach Daniel
fa1ca7736b
WIP 2019-12-06 15:54:30 -05:00
Zach Daniel
e90023f75d
remove deafults in actions 2019-12-06 02:06:34 -05:00
Zach Daniel
05e84102dd
test and docs 2019-12-06 02:00:26 -05:00
Zach Daniel
248a5d667d
WIP 2019-12-05 13:45:02 -05:00
Zach Daniel
1c5a7e228c
add ash types and test one of them 2019-12-05 11:50:30 -05:00
Zach Daniel
030c389225
WIP on cleanup/documentation 2019-12-05 02:18:13 -05:00
Zach Daniel
df70095e39
WIP 2019-12-04 18:04:07 -05:00
Zach Daniel
b2feeac52d
WIP 2019-12-03 01:47:49 -05:00
Zach Daniel
af40b830fc
WIP 2019-12-01 23:04:16 -05:00
Zach Daniel
d9ed8e7bbc
WIP 2019-11-29 14:40:19 -05:00
Zach Daniel
242db09396
WIP 2019-11-29 11:36:01 -05:00
Zach Daniel
ad313c5ff3
WIP 2019-11-29 01:54:11 -05:00
Zach Daniel
4cabb8a838
add an ets data layer, and start on some testing 2019-11-28 00:24:29 -05:00
Zach Daniel
4c41344126
init 2019-10-02 23:08:36 -04:00