chore: merge main to temporal - #256
Merged
Merged
Conversation
…project#235) Bumps the dev-dependencies group with 3 updates: [benchee](https://github.com/bencheeorg/benchee), [credo](https://github.com/rrrene/credo) and [igniter](https://github.com/ash-project/igniter). Updates `benchee` from 1.5.0 to 1.5.1 - [Release notes](https://github.com/bencheeorg/benchee/releases) - [Changelog](https://github.com/bencheeorg/benchee/blob/main/CHANGELOG.md) - [Commits](bencheeorg/benchee@1.5.0...1.5.1) Updates `credo` from 1.7.18 to 1.7.19 - [Release notes](https://github.com/rrrene/credo/releases) - [Changelog](https://github.com/rrrene/credo/blob/master/CHANGELOG.md) - [Commits](rrrene/credo@v1.7.18...v1.7.19) Updates `igniter` from 0.8.1 to 0.8.2 - [Release notes](https://github.com/ash-project/igniter/releases) - [Changelog](https://github.com/ash-project/igniter/blob/main/CHANGELOG.md) - [Commits](ash-project/igniter@v0.8.1...v0.8.2) --- updated-dependencies: - dependency-name: benchee dependency-version: 1.5.1 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: credo dependency-version: 1.7.19 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: dev-dependencies - dependency-name: igniter dependency-version: 0.8.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: dev-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the production-dependencies group with 1 update in the / directory: [ash](https://github.com/ash-project/ash). Updates `ash` from 3.27.7 to 3.29.3 - [Release notes](https://github.com/ash-project/ash/releases) - [Changelog](https://github.com/ash-project/ash/blob/main/CHANGELOG.md) - [Commits](ash-project/ash@v3.27.7...v3.29.3) --- updated-dependencies: - dependency-name: ash dependency-version: 3.29.3 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: production-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the production-dependencies group with 2 updates: [ash](https://github.com/ash-project/ash) and [ecto](https://github.com/elixir-ecto/ecto). Updates `ash` from 3.29.3 to 3.31.0 - [Release notes](https://github.com/ash-project/ash/releases) - [Changelog](https://github.com/ash-project/ash/blob/main/CHANGELOG.md) - [Commits](ash-project/ash@v3.29.3...v3.31.0) Updates `ecto` from 3.14.0 to 3.14.1 - [Release notes](https://github.com/elixir-ecto/ecto/releases) - [Changelog](https://github.com/elixir-ecto/ecto/blob/master/CHANGELOG.md) - [Commits](elixir-ecto/ecto@v3.14.0...v3.14.1) --- updated-dependencies: - dependency-name: ash dependency-version: 3.31.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: production-dependencies - dependency-name: ecto dependency-version: 3.14.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: production-dependencies ... Signed-off-by: dependabot[bot] <support@github.com>
…oduction-dependencies-7221da2164
`Ash.Query.combination_of/2` takes an ordered list of parts, and each part applies to the result of everything before it. There is no precedence between the combination types — the order in the list is the order of application. `combination_of/4` appended each operation onto the accumulated query, which renders as one flat chain of set operations. SQL then applies its own precedence to that chain, and `INTERSECT` binds tighter than `UNION` and `EXCEPT`, so a combination spanning more than one precedence level was regrouped: given `base`, `union`, `intersect`, the intersect was applied to the union's right operand rather than to the running result. The effect was a query whose meaning depended on its data layer. `Ash.DataLayer.Ets` applies the parts in the order given, so the two answered differently — for one three-part combination, `["alpha", "beta", "gamma"]` here against `["alpha", "gamma"]` there. Nest what has accumulated before applying the next part, so each operation takes everything preceding it as its left operand. A part already wrapped as a subquery is left alone, so this adds one level of nesting per part rather than one per part plus a trailing one. Verified against ash_postgres built with `ASH_SQL_VERSION=local`: its combination suite (18 tests) and full suite (828) stay green, and a three-part case returns the order given only with this change.
…-order-not-sql-precedence fix: apply each combination part to the whole of what precedes it
… and date_add
`Ash.Query.Function.Ago`, `FromNow`, `DateTimeAdd` and `DateAdd` each accept a
`Duration` as well as an integer/interval-name pair, and evaluate it in Elixir, but
only the interval form was rendered here. The Duration form reached
`default_dynamic_expr/6`, matched nothing, and raised `Unsupported expression`, so it
worked on data layers that evaluate expressions at runtime and failed on every
SQL-backed one.
Adds a clause per function, rendering the duration as an interval parameter. Ecto has
a native `:duration` type and Postgres accepts a `%Duration{}` directly, so no
interval-name string building is needed, and multi-unit durations work.
The datetime operand is cast, as Ecto's own `datetime_add/3` does with
`type_unless_typed`; without it Postgres resolves `? - ?::interval` as interval
arithmetic. `date_add` casts back to `::date` for the same reason Ecto's does.
`from_now/1` is uncallable until the corresponding ash change releases, so its clause
is untestable downstream until then.
encode_list/6 renders every list literal as Postgres ARRAY[...] (or array_to_json(ARRAY[...])) unconditionally, and default_dynamic_expr/6 routes bare lists to it without consulting sql_behaviour, so a data layer whose database has no array constructor cannot intercept: on SQLite the statement fails to parse ((Exqlite.Error) near "[?]": syntax error). Add a list_expr/6 callback with the same shape and return contract as expr/6, defined as :error and overridable in __using__ exactly like expr/6. encode_list/6 consults it and falls back to the existing ARRAY[...] body, moved verbatim into a private default_encode_list/7, so an implementation that does not override it renders byte-identical SQL. The callback sits after the embedded-resource dump, at the exact point ARRAY[...] would otherwise be emitted, so implementations receive a plain list and nothing that renders correctly today is diverted. Closes ash-project#246.
…sh-3-32 chore: require ash 3.32 for the range expressions
# Conflicts: # lib/expr.ex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contributor checklist
Brings
temporalup tomainat v0.7.0, enabling update to ash_postgrestemporal.Please merge rather than squash like ash-project/ash#2894
RangeOverlapswas on both and was preferred from main.temporalnow adds surprisingly little (+30/-7) tomain:as_ofthreaded intoAsh.Actions.Read.add_calc_context_to_filter/8at five sites, inatomics.ex,calculation.ex,query.exand twice inexpr.exas_of_or_now/1, anchoringnow(),ago()andfrom_now()to the query's instant ratherthan the wall clock
@zachdaniel format, credo, test all green. Warnings as errors on main carries 5 warnings as before.