Repository navigation
Conversation
roderm
force-pushed
the
master
branch
2 times, most recently
from
September 7, 2026 07:47
084c9bd to
3e43337
Compare
Carried over from the pre-move repository, where it was never pushed. The third plugin turns out not to need a writer. Load<Msg> already takes `conds ...query.Cond`, so a filter is just another condition and the generated files stay as they are -- the work is metadata plus one translation function, not templates. What is missing is metadata, not code: SchemaColumn carries only the SQL name while filters name proto fields, SchemaTable has no message name for HasChildren to resolve, and there is no runtime registry to look a table up by entity. The registry also closes the existing gap where migration.Create makes callers hand-list every table. Because filtrify speaks message fields and entities and never learns table or column names, the translation has to happen on this side, where the metadata and the SQL assembly already are. That needs the AST types here, which the two-dependency rule currently forbids -- and importing filtrify/ast/v1 today also links grpc, since the generated gRPC service shares that package. Also weighs replacing the hand-rolled builder: measured, a library owns about a quarter of pkg/query and none of the subtle parts, but bob and goqu are the only ones with a real upsert API. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
roderm
force-pushed
the
docs/filtrify-conditions
branch
from
September 7, 2026 08:21
d0acfdd to
b45e296
Compare
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.
Design only — nothing implemented. Carried over from the pre-move repository, where it was never pushed.
The main finding
The third plugin does not need a writer.
Load<Msg>already takesconds ...query.Cond, so a filter is just another condition:The generated files stay exactly as they are. The work is metadata plus one translation function.
What is missing is metadata
Three small additions to what the schema writer already emits —
proto_nameonSchemaColumn(filters name proto fields, never columns),entityonSchemaTable, and a per-fileTablesregistry soHasChildrencan find a child table. The registry also closes the gap wheremigration.Createmakes callers hand-list every table.The blocking decision
filtrify speaks message fields and entities and never learns table or column names, so the translation has to happen on this side, where the metadata and the SQL assembly already live. That needs the AST types here, which the two-dependency rule forbids — and importing
filtrify/ast/v1today also links grpc, since the generated gRPC service shares that package.Recommended: relax the rule for the AST once those messages move to a package without the service. Alternative is a bridge module. Both are laid out in the doc, along with why walking the AST through
protoreflectto dodge the dependency was rejected.Also recorded
pkg/queryand none of the subtle parts (Mask,Key), which are the two that have actually had bugs.bob/dialect/psqlandgoquare the only candidates with a real upsert API — relevant since conflict handling is on the roadmap.a ~ bbecomesa = bbefore the AST exists. Any operator a SQL whitelist would reject is already lost upstream.Open questions
HasChildren.entity— entity name or relation field name? They differ as soon as a parent has two relations to the same entity, and an entity name cannot disambiguate.containssemantics:%/_escaping and case sensitivity both differ per dialect.IsNullExpris declared but not inExpr's oneof — wire it in or drop it.🤖 Generated with Claude Code