You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
docs(eql): say the JSON GIN index does not serve col <@ needle, and name the v4 ORE operator class - #1969
Two sentences in the EQL v4 reference docs were wrong, and a user who followed either got an unexpected result with no error. EQL (Encrypt Query Language) is the SQL library CipherStash installs into PostgreSQL; version 4 installs the eql_v4 schema the Go SDK uses. The errors were found in #1931, while writing the Go SDK's index guide.
The JSON tree page said a GIN index on eql_v4.json_tree_query(col) with jsonb_path_ops serves both containment operators. It serves col @> $1. It also serves $1 <@ col, the same test written the other way round. It does not serve col <@ $1: that query reads every row.
The between notes named the ORE btree operator class eql_v4_internal.ore_block_256. The v4 bundle installs it as eql_v4_internal.ore_block_v2_operator_class.
Changes
packages/eql/docs/reference/json-tree.md: say which containment forms the GIN index serves, and that col <@ $1 reads every row, with the reason.
packages/eql/docs/reference/eql-functions.md: name the v4 operator class correctly. The rest of that bullet is split into shorter sentences; its meaning is unchanged.
Verification
Source. The operator class is created at packages/eql/src/v3/sem/ore_block_256/operator_class.sql:31 as {{prefix}}_internal.{{ore_block}}_operator_class. The renderer sets {{ore_block}} to ore_block_v2 for v4 (packages/eql/crates/eql-codegen/src/render.rs:159). col <@ needle is defined at packages/eql/src/v3/json_tree/operators.sql:110 and calls json_tree_contained_by, whose body is (b::jsonb - 'alt') @> json_tree_query(a) (packages/eql/src/v3/json_tree/functions.sql:438-443): the projection is on the right of @>. needle <@ col (operators.sql:128) calls json_tree_contains(b, a), the same body as col @> needle.
PostgreSQL 17, v4 bundle built from this branch, no credentials.pg_opclass lists eql_v4_internal.ore_block_v2_operator_class and no ore_block_256 class. With enable_seqscan = off and EXPLAIN (GENERIC_PLAN): profile @> $1 and $1 <@ profile use a bitmap index scan on the jsonb_path_ops index; profile <@ $1 is a sequential scan, with the filter (($1)::jsonb - 'alt') @> eql_v4.json_tree_query(profile). A jsonb_ops GIN index on the same expression is not used for profile <@ $1 either.
Other pages. No other eql_v4 page names ore_block_256 for v4, or says the GIN index serves <@. The eql_v3 pages that name ore_block_256 are correct for v3. They are unchanged.
Doc checks, from packages/eql: tasks/test/doc-anchors.sh passed (142 links resolve). tasks/test/docs_v3_grep.sh passed (17 files). I ran both scripts directly because mise run failed to install sqlx-cli on this machine.
No changeset. Earlier docs-only EQL changes carried none. Two examples are 86edfb6c3 and 19b8ea1e1.
…ame the v4 ORE operator class
The v4 JSON tree page said a GIN index with jsonb_path_ops on
eql_v4.json_tree_query(col) serves both containment operators. In
PostgreSQL 17 with the v4 bundle, `col @> $1` and `$1 <@ col` use the
index, because both inline to jsonb @> with the projection on the left.
`col <@ $1` inlines to `$1 @> json_tree_query(col)`, with the projection
on the right, and no jsonb GIN operator class serves that, so the query
reads every row. The page now says so.
The between notes named the ORE btree operator class
eql_v4_internal.ore_block_256. The v4 bundle renders the class as
eql_v4_internal.ore_block_v2_operator_class, so a user who checks
pg_opclass for the old name does not find it.
Refs #1968
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CtEQzxj55RUn35dkbhdwQk
Auto reviews are disabled on base/target branches other than the default branch.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The EQL reference documentation names the v4 ORE operator class and clarifies which JSON containment operators use the documented GIN index. It also states that the unsupported query form reads every row.
Changes: EQL reference documentation
Layer / File(s)
Summary
Document the ORE operator class packages/eql/docs/reference/eql-functions.md
The ORE range-query documentation replaces ore_block_256 with ore_block_v2_operator_class. Existing notes on install requirements, disabled domains, cast errors, and the OPE fallback remain.
Clarify JSON index coverage packages/eql/docs/reference/json-tree.md
The documentation states that the GIN index serves profile @> $1 and $1 <@ profile, but not profile <@ $1. It explains that the latter reads every row.
This change corrects two statements in the EQL reference docs and does not alter runtime behavior. No merge-blocking risk remains.
Pre-merge checks: 3 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Out of Scope Changes check
The core edits are in scope. The operator class rename in eql-functions.md and the json-tree.md containment correction both implement #1968. Two points remain unverified. First, the text diff could no…
Provide the text diff of packages/eql/docs/reference/eql-functions.md and json-tree.md between the merge base f7166c3 and head 737d682, or readable base blobs for these files. With that diff, confirm whether the superuser and feature_not_…
Passed checks: 3 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the two concrete changes in the docs: the JSON GIN index does not serve col <@ $1, and the v4 ORE operator class is renamed. The raw summary confirms both changes in json-tree.md and…
Linked Issues check
Issue #1968 asks for two corrections in the EQL v4 reference docs. (1) json-tree.md: the GIN index with jsonb_path_ops serves containment forms only as the PR describes (col @> $1 and $1 <@ col), and …
Full details: Title check
Explanation
The title names the two concrete changes in the docs: the JSON GIN index does not serve col <@ $1, and the v4 ORE operator class is renamed. The raw summary confirms both changes in json-tree.md and eql-functions.md. The title is specific and matches the main content, though it is long (98 characters).
Full details: Linked Issues check
Explanation
Issue #1968 asks for two corrections in the EQL v4 reference docs. (1) json-tree.md: the GIN index with jsonb_path_ops serves containment forms only as the PR describes (col @> $1 and $1 <@ col), and col <@ $1 reads every row. The PR reports PostgreSQL 17 EXPLAIN results from a v4 bundle built from this branch that match this. The raw summary of json-tree.md at head describes the same change. (2) eql-functions.md: the ORE btree operator class is named eql_v4_internal.ore_block_v2_operator_class. The head file confirms this name in the 'Range queries in EQL v4' section. The PR also reports checking other eql_v4 pages for ore_block_256 and finding none. Limits: the json-tree.md head text was not read directly, and the cited source line numbers were not checked. The issue's requirements are documentation corrections, so no runtime code requirement applies.
Full details: Out of Scope Changes check
Explanation
The core edits are in scope. The operator class rename in eql-functions.md and the json-tree.md containment correction both implement #1968. Two points remain unverified. First, the text diff could not be read: the repository inspection reported that changed blobs are missing from the checkout, and reading the base revision of eql-functions.md failed. Second, the eql-functions.md head text includes a sentence on superuser installs, which skip the ore_block_v2_operator_class and disable ORE domains, plus feature_not_supported and the OPE alternatives. The PR says the bullet was only split and its meaning is unchanged. The raw summary calls this a clarification, so the sentence may be new text. Its topic is close to the ORE class named in #1968, so it may be related scope, but this cannot be confirmed without the base text.
Resolution
Provide the text diff of packages/eql/docs/reference/eql-functions.md and json-tree.md between the merge base f7166c3 and head 737d682, or readable base blobs for these files. With that diff, confirm whether the superuser and feature_not_supported sentences are new. If they are new, state why they belong to #1968, or move them to a separate change.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
The reason will be displayed to describe this comment to others. Learn more.
Review attestation
Reviewed 737d682e · posted from Claude Code · claude-opus-5-5 · effort medium
Sources: code-review · claude-opus-5-5; mattpocock-skills:code-review · claude-opus-5-5
Skills: code-review, mattpocock-skills:code-review, company-skills:rust-security (no Rust in the diff, nothing to apply), company-skills:review-cross-check
Findings (3): 3 minor — 3 inline.
Both corrections hold against source: the v4 class renders as eql_v4_internal.ore_block_v2_operator_class (src/v3/sem/ore_block_256/operator_class.sql:31, crates/eql-codegen/src/render.rs), and col <@ q puts the projection on the right of @> (src/v3/json_tree/functions.sql, json_tree_contained_by). No changeset is needed: docs/ is not in the @cipherstash/eql tarball (files: ["dist", "README.md"]).
… note
Write every containment operand in the new json-tree prose with its
eql_v4.query_json cast, as the page's own rule requires, and show the
index-served $1 <@ col form in the example block. An untyped $1 would
resolve to another <@ overload and miss the index.
Say that Supabase-like platforms, whose install role cannot create an
operator class, skip the ORE class. RDS and Aurora can create it.
Refs #1968
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CtEQzxj55RUn35dkbhdwQk
This branch has not been deployed
No deployments
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
bugSomething isn't workingdocumentationImprovements or additions to documentationEQL
2 participants
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.
Summary
Two sentences in the EQL v4 reference docs were wrong, and a user who followed either got an unexpected result with no error. EQL (Encrypt Query Language) is the SQL library CipherStash installs into PostgreSQL; version 4 installs the
eql_v4schema the Go SDK uses. The errors were found in #1931, while writing the Go SDK's index guide.eql_v4.json_tree_query(col)withjsonb_path_opsserves both containment operators. It servescol @> $1. It also serves$1 <@ col, the same test written the other way round. It does not servecol <@ $1: that query reads every row.betweennotes named the ORE btree operator classeql_v4_internal.ore_block_256. The v4 bundle installs it aseql_v4_internal.ore_block_v2_operator_class.Changes
packages/eql/docs/reference/json-tree.md: say which containment forms the GIN index serves, and thatcol <@ $1reads every row, with the reason.packages/eql/docs/reference/eql-functions.md: name the v4 operator class correctly. The rest of that bullet is split into shorter sentences; its meaning is unchanged.Verification
packages/eql/src/v3/sem/ore_block_256/operator_class.sql:31as{{prefix}}_internal.{{ore_block}}_operator_class. The renderer sets{{ore_block}}toore_block_v2for v4 (packages/eql/crates/eql-codegen/src/render.rs:159).col <@ needleis defined atpackages/eql/src/v3/json_tree/operators.sql:110and callsjson_tree_contained_by, whose body is(b::jsonb - 'alt') @> json_tree_query(a)(packages/eql/src/v3/json_tree/functions.sql:438-443): the projection is on the right of@>.needle <@ col(operators.sql:128) callsjson_tree_contains(b, a), the same body ascol @> needle.pg_opclasslistseql_v4_internal.ore_block_v2_operator_classand noore_block_256class. Withenable_seqscan = offandEXPLAIN (GENERIC_PLAN):profile @> $1and$1 <@ profileuse a bitmap index scan on thejsonb_path_opsindex;profile <@ $1is a sequential scan, with the filter(($1)::jsonb - 'alt') @> eql_v4.json_tree_query(profile). Ajsonb_opsGIN index on the same expression is not used forprofile <@ $1either.eql_v4page namesore_block_256for v4, or says the GIN index serves<@. Theeql_v3pages that nameore_block_256are correct for v3. They are unchanged.packages/eql:tasks/test/doc-anchors.shpassed (142 links resolve).tasks/test/docs_v3_grep.shpassed (17 files). I ran both scripts directly becausemise runfailed to installsqlx-clion this machine.86edfb6c3and19b8ea1e1.Related
Closes #1968
#1968
Part of #1906.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CtEQzxj55RUn35dkbhdwQk
Summary by CodeRabbit