Skip to content

chore: merge main to temporal - #256

Merged
zachdaniel merged 39 commits into
ash-project:temporalfrom
matt-beanland:temporal-merge
Aug 24, 2026
Merged

chore: merge main to temporal#256
zachdaniel merged 39 commits into
ash-project:temporalfrom
matt-beanland:temporal-merge

Conversation

@matt-beanland

Copy link
Copy Markdown
Contributor

Contributor checklist

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

Brings temporal up to main at v0.7.0, enabling update to ash_postgres temporal.
Please merge rather than squash like ash-project/ash#2894

RangeOverlaps was on both and was preferred from main.

temporal now adds surprisingly little (+30/-7) to main:

  • as_of threaded into Ash.Actions.Read.add_calc_context_to_filter/8 at five sites, in
    atomics.ex, calculation.ex, query.ex and twice in expr.ex
  • as_of_or_now/1, anchoring now(), ago() and from_now() to the query's instant rather
    than the wall clock

@zachdaniel format, credo, test all green. Warnings as errors on main carries 5 warnings as before.

dependabot Bot and others added 30 commits July 1, 2026 10:28
…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>
`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
@zachdaniel
zachdaniel merged commit f75e2e0 into ash-project:temporal Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants