Repository navigation
feat: accept per-query repo options in data layer context - #290
Merged
Merged
Conversation
zachdaniel
reviewed
Dec 1, 2026
| opts -> | ||
| with true <- Keyword.keyword?(opts), | ||
| {:ok, opts} <- Keyword.validate(opts, @repo_option_keys), | ||
| true <- Enum.all?(opts, &valid_repo_option?/1) do |
Contributor
There was a problem hiding this comment.
If we want to validate them (does Ecto not already validate them?) then we should do so w/ Spark.Opts as we do in other places.
Contributor
Author
|
Ah, yes. Good to know. Adding an ash conventions check to my review cycles. |
Contributor
Author
|
From what I gather Ecto doesn't, at least not per query. It only checks |
Contributor
|
Looks like some merge conflicts. |
# Conflicts: # lib/aggregate/lateral/query.ex
Contributor
Author
|
Merged main in, should be clean now... |
Contributor
|
🚀 Thank you for your contribution! 🚀 |
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.
Part of #286
AshSql.repo_opts/6takes the query or changeset context and mergescontext.data_layer.repo_optsinto the options it returns. It accepts:log,:telemetry_eventand:telemetry_options, validated withSpark.Options; anything else raisesSpark.Options.ValidationError. Anilvalue counts as no options.repo_optscan't override:prefixor:timeout, which keep their existing sources.repo_opts/5behaves as before. The grouped and lateral aggregate queries now pass their query context, so aggregates run through AshSql honor the options. That includes AshSqlite's grouped aggregates; AshSqlite's own reads and writes callrepo_opts/5and are unchanged.The AshPostgres side, forwarding the options from reads, aggregates, creates, updates, destroys and the bulk actions, is on a branch and needs this released first. I'll open it once this is in.
Contributor checklist
Leave anything that you believe does not apply unchecked.