diff --git a/.cargo/mutants.toml b/.cargo/mutants.toml index 1fae9ba39..8ef34de7d 100644 --- a/.cargo/mutants.toml +++ b/.cargo/mutants.toml @@ -72,6 +72,11 @@ exclude_re = [ 'stack-encrypt/src/cipher\.rs:\d+:\d+: replace client_key_provider -> EnvKeyProvider with Default::default\(\)$', 'stack-encrypt/src/target/pending\.rs:443:9: replace >::into_future -> Self::IntoFuture with Default::default\(\)$', # stack-encrypt — equivalent. + # An operator and an index are unit structs, whose `Default` is the value + # `clone` and `case_sensitive` already return. + 'stack-encrypt/src/op(/mod)?\.rs:\d+:\d+: replace >::clone -> Self with Default::default\(\)$', + 'stack-encrypt/src/op(/mod)?\.rs:\d+:\d+: replace Matches::case_sensitive -> Matches with Default::default\(\)$', + 'stack-encrypt/src/target/index\.rs:\d+:\d+: replace >::clone -> Self with Default::default\(\)$', 'stack-encrypt/src/cipher\.rs:\d+:\d+: replace StackCipher::builder -> StackCipherBuilder with Default::default\(\)$', 'stack-encrypt/src/sem/mod\.rs:\d+:\d+: replace ::options -> MatchOptions with Default::default\(\)$', # Both unit-context conversions explicitly return Self::default(). @@ -80,6 +85,28 @@ exclude_re = [ # the empty list (`dynamic::target::NoTargets`), which a test asserts on # and `resolve` turns into `TargetError::NoTargets`; `vec![]` is the body. 'stack-encrypt/src/dynamic/target\.rs:\d+:\d+: replace ::targets -> Vec with vec!\[\]$', + # A passthrough has no kind: `KindOf::passthrough` returns `Ok(None)`, + # which is `Ok(Default::default())`. `a_frame_names_its_kind` asserts it. + 'stack-encrypt/src/dynamic/value_frame\.rs:\d+:\d+: replace ::passthrough -> Result with Ok\(Default::default\(\)\)$', + # `model`'s `admits` guard on a date, decimal or undefined value is checked + # again by vitaminc on every path that reaches it: the frame writer behind + # `Modeled` and `ModelOnly` refuses an inadmissible logical value + # (`FrameWriteError::Invalid`, mapped to the same `Expected`), and + # `ValueFrame::check` only walks frames `Frame::parse` has validated. So + # `true` there refuses the same values with the same error. The guard stays + # so the model says what it holds without leaning on the writer behind it. + 'stack-encrypt/src/dynamic/value_frame\.rs:\d+:\d+: replace match guard logical\.admits\(&value\) with true in model$', + # A serde visitor's `expecting` writes only the "expected ..." half of a + # serde error's message, and no caller of these three reads that message: + # a context, statistics and a plan's root are each refused with one fixed + # `Reason` (`ContextKind`, `NotStats`, `NotAnObject`), and the plan's + # field-level reasons are read from the error's path, so writing nothing + # refuses the same input with the same error. + 'stack-encrypt/src/dynamic/(context|query|record)\.rs:\d+:\d+: replace for ContextVisitor|serde::Deserialize<\x27de> for Confidence>::deserialize:: for V|Deserialize<\x27de> for PlanWire>::deserialize:: for V)>::expecting -> fmt::Result with Ok\(Default::default\(\)\)$', + # The same for the visitor that reads a refused plan's keys back + # (`entry_key`): its error is discarded (`.ok()`), so its message is never + # read at all. + 'stack-encrypt/src/dynamic/record\.rs:\d+:\d+: replace entry_key:: for Keys>::deserialize:: for V>::expecting -> fmt::Result with Ok\(Default::default\(\)\)$', ] # Headroom over the measured baseline before a slow-but-correct mutant is diff --git a/.changeset/chacha20-0-10-2.md b/.changeset/chacha20-0-10-2.md new file mode 100644 index 000000000..266d137e4 --- /dev/null +++ b/.changeset/chacha20-0-10-2.md @@ -0,0 +1,6 @@ +--- +'@cipherstash/protect-ffi': patch +'@cipherstash/auth': patch +--- + +Build the native binaries against `chacha20` 0.10.2. Versions 0.10.0 and 0.10.1 were yanked: on an x86 CPU without AVX2, their SSE2 fallback for the random number generator used an SSE4.1 instruction it had not checked the CPU for. A CPU without SSE4.1 (one from before 2008, or a virtual machine using QEMU's default `qemu64` CPU model) would crash with an illegal-instruction error. Every other CPU produced correct random numbers, so randomness was never weakened. No API change. diff --git a/.changeset/eql-lints-own-domains.md b/.changeset/eql-lints-own-domains.md new file mode 100644 index 000000000..e8ed05994 --- /dev/null +++ b/.changeset/eql-lints-own-domains.md @@ -0,0 +1,5 @@ +--- +'@cipherstash/eql': patch +--- + +`eql_v3.lints()` now judges only EQL's own `public.eql_v3_*` domains. It used to take every `jsonb` domain in `public`, so a database with another set of encrypted domains installed beside EQL v3 got thousands of false `inlinability_*` errors from the self-check. diff --git a/.changeset/eql-plan-field-targets.md b/.changeset/eql-plan-field-targets.md index e1fd16c14..18b37b590 100644 --- a/.changeset/eql-plan-field-targets.md +++ b/.changeset/eql-plan-field-targets.md @@ -2,4 +2,4 @@ '@cipherstash/eql': minor --- -**The `eql-bindings` crate resolves an EQL type named as a string to its own Stack Encrypt plan** (`stack-encrypt` feature). `eql_bindings::encryption::targets` carries a catalog-generated table of every EQL type a data plan may name as a field target — its name across languages, family and suffix, the plaintext `ValueKind` it takes, the indexes it carries, its query twin, and whether the engine can produce it today with the reason when not — and `encrypt` / `decrypt` / `query` entry points that dispatch on the name and run the type's derived `EncryptFrom` / `DecryptInto`, resolving to the EQL value's JSON bytes through the engine's `Pending` so a guest batches it with the rest of a plan. This is the EQL half of EQL types as plan field targets (cipherstash/stack#1062): a Go data plan names `TextEq` and the guest returns the finished EQL value instead of assembling one. `TextEq` is the only producible type; every other name is refused with the plan's reason. The SQL surface and the TypeScript package are unchanged. +**The `eql-bindings` crate resolves an EQL type named as a string to its own Stack Encrypt plan** (`targets` feature, which turns on `stack-encrypt`). `eql_bindings::encryption::targets` carries a catalog-generated table of every EQL type a data plan may name as a field target — its name across languages, family and suffix, the plaintext `ValueKind` it takes, the indexes it carries, its query twin, and whether the engine can produce it today with the reason when not — and `encrypt` / `decrypt` / `query` entry points that dispatch on the name and run the type's derived `EncryptFrom` / `DecryptInto`, resolving to the EQL value's JSON bytes through the engine's `Pending` so a guest batches it with the rest of a plan. This is the EQL half of EQL types as plan field targets (cipherstash/stack#1062): a Go data plan names `TextEq` and the guest returns the finished EQL value instead of assembling one. Every target is an `eql_v4_*` domain. `TextEq` is the only producible type; every other name is refused with the plan's reason. The SQL surface and the TypeScript package are unchanged. diff --git a/.changeset/eql-target-match-options.md b/.changeset/eql-target-match-options.md new file mode 100644 index 000000000..49368aa91 --- /dev/null +++ b/.changeset/eql-target-match-options.md @@ -0,0 +1,5 @@ +--- +'@cipherstash/eql': minor +--- + +**`eql-bindings` says which match options an EQL type's filter is built under** (`targets` feature). `Target::match_options()` returns `EqlMatch`'s options for a type with a match index (`TextMatch`) and `None` otherwise, so Stack Encrypt can answer `matches` through the type's query twin: it cuts the query's tokens for `verify` exactly as the stored filter was cut. The SQL surface and the TypeScript package are unchanged. diff --git a/.changeset/eql-text-equality-transcoding.md b/.changeset/eql-text-equality-transcoding.md index 969aa9653..e3aae722e 100644 --- a/.changeset/eql-text-equality-transcoding.md +++ b/.changeset/eql-text-equality-transcoding.md @@ -2,4 +2,4 @@ '@cipherstash/eql': minor --- -**Rust `TextEq` and `TextEqQuery` support Stack Encrypt's target-directed API behind the `stack-encrypt` feature.** The stored table and column identifier supplies the encryption context; native ciphertext and equality terms are transcoded into EQL payloads while Vitamin C owns plaintext encoding. This is a new producer profile with exact string equality, independent of existing cipherstash-client ciphertext and terms. Query operands carry no recoverable ciphertext. +**Rust `eql_bindings::v4::text::{TextEq, TextEqQuery}` support Stack Encrypt's target-directed API behind the `stack-encrypt` feature.** Stack Encrypt writes EQL v4 only, so the `eql_v3` types carry no Stack Encrypt traits. The stored table and column identifier supplies the encryption context; native ciphertext and equality terms are transcoded into EQL payloads while Vitamin C owns plaintext encoding. This is a new producer profile whose string equality compares text in Unicode 16 NFC without folding case, independent of existing cipherstash-client ciphertext and terms. Text holding a code point unassigned in Unicode 16 is refused, when it is stored as well as when it is queried. Query operands carry no recoverable ciphertext. diff --git a/.changeset/eql-v4-bindings.md b/.changeset/eql-v4-bindings.md new file mode 100644 index 000000000..7f0d61385 --- /dev/null +++ b/.changeset/eql-v4-bindings.md @@ -0,0 +1,9 @@ +--- +'@cipherstash/eql': minor +--- + +**The `eql-bindings` crate has an `eql_bindings::v4` module, with the `stack-encrypt` feature: payload types for the EQL v4 domains.** EQL v4 is the v3 SQL installed under a second name (ADR-0002), for values written by Stack Encrypt, so the module exists only with that feature and its types derive Stack Encrypt's traits without a further gate. The module is generated from the same catalog as `v3`, with `eql_v4_*` domain names and `"v": 4`. `SchemaVersion` is now generic over the version it admits: `v3::SchemaVersion` is `SchemaVersion<3>` and `v4::SchemaVersion` is `SchemaVersion<4>`, each refusing the other's payloads, and plain `SchemaVersion` still means v3. Only v4 types derive Stack Encrypt's `EncryptFrom` and `DecryptInto`, and the Stack Encrypt target table (now `eql_bindings::v4::targets`) names v4 domains. Besides `TextEq`, Stack Encrypt now produces the storage-only types `Text`, `Integer`, `Bigint`, `Boolean`, `Real` and `Double`, and `TextMatch` (3-grams, `k = 6`, a 2048-bit filter, pinned as `eql_bindings::encryption::EqlMatch`; text shorter than three characters is refused, stored or queried, and only `stored @@ query` matches until #1171 is fixed), from the Rust primitives `i32`, `i64`, `bool`, `f32` and `f64`; the Go SDK's `encrypt/eql` table marks them producible. Stack Encrypt also produces the number equality types `IntegerEq`, `BigintEq`, `RealEq` and `DoubleEq`, whose `=` compares as PostgreSQL compares the plain types: an integer has one term whatever its width, and for floats `-0.0 = 0.0` and `NaN = NaN` (ADR-0002's semantic baseline). Every type it cannot produce yet names the issue that tracks its blocker. The by-name target entry points (`eql_bindings::encryption::targets::encrypt`, `decrypt` and `query`) exchange the plaintext as Stack Encrypt's `dynamic::ValueFrame`, one value as its transport frame, rather than a value tree. They, and the generated `v4::targets` table, need the new `targets` feature, which turns on `stack-encrypt` and Stack Encrypt's `dynamic` feature. `stack-encrypt` alone no longer builds Stack Encrypt's `dynamic` layer, so a Rust program using the typed v4 types through `encrypt_as` doesn't compile it. + +**The EQL v4 SQL bundle has range query domains and `eql_v4.between`, so a `BETWEEN` query is one operand.** The v4 bundle (`cipherstash-encrypt-v4.sql`) is built from this source and reaches users as the `eql-v4-install.sql` attached to each Go release; neither the npm package nor the crate ships it, and the v3 SQL they ship does not change. Every ordered family has one range query domain per order term, beside its single-bound ones: `eql_v4.query_integer_range_ore` beside `eql_v4.query_integer_ord_ore`, `eql_v4.query_integer_range_ope` beside `eql_v4.query_integer_ord_ope`, and the same for `smallint`, `bigint`, `date`, `timestamp`, `numeric`, `text`, `real` and `double`. A range is `{"v": 4, "i": …, "lo": , "hi": }`: each bound is the single-bound domain's `ob` (ORE) or `op` (OPE) value, in a `{v, i, lo, hi}` envelope. Stack Encrypt does not build that envelope yet; it will need to when the ordered types become producible. `eql_v4.between(column, range)` is true when the column's order term lies between the bounds, both included, and has an overload for every ordered column domain with the range of the term it stores (`_ord_ore` and `_search_ore` take the ORE range; `_ord`, `_ord_ope` and `_search` the OPE one). It is an inlinable SQL function, so a btree on the column's order term (`eql_v4.ord_term_ore(col)` or `eql_v4.ord_term(col)`) serves it as one index range scan. Write it schema-qualified (`BETWEEN` is an SQL keyword, so a bare `between(...)` does not parse), and cast the range to its exact domain (`$1::eql_v4.query_integer_range_ore`): an uncast `$1`, a `jsonb` parameter, or a range of another term or family fails with SQLSTATE 42725 ("function … is not unique"), unlike the single-bound operators, which resolve an untyped `$1`. An ORE range scan needs the `ore_block_256` btree operator class, which the installer creates only as a superuser; on an install without it (Supabase and other non-superuser roles), the ORE range domains are disabled like the single-bound ORE domains, and a value cast to one raises `feature_not_supported` naming the family's OPE range. In the crate, `eql_bindings::v4` (`stack-encrypt` feature) has a type for each range domain (`IntegerRangeOreQuery`, `TextRangeOpeQuery`, …, listed by `v4::all_range_query()`). EQL v3 has no range domains: its SQL and types are unchanged (ADR-0009, decision 7). + +Nothing a released version shipped has changed. The v3 types, the v3 SQL and the TypeScript package are as they were; the `stack-encrypt` derives on the v3 text types and the `v3::targets` module were added after the last release and are moved to v4 here, not removed from a release. diff --git a/.changeset/eql-v4-date-timestamp-numeric.md b/.changeset/eql-v4-date-timestamp-numeric.md new file mode 100644 index 000000000..96ffccffb --- /dev/null +++ b/.changeset/eql-v4-date-timestamp-numeric.md @@ -0,0 +1,5 @@ +--- +'@cipherstash/eql': minor +--- + +**Stack Encrypt produces the EQL v4 date, timestamp and numeric types `Date`, `DateEq`, `Timestamp`, `TimestampEq`, `Numeric` and `NumericEq`** (`eql-bindings`, `stack-encrypt` feature). Their Rust plaintexts are the crate's own `v4::plaintext::Date`, `Timestamp` and `Decimal`, which hold the integers the engine stores (days since 1970-01-01; Unix seconds and nanoseconds; a mantissa and a scale), are range checked when built and are wiped when dropped. The `chrono` and `rust_decimal` features convert to and from those crates' types. `=` on `NumericEq` normalises the scale (`1.5 = 1.50`) and on `TimestampEq` compares to the microsecond, truncating (never rounding) the nanoseconds below it; each value decrypts as it was stored. The ordered types of these families stay unproducible until the engine derives their order terms. The Go SDK's `encrypt/eql` table marks the six producible, from `encrypt.Date`, `time.Time` and `encrypt.Decimal`. diff --git a/.changeset/eql-v4-ordered-ope-types.md b/.changeset/eql-v4-ordered-ope-types.md new file mode 100644 index 000000000..27a8fb5a7 --- /dev/null +++ b/.changeset/eql-v4-ordered-ope-types.md @@ -0,0 +1,5 @@ +--- +'@cipherstash/eql': minor +--- + +**Stack Encrypt produces the OPE-ordered EQL v4 types `IntegerOrd`, `SmallintOrd`, `BigintOrd`, `RealOrd`, `DoubleOrd`, `TextOrd` and their `OrdOpe` twins** (`eql-bindings`, `stack-encrypt` feature). Their `op` term orders by ADR-0002's order key, so `<`, `<=`, `>`, `>=` and `ORDER BY eql_v4.ord_term(col)` compare integers by value, floats as PostgreSQL's `float8` does and text by its fold (case and accents folded). `=` on text reads `TextEq`'s equality term. `TextSearch` stays unproducible, with a reason: its query carries a match term that short text cannot make. diff --git a/.changeset/eql-v4-smallint.md b/.changeset/eql-v4-smallint.md new file mode 100644 index 000000000..5438f7c9e --- /dev/null +++ b/.changeset/eql-v4-smallint.md @@ -0,0 +1,5 @@ +--- +'@cipherstash/eql': minor +--- + +**Stack Encrypt produces the EQL v4 types `Smallint` and `SmallintEq`** (`eql-bindings`, `stack-encrypt` feature), from `i16`. `SmallintEq`'s equality term is the integer one, so a smallint and an integer of the same value under one column share it. The `date`, `timestamp` and `numeric` types now say they wait for a choice of Rust plaintext type, not for an engine kind. diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 000000000..f36468fef --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,20 @@ +# Copilot instructions for cipherstash/stack + +The project instructions are in `AGENTS.md`. When reviewing a pull request, +follow its "Review guidelines", in particular these known non-findings, +which are deliberate design decisions and not defects: + +- A sealed container's membership, order and length are not authenticated: + which entries a stored map holds, and a stored sequence's order, length + and duplicates, are not bound into any AAD, because stored values are + database rows and columns that come back in any order and in part. A + target that refuses a container's shape is a shape mismatch + (`Error::OpenedType`), not tampering (`Error::Aead`). +- A passthrough field is stored in the clear and is not authenticated, + except a plan's context field, which every other field is sealed under. +- Two leaves sealed under the same context are interchangeable between rows; + binding a value to its row is the caller's choice of context. + +A leaf that is not bound to its context, map key, role (single value or +sequence element), type tag or wire version is still a defect. See +`packages/stack-encrypt/docs/adr/0010-what-a-stored-value-authenticates.md`. diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d3257df9b..3b16d3955 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -299,7 +299,7 @@ updates: - dependency-name: "recipher" - dependency-name: "cllw-ore" # vitaminc is pinned at 0.5.0 across the crates and the guests; the - # guests' `FfiValue: Decrypt` bound fails if two versions resolve. + # guests' `ValueFrame: Decrypt` bound fails if two versions resolve. - dependency-name: "vitaminc*" # Major bumps are reviewed and applied manually, not by Dependabot. - dependency-name: "*" diff --git a/.github/workflows/test-eql.yml b/.github/workflows/test-eql.yml index b3d0c2d60..ead9b325c 100644 --- a/.github/workflows/test-eql.yml +++ b/.github/workflows/test-eql.yml @@ -733,6 +733,8 @@ jobs: run: mise run test:installer_complete - name: Symbol-order cross-check (v3) run: mise run test:symbol_order_v3 + - name: v4 isolation gate and its self-test + run: mise run test:v4_isolation - name: Build-ordering helper unit tests run: mise run test:build_ordering_helpers diff --git a/.github/workflows/tests-golang.yml b/.github/workflows/tests-golang.yml index 9bfff334a..6ef27e601 100644 --- a/.github/workflows/tests-golang.yml +++ b/.github/workflows/tests-golang.yml @@ -36,6 +36,10 @@ on: # The eql guest build links eql-bindings. - packages/eql/crates/eql-bindings/** - packages/eql/crates/eql-domains/** + # The Go tests read the cross-language fixtures the EQL suite writes, + # which are derived under EQL's lockfile. + - packages/eql/tests/encryption/** + - packages/eql/Cargo.lock - languages/golang/** - scripts/check-wasm-imports.py - scripts/go-binding-test.sh @@ -61,6 +65,10 @@ on: # The eql guest build links eql-bindings. - packages/eql/crates/eql-bindings/** - packages/eql/crates/eql-domains/** + # The Go tests read the cross-language fixtures the EQL suite writes, + # which are derived under EQL's lockfile. + - packages/eql/tests/encryption/** + - packages/eql/Cargo.lock - languages/golang/** - scripts/check-wasm-imports.py - scripts/go-binding-test.sh @@ -103,6 +111,24 @@ jobs: # caches) the whole test toolset, which `mise run` would otherwise # install uncached. MISE_ENV: test + # The Go module's PostgreSQL test (encrypt/postgres_test.go) stores + # generated rows and runs the query methods against it through + # database/sql; it skips where DATABASE_URL is unset, as on the macOS + # and Windows jobs. + services: + postgres: + image: postgres:17 + env: + POSTGRES_PASSWORD: postgres + # Container port only: Docker picks the host port, and the Go step + # reads it from `job.services`, so the number is written once. + ports: + - 5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: @@ -133,6 +159,7 @@ jobs: . languages/golang/encrypt/guest languages/golang/auth/guest + packages/eql # The HTTP-free core compiles for wasm32-wasip1 with no JS-host backend # and no native HTTP/TLS stack in its graph: the invariant the wazero @@ -215,11 +242,28 @@ jobs: - name: Go binding env: STACK_ENCRYPT_TESTS_REQUIRE_LOCK: "1" + DATABASE_URL: "postgres://postgres:postgres@localhost:${{ job.services.postgres.ports['5432'] }}/postgres?sslmode=disable" run: | ulimit -l "$(ulimit -H -l)" echo "RLIMIT_MEMLOCK: $(ulimit -l) KiB" mise run go:test + # The Rust suite opens the committed v4_rows.json and + # v4_smallint_rows.json, whose ciphertexts the Go SDK sealed when each + # file was last regenerated. This also hands it the rows the Go SDK + # seals in this run, so a Go guest and a native Rust build that stop + # agreeing on today's ciphertexts fail here rather than when someone + # next regenerates a file. Both filters are exact, so each test named + # here is one that reads the rows handed to it. The toolchain is the + # root's pin, as for the guests. + - name: Rows the Go SDK seals today open in Rust + run: | + rows="$RUNNER_TEMP/v4_rows.json" + smallint_rows="$RUNNER_TEMP/v4_smallint_rows.json" + (cd languages/golang && CGO_ENABLED=0 EQL_V4_ROWS_OUT="$rows" EQL_V4_SMALLINT_ROWS_OUT="$smallint_rows" go test -count=1 -run '^(TestV4RowsMatchTheCommittedFixture|TestV4SmallintRowsMatchTheCommittedFixture)$' ./encrypt) + test -s "$rows" && test -s "$smallint_rows" + EQL_V4_ROWS="$rows" EQL_V4_SMALLINT_ROWS="$smallint_rows" cargo test --locked --manifest-path packages/eql/Cargo.toml -p eql-encryption-tests --test v4_types -- --exact rows_the_go_sdk_sealed_open_in_rust smallint_rows_the_go_sdk_sealed_open_in_rust + # What is encrypted is fixed before the program ships: every generated # file is committed, and this fails when `go generate` would change # one. It runs the real stashgen against the guest just built, so it diff --git a/AGENTS.md b/AGENTS.md index d828dd683..70e6870a5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -991,6 +991,39 @@ pnpm changeset:publish A skills-only change is **not** internal: `skills/` ships inside the `stash` tarball, so it needs a `stash` patch changeset. +## Review guidelines + +These apply to every agent that reviews a pull request here, human-prompted +or automated (Codex, Copilot, CodeRabbit, Claude Code's `/code-review`). + +### Known non-findings + +These are deliberate design decisions, recorded in ADRs. Do not report them +as defects or security issues, and do not change code to "fix" them. If a +change seems to need one reversed, say so and link the ADR. + +- **A sealed container's membership, order and length are not + authenticated.** Each leaf is bound to its context, its map key, its role + (single value or sequence element), its type tag and the wire version. But + which entries a stored map holds, and a stored sequence's order, length + and duplicates, are deliberately not bound: stored values are database + rows and columns, which come back in any order and in part. A target that + refuses a container's shape (a missing field, say) is a shape mismatch, + `Error::OpenedType`, not tampering, `Error::Aead`. Stricter authentication + will be opt-in, through named types. See + `packages/stack-encrypt/docs/adr/0010-what-a-stored-value-authenticates.md` + and vitaminc's ADR 0002. +- **A passthrough field is not authenticated.** It is stored in the clear, + by definition, and comes back as the store holds it. A plan's context + field is the exception: every other field is sealed under it, so a change + to it is caught. Same ADR. +- **Two leaves sealed under the same context are interchangeable between + rows.** Binding a value to its row is the caller's choice of context (a + row id or tenant in it). Same ADR. + +A finding that a *leaf* is not bound to its context, key, role, type or +version is a real defect: report it. + ## Useful Links - `README.md` for quickstart and feature overview diff --git a/Cargo.lock b/Cargo.lock index 6d6dce0f8..b14cac340 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -108,7 +108,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f50776554130342de4836ba542aa85a4ddb361690d7e8df13774d7284c3d5c2" dependencies = [ "include_dir", - "itertools 0.10.5", + "itertools", "proc-macro-error2", "proc-macro2", "quote", @@ -463,9 +463,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chacha20" -version = "0.10.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" +checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" dependencies = [ "cfg-if", "cpufeatures 0.3.0", @@ -509,15 +509,17 @@ dependencies = [ [[package]] name = "cllw-ore" -version = "0.5.0" +version = "0.5.2-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "476f300d37a5029d3d9dd57145d4db50a23f40ae9b4d1374c44543978b906191" +checksum = "24eb4a774d070a6c2b52175b98273cd7193c61e1bda39c1a98b50b7a2d91375a" dependencies = [ "blake3", "hex", "subtle", "thiserror 1.0.69", "unicode-normalization", + "vitaminc-ore", + "vitaminc-protected 0.6.1", "zeroize", ] @@ -771,7 +773,7 @@ dependencies = [ "url", "utoipa", "uuid", - "vitaminc", + "vitaminc 0.5.1", ] [[package]] @@ -966,7 +968,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -1465,7 +1467,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2 0.6.2", + "socket2 0.5.10", "tokio", "tower-service", "tracing", @@ -1708,15 +1710,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.17" @@ -2132,7 +2125,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -2328,6 +2321,15 @@ dependencies = [ "syn 2.0.114", ] +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit 0.25.17+spec-1.1.0", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -2395,7 +2397,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b570b25f7617e43d59005d0990ccb79e950a423952cea19671b7a876da390adf" dependencies = [ "anyhow", - "itertools 0.12.1", + "itertools", "proc-macro2", "quote", "syn 2.0.114", @@ -2420,7 +2422,7 @@ dependencies = [ "quinn-udp", "rustc-hash", "rustls", - "socket2 0.6.2", + "socket2 0.5.10", "thiserror 2.0.18", "tokio", "tracing", @@ -2459,7 +2461,7 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.6.2", + "socket2 0.5.10", "tracing", "windows-sys 0.60.2", ] @@ -2763,7 +2765,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.4.15", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -2776,7 +2778,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.12.1", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -2833,7 +2835,7 @@ dependencies = [ "security-framework", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -3219,8 +3221,8 @@ dependencies = [ "tracing-subscriber", "url", "uuid", - "vitaminc", - "vitaminc-protected", + "vitaminc 0.6.1", + "vitaminc-protected 0.6.1", "web-time", "zeroize", "zerokms-protocol", @@ -3242,7 +3244,7 @@ dependencies = [ "tempfile", "tokio", "url", - "vitaminc-protected", + "vitaminc-protected 0.6.1", "zeroize", ] @@ -3267,7 +3269,7 @@ dependencies = [ [[package]] name = "stack-encrypt" -version = "0.2.0" +version = "0.3.0" dependencies = [ "base64ct", "cllw-ore", @@ -3281,19 +3283,21 @@ dependencies = [ "tokio", "trybuild", "uuid", - "vitaminc-aead", - "vitaminc-aead-value", - "vitaminc-encrypt", + "vitaminc-aead 0.6.1", + "vitaminc-aead-frame", + "vitaminc-encrypt 0.6.1", "vitaminc-hmac", + "vitaminc-normalize", + "vitaminc-ore", "vitaminc-prf", - "vitaminc-protected", + "vitaminc-protected 0.6.1", "zeroize", "zerokms-protocol", ] [[package]] name = "stack-encrypt-derive" -version = "0.2.0" +version = "0.3.0" dependencies = [ "proc-macro2", "quote", @@ -3307,12 +3311,14 @@ dependencies = [ name = "stack-guest-abi" version = "0.0.0" dependencies = [ + "futures", "miette", "proptest", "serde_json", "thiserror 1.0.69", - "vitaminc-aead-value", - "vitaminc-protected", + "vitaminc-aead 0.6.1", + "vitaminc-aead-frame", + "vitaminc-protected 0.6.1", "zeroize", ] @@ -3344,8 +3350,8 @@ dependencies = [ "tracing", "url", "uuid", - "vitaminc", - "vitaminc-protected", + "vitaminc 0.6.1", + "vitaminc-protected 0.6.1", "zeroize", "zerokms-protocol", ] @@ -3492,7 +3498,7 @@ dependencies = [ "getrandom 0.4.2", "once_cell", "rustix 1.1.5", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -3680,7 +3686,7 @@ dependencies = [ "serde", "serde_spanned 0.6.9", "toml_datetime 0.6.11", - "toml_edit", + "toml_edit 0.22.27", ] [[package]] @@ -3730,6 +3736,18 @@ dependencies = [ "winnow 0.7.14", ] +[[package]] +name = "toml_edit" +version = "0.25.17+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3641d5bbb5349a79e1020a242d251efbc546ad8048d133958323ce9c40a9c9c" +dependencies = [ + "indexmap", + "toml_datetime 1.1.2+spec-1.1.0", + "toml_parser", + "winnow 1.0.4", +] + [[package]] name = "toml_parser" version = "1.1.5+spec-1.1.0" @@ -3910,6 +3928,12 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +[[package]] +name = "unicode-general-category" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b993bddc193ae5bd0d623b49ec06ac3e9312875fdae725a975c51db1cc1677f" + [[package]] name = "unicode-ident" version = "1.0.23" @@ -4073,12 +4097,26 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35042fb7a81d72dc43c53fec835e61027f18b4d01cc0f7e12d6c6a6ffbf3bfb9" dependencies = [ - "vitaminc-aead", - "vitaminc-context", - "vitaminc-encrypt", - "vitaminc-protected", - "vitaminc-random", - "vitaminc-traits", + "vitaminc-aead 0.5.1", + "vitaminc-context 0.5.1", + "vitaminc-encrypt 0.5.1", + "vitaminc-protected 0.5.1", + "vitaminc-random 0.5.1", + "vitaminc-traits 0.5.1", +] + +[[package]] +name = "vitaminc" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac5c15b6c25efcb9a6111f7108ab8101947a7bf7e9af3ff6d6a73358a1ace0da" +dependencies = [ + "vitaminc-aead 0.6.1", + "vitaminc-context 0.6.1", + "vitaminc-encrypt 0.6.1", + "vitaminc-protected 0.6.1", + "vitaminc-random 0.6.1", + "vitaminc-traits 0.6.1", ] [[package]] @@ -4089,10 +4127,27 @@ checksum = "62cacd4dae485e98cfe5407e919187a8468dd933ea4234be5115b7d13a30f3c6" dependencies = [ "bytes", "serde", - "vitaminc-aead-derive", - "vitaminc-context", - "vitaminc-protected", - "vitaminc-random", + "vitaminc-aead-derive 0.5.1", + "vitaminc-context 0.5.1", + "vitaminc-protected 0.5.1", + "vitaminc-random 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-aead" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71b8c5c4ced92545dce5fd7cf04581d08210def174cc81475cf227fa2506c5b7" +dependencies = [ + "bytes", + "futures-util", + "serde", + "thiserror 2.0.18", + "vitaminc-aead-derive 0.6.1", + "vitaminc-context 0.6.1", + "vitaminc-protected 0.6.1", + "vitaminc-random 0.6.1", "zeroize", ] @@ -4108,13 +4163,24 @@ dependencies = [ ] [[package]] -name = "vitaminc-aead-value" -version = "0.5.1" +name = "vitaminc-aead-derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c546497a972d0f0498f2f8d5f537c514bad82df8662951c63d0c80023808900" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.6", +] + +[[package]] +name = "vitaminc-aead-frame" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d78cdadbc6374c3bd7c19fb4d99abca693b96953b18fef8c608efbe092cf3ea" +checksum = "e35992a269bcaa5b201f1938e54bfbf167bfa6fe975d83cbdbdb54c2a363c5ef" dependencies = [ - "vitaminc-aead", - "vitaminc-protected", + "serde", + "vitaminc-aead 0.6.1", "zeroize", ] @@ -4125,7 +4191,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7df52501fe33cdb3ee9e155b5242fac184c037d147e58c96e5143ed011252a8" dependencies = [ "mutants", - "vitaminc-protected", + "vitaminc-protected 0.5.1", +] + +[[package]] +name = "vitaminc-context" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4c4bc2bd9811253eb427657565a45bd4826e2379e93ee1c4d00c808a769882" +dependencies = [ + "mutants", + "vitaminc-protected 0.6.1", ] [[package]] @@ -4136,35 +4212,79 @@ checksum = "9fbd0e1748055e381e02033e08af385de879c4dcf32e0f6739ac0c0cf0c6f13d" dependencies = [ "aes-gcm", "aws-lc-rs", - "vitaminc-aead", - "vitaminc-protected", - "vitaminc-random", + "vitaminc-aead 0.5.1", + "vitaminc-protected 0.5.1", + "vitaminc-random 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-encrypt" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0923694602855b33a296d9af473e282e8096c1cfe1b30b8695d3b6651717fc5" +dependencies = [ + "aes-gcm", + "aws-lc-rs", + "vitaminc-aead 0.6.1", + "vitaminc-protected 0.6.1", + "vitaminc-random 0.6.1", "zeroize", ] [[package]] name = "vitaminc-hmac" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15fe558a5e92d4f2b3f811c5b67d863d9255da5f66d08a71d4f0dd3d0011c563" +checksum = "bd361f626e95cbe770b9d012e4a86c43cfefe4aefb3d5b3ed9339a83085bdc53" dependencies = [ "hmac", "sha2 0.11.0", "vitaminc-prf", - "vitaminc-protected", + "vitaminc-protected 0.6.1", "zeroize", ] +[[package]] +name = "vitaminc-normalize" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "214b2a9d085924c3bc3c91f3ba74238e8848bf54990e5f48f170c71fbacea07a" +dependencies = [ + "thiserror 2.0.18", + "unicode-general-category", + "unicode-normalization", + "vitaminc-aead 0.6.1", + "vitaminc-protected 0.6.1", +] + +[[package]] +name = "vitaminc-ore" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed88c54b5f06f2177ecbfb7666812adf645406f6fb555f4e2f0fd7fa218e71c4" +dependencies = [ + "thiserror 2.0.18", + "unicode-general-category", + "unicode-normalization", + "vitaminc-aead 0.6.1", + "vitaminc-context 0.6.1", + "vitaminc-normalize", + "vitaminc-protected 0.6.1", +] + [[package]] name = "vitaminc-prf" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712d31d46d76b38c6b62deb35f516fc5636a35f90f39c0213d0ca9a052b4400b" +checksum = "c2715cca25006b4656223bc932ab4fd7f70d387aa4ec63a4e2ef33aa8cd2b3a5" dependencies = [ "mutants", "thiserror 2.0.18", - "vitaminc-context", - "vitaminc-protected", + "vitaminc-aead 0.6.1", + "vitaminc-context 0.6.1", + "vitaminc-normalize", + "vitaminc-protected 0.6.1", ] [[package]] @@ -4180,7 +4300,24 @@ dependencies = [ "serde_bytes", "subtle", "thiserror 2.0.18", - "vitaminc-protected-derive", + "vitaminc-protected-derive 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-protected" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1bb76dd473f5aa89b844f92018ebe3041deb8e5390e7061cca4283d959ff855" +dependencies = [ + "bitvec", + "digest 0.11.3", + "libc", + "serde", + "serde_bytes", + "subtle", + "thiserror 2.0.18", + "vitaminc-protected-derive 0.6.1", "zeroize", ] @@ -4195,6 +4332,18 @@ dependencies = [ "syn 3.0.6", ] +[[package]] +name = "vitaminc-protected-derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7478ed160c019059746e75fc613563dcdcd5266d155a34601d29377a1c4afc3" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 3.0.6", +] + [[package]] name = "vitaminc-random" version = "0.5.1" @@ -4205,8 +4354,23 @@ dependencies = [ "getrandom 0.4.2", "rand 0.10.1", "thiserror 2.0.18", - "vitaminc-protected", - "vitaminc-random-derives", + "vitaminc-protected 0.5.1", + "vitaminc-random-derives 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-random" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b477af7c01c3d9ef2647e46952ad3df7f246b3f806b1d4009ee83beecec613a" +dependencies = [ + "chacha20", + "getrandom 0.4.2", + "rand 0.10.1", + "thiserror 2.0.18", + "vitaminc-protected 0.6.1", + "vitaminc-random-derives 0.6.1", "zeroize", ] @@ -4221,6 +4385,17 @@ dependencies = [ "syn 3.0.6", ] +[[package]] +name = "vitaminc-random-derives" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5a0de8da428c6789dc067a578a0462e411099721d616736cf29e1622230c35" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.6", +] + [[package]] name = "vitaminc-traits" version = "0.5.1" @@ -4232,8 +4407,24 @@ dependencies = [ "rmp-serde", "serde", "thiserror 2.0.18", - "vitaminc-protected", - "vitaminc-random", + "vitaminc-protected 0.5.1", + "vitaminc-random 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-traits" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a900f0edcacd49c8557ab54722175869fec66926054a6fbdc53a05069db3c922" +dependencies = [ + "anyhow", + "bytes", + "rmp-serde", + "serde", + "thiserror 2.0.18", + "vitaminc-protected 0.6.1", + "vitaminc-random 0.6.1", "zeroize", ] @@ -4491,7 +4682,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -4586,15 +4777,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-sys" version = "0.60.2" @@ -4870,6 +5052,9 @@ name = "winnow" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" +dependencies = [ + "memchr", +] [[package]] name = "winreg" diff --git a/Cargo.toml b/Cargo.toml index 3da394ab4..17bec471a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,7 +81,10 @@ stack-profile = { path = "./packages/stack-profile", version = "0.43.0" } cts-common = { version = "0.43.0", default-features = false } zerokms-protocol = "0.12.31" recipher = "=0.3.1" -cllw-ore = { version = "=0.5.0", default-features = false } +# cllw-ore's `vitaminc` feature implements vitaminc-ore's `OrderScheme`, +# which Stack Encrypt's order terms are encrypted through. It first ships +# in a pre-release, and Cargo resolves a pre-release only when named. +cllw-ore = { version = "=0.5.2-rc.1", default-features = false, features = ["vitaminc"] } # External dependencies, with the suite's feature lists. base64 = "0.22.0" @@ -120,13 +123,18 @@ web-time = "1.1" zeroize = { version = "1.8.1", features = ["derive"] } # This is needed because lock_api 0.4.6 was breaking things and the branch forces the use of 0.4.12 temp-env = { git = "https://github.com/cipherstash/temp-env", branch = "main" } -vitaminc = { version = "0.5.1", features = ["random", "protected", "encrypt"] } -vitaminc-aead = "0.5.1" -# The dynamic value model (`FfiValue`) and its FFI transport codec, shared by -# every language binding. Optional in stack-encrypt (the `dynamic` feature). -# 0.5.1 adds `ValueKind`, the field-type vocabulary a dynamic plan declares. -vitaminc-aead-value = "0.5.1" -vitaminc-encrypt = "0.5.1" -vitaminc-hmac = "0.5.1" -vitaminc-prf = "0.5.1" -vitaminc-protected = "0.5.1" +vitaminc = { version = "0.6.1", features = ["random", "protected", "encrypt"] } +vitaminc-aead = "0.6.1" +# The transport frame and ciphertext codec every language binding carries +# across its FFI boundary. Optional in stack-encrypt (the `dynamic` feature). +vitaminc-aead-frame = "0.6.1" +vitaminc-encrypt = "0.6.1" +vitaminc-hmac = "0.6.1" +# Normalized equality terms (Unicode 16 NFC text, one integer encoding for +# every width), which `vitaminc-prf`'s `normalize` feature derives over. +vitaminc-normalize = "0.6.1" +# The text order key: the system ADR-0002's fold, pinned to Unicode 16, +# which text ORE and OPE terms are derived over (ADR-0009). +vitaminc-ore = "0.6.1" +vitaminc-prf = { version = "0.6.1", features = ["normalize"] } +vitaminc-protected = "0.6.1" diff --git a/biome.json b/biome.json index 765be3b6a..02cdf6475 100644 --- a/biome.json +++ b/biome.json @@ -11,7 +11,12 @@ "!languages/typescript/packages/protect-ffi/target", "!languages/typescript/packages/protect-ffi/src/eql-v3-types", "!packages/stack-encrypt/tests/fixtures/record_lowering.json", + "!packages/stack-encrypt/tests/fixtures/query_operators.json", + "!packages/stack-encrypt/tests/fixtures/value_kinds.json", + "!packages/stack-encrypt/tests/fixtures/stored_rows_v1.json", "!packages/eql/tests/encryption/fixtures/ste_vec_selectors.json", + "!packages/eql/tests/encryption/fixtures/v4_rows.json", + "!packages/eql/tests/encryption/fixtures/stored_v4_rows_v1.json", "!packages/eql/crates/eql-bindings/bindings", "!packages/eql/crates/eql-bindings/schema", "!packages/eql/packages/eql/src/generated", diff --git a/docs/adr/0002-one-value-model-three-encodings-and-eql-v4-by-producer.md b/docs/adr/0002-one-value-model-three-encodings-and-eql-v4-by-producer.md new file mode 100644 index 000000000..8230b207b --- /dev/null +++ b/docs/adr/0002-one-value-model-three-encodings-and-eql-v4-by-producer.md @@ -0,0 +1,560 @@ +--- +status: accepted +date: 2026-10-08 +revised: 2026-10-12, amended 2026-10-18 and 2026-10-19 +relates-to: ADR-0001; stack-encrypt ADR-0003, ADR-0007 +--- + +# One value model, three encodings in vitaminc, and EQL v4 separated by producer + +> **Revised 2026-10-12.** This ADR now carries the decisions from +> [`docs/plans/2026-10-11-order-and-equality-terms-layering.md`](../plans/2026-10-11-order-and-equality-terms-layering.md): +> vitaminc sits at the bottom of the stack, equality and order terms take +> per-domain transforms over a shared semantic baseline, `vitaminc-prf` no +> longer depends on order encodings, and `orderable-bytes` is frozen. The plan +> keeps the steps; this document is the decision. +> +> **Amended 2026-10-18.** vitaminc 0.6 removed the shared value type rather +> than renaming `FfiValue` to `Value` (vitaminc ADR 0001: a value describes +> itself once, and sinks consume it). Stack Encrypt follows: +> +> - A plaintext whose type is known only at run time is held as its +> transport frame (`dynamic::ValueFrame`) and walked into vitaminc's sinks. +> - `FfiValue` is removed. Each kind of control data a binding exchanges +> with the engine (a plan, a context, options, statistics, a configuration, +> the engine's answers) gets a type of its own, read from and written to a +> frame. Credentials in a configuration, such as the client key, are held +> in `Protected` fields. Until each message has its type, `FfiValue` carries +> only control data, never plaintext. +> - The open decision on exhaustive handling is settled by vitaminc 0.6's +> design (see "Exhaustive handling of kinds"). +> +> The bullets below that this changes say so where they stand. +> +> **Amended 2026-10-19.** A timestamp's microsecond resolution truncates +> rather than rounding half to even, as vitaminc does for both the equality +> and the order term. The reason, and the rule, are under "Lossy transforms". + +Every value Stack Encrypt handles is encoded three times: as a **ciphertext** +(reversible and self-describing), as an **equality term** (a keyed hash that +must be unambiguous) and as an **order term** (bytes whose order is the +value's order). This ADR decides where each encoding lives, which kinds of +value exist, how each kind is normalised before a term is derived from it, +and how EQL keeps columns written by Stack Encrypt apart from columns written +by cipherstash-client. + +## The problem + +In October 2026 Stack Encrypt could produce one of EQL's 51 types, `TextEq`. +The number, date, timestamp and decimal families were blocked on encoding, +not code. (`Bool` was not: it already had a kind, and EQL's only boolean +type, `eql_v3_boolean`, stores a ciphertext and nothing else.) + +- **The three encodings disagreed about which types exist.** `i16` had an + equality domain in `vitaminc-prf` and an order encoding, but no ciphertext + tag, so it could not be a kind. Date, timestamp and decimal had order + encodings only. +- **The mapping from a kind to a Rust type lived in Stack Encrypt.** + `dynamic::term::Scalar` mirrored `FfiValue`'s variants one for one to + dispatch to the term crates, and `dynamic::Value` wrapped `FfiValue` only to + add `Clone`. Both restated vitaminc's vocabulary in a downstream crate. +- **Ordering was implemented twice.** `orderable-bytes` defines a canonical, + order-preserving encoding per type. cllw-ore uses it for chrono and decimal + but hand-rolls integers and floats, and differs on `-0.0`. Block ORE was not + derivable at all, so `TextOrdOre` and `TextSearchOre` were refused. +- **Order encodings were spread over three repositories.** Encodings lived in + ore.rs, schemes in ore.rs and cipherstash-suite, and term derivation in + vitaminc and Stack Encrypt. Every change needed releases in all of them, + and the scheme crates accepted raw bytes, so a hand-encoded integer + (little-endian, sign bit not flipped) encrypted without error and sorted + wrong. +- **The existing writer's encodings are inconsistent.** cipherstash-client + hashes a timestamp's milliseconds but orders by its nanoseconds, and hashes + a decimal with its scale while ordering ignores it. Its block ORE text is + ASCII-only, lowercased, maps every digit to one symbol and truncates to six + blocks. cllw-ore's text order form (`orderize_string`) decomposes to NFD and + then drops every character that is not alphanumeric, whitespace or ASCII + punctuation, which removes symbols, emoji and non-ASCII punctuation as well + as accents, and does not fold case. +- **Two producers wrote the same EQL domains.** A Stack Encrypt query term + never matches a cipherstash-client term for the same value, and the + `eql_v3_*` domains could not tell them apart. A query from one against a + column written by the other returned no rows, silently. + +## Options considered + +**Where the value model lives.** + +1. **Move `vitaminc-aead-value` into Stack Encrypt.** It looks like FFI + plumbing. But it is the value model for vitaminc's own `Cipher` traits: + `aead-napi` and vitaminc's Go binding encrypt with `Aes256Cipher` through + it, without Stack Encrypt. Moving it makes vitaminc Rust-only, makes + vitaminc depend on Stack Encrypt (which depends on six vitaminc crates), + or forks the frozen tag table into two copies. +2. **Keep it in vitaminc, and move term derivation there too.** All three + encodings then live in one repository, next to the value type they + encode. Chosen. How "a kind exists in every layer or in none" is enforced + is under "Exhaustive handling of kinds" below, with the conformance test + described under "Which kinds get which terms" as the backstop. + +**Where order schemes sit.** + +1. **`vitaminc-ore` adapts the scheme crates.** It depends on cllw-ore and + ore-rs and wraps each in its own trait, with `orderable-bytes` underneath. + This is the spread over three repositories described above. +2. **vitaminc at the bottom.** `vitaminc-ore` owns the order encodings and an + `OrderScheme` trait and depends on no scheme crate; cllw-ore and ore-rs + implement the trait. A scheme's input is a sealed type only `vitaminc-ore` + can build, so raw bytes cannot reach a scheme. Chosen. + +**How EQL separates the two producers.** The SQL for both is identical; only +the producer of the terms differs. + +1. **Name only.** Stack Encrypt payloads go in the `eql_v3_*` domains, + distinguished by the `stack-encrypt:1:` ciphertext prefix. Nothing in the + database stops a cross-producer comparison. +2. **A producer tag in every payload and term, checked by every operator.** + A runtime check on the hottest SQL paths, across about 24k lines of + hand-written SQL. +3. **One SQL source, emitted under two names.** The build writes the same + source out as `eql_v3` (cipherstash-client terms) and `eql_v4` (Stack + Encrypt terms). A column's domain names its producer: a payload written + to the other producer's domain fails its check on insert, and a typed + client sees two different types. Names alone do not stop a cross-producer + `=` in SQL; see Consequences. Chosen. + +**How v3 and v4 ship.** Bumping `main` to v4 and patching v3 from a branch +needs a maintenance release path for five lockstep artefacts that does not +exist, and the EQL publish script puts every stable release on `latest`, so a +3.x patch would move `latest` backwards. A second package doubles the +trusted-publishing and release surface. One package carrying both bundles +avoids both, at the cost of teaching the release tooling about a second +bundle (see Consequences). Chosen. + +## Decision + +### Kinds and the ciphertext + +- vitaminc 0.6.0 adds the kinds `Int8`, `UInt8`, `Int16`, `UInt16`, `Int128`, + `UInt128`, `Date`, `Timestamp` and `Decimal`, each with a `ValueKind` name, + a `Value` variant and a ciphertext tag, in one breaking release. Rust `i128` + and `u128` get `Encrypt` and `Decrypt` impls. +- ~~`FfiValue` is renamed `Value`, with `#[deprecated] pub type FfiValue = Value` + for one release.~~ *Amended 2026-10-18:* vitaminc 0.6 has no shared value + type to rename it to. Its ADR 0001 has a value describe itself once + (`Encrypt`) and every consumer be a sink: the encrypting sink, a term + deriver, a frame writer. A host binding walks its transport frame straight + into those sinks. So Stack Encrypt holds a dynamic plaintext as its frame, + `dynamic::ValueFrame`, in a wiped buffer, from the source a binding hands + over to the sealed leaves and from the opened leaves back to the frame it + returns, with no value tree in between. `FfiValue` is removed rather than + kept for control data: each control message gets its own type, read from + and written to a frame, and holds any credential in a `Protected` field. + `ValueKind`, the vocabulary a plan field declares, stays, and is + exhaustive. +- Every variant exists in every build. `Date`, `Timestamp` and `Decimal` use + vitaminc's own representation (the payloads in the table below), with + conversions to and from chrono and rust_decimal behind those features. A + variant that appeared only with a feature would break any exhaustive + handling outside `vitaminc-aead-value`, because features unify across a + build and a crate can check only its own. +- `Value` implements `Clone` as a deep copy that rebuilds every leaf into a + fresh `Protected`. A clone is under the same custody as its original. +- The sealed leaf tag table (`tags.rs`) stays frozen and contiguous. The + transport codec's framing tags move from `0x10`–`0x12` to `0xF0`–`0xF2`; + transport carries no compatibility commitment and every user of it updates + together. A leaf is `[tag] ++ payload`. The new leaves, which every binding + must produce byte for byte: + + | Tag | Kind | Payload | + |---|---|---| + | `0x0C`, `0x0D` | `Int8`, `UInt8` | 1 byte; two's complement for `Int8` | + | `0x0E`, `0x0F` | `Int16`, `UInt16` | 2 bytes, little-endian; two's complement for `Int16` | + | `0x10`, `0x11` | `Int128`, `UInt128` | 16 bytes, little-endian; two's complement for `Int128` | + | `0x12` | `Date` | `i32`, little-endian: the day number in the proleptic Gregorian calendar with **0001-01-01 as day 1** (chrono's `num_days_from_ce`). 0001-01-01 is `01 00 00 00`, not zero | + | `0x13` | `Timestamp` | `i64` Unix seconds, then `u32` nanoseconds, both little-endian, UTC. Nanoseconds are below 1,000,000,000. *Amended 2026-10-18 (#1144):* vitaminc 0.6 refuses a leap second: nanoseconds of 1,000,000,000 or more (chrono's leap-second representation, which the pre-ADR-0001 `Value` codec accepted when the seconds modulo 60 were 59) are refused, because a leap second has no count in any unit. The instant must also lie within chrono's `NaiveDateTime` range (vitaminc's `MIN_TIMESTAMP_NANOS` to `MAX_TIMESTAMP_NANOS`, years -262143 to 262142). Anything else is refused | + | `0x14` | `Decimal` | 16 bytes: a little-endian `u32` of flags (sign in bit 31, scale in bits 16–23 and at most 28, every other bit zero), then the low, middle and high little-endian `u32` words of the 96-bit mantissa. This is rust_decimal's `serialize()` and keeps the scale. There is no NaN or infinity | + +- `transport` stays a module of `vitaminc-aead-value`. + +### Semantic baseline and per-domain transforms + +The ciphertext keeps the value exactly as given: `1.50` decrypts as `1.50`, +and a timestamp keeps its nanoseconds. Terms are derived in two steps. + +**The semantic baseline** makes values that are equal under `Value`'s own +semantics encode the same. Every term applies it; it loses nothing a user +would call a different value. + +| Kind | Baseline | +|---|---| +| `Decimal` | scale normalised: `1`, `1.0` and `1.00` are equal | +| `Float32`, `Float64` | `-0.0` folded into `+0.0`; every NaN replaced by one positive quiet NaN, which sorts above +Infinity. This is Postgres's own `float8` semantics: `'NaN' = 'NaN'`, `'-0' = '0'` and `'NaN' > 'Infinity'` are all true | +| text | NFC | +| every other kind | none | + +**Lossy transforms** sit on top of the baseline, chosen by each term's +domain: timestamp resolution, text folding and prefix truncation. Each +transform and its version is named in the domain label, for example +`…/timestamp/day/v1`. The ones defined now: + +- **Timestamp resolution**: exact, microsecond or day. ~~Microsecond rounds + to the nearest microsecond, ties to even, on the signed microsecond count + since the epoch. That is what Postgres does when it parses a timestamp with + more digits than it keeps (`.1234565` becomes `.123456` and `.1234575` + becomes `.123458`, before and after 1970; checked on Postgres 17.5).~~ + *Amended 2026-10-19:* microsecond truncates: the nanoseconds below the + microsecond are dropped, never rounded, which is floor on the signed count + since the epoch (`.1234567` becomes `.123456`, and before 1970 an instant + moves earlier). vitaminc applies this rule to the equality term and to the + order term alike (vitaminc-ore's timestamp domain is + `vitaminc/ore/value/timestamp-micros/v1`, and both terms normalise through + `vitaminc_normalize::timestamp`), so `=` and the order agree on which + instants are one. Matching PostgreSQL's parse-time rounding is not a goal: + timestamps are stored in many places besides PostgreSQL, and a term must + mean the same thing whichever store holds it. A value that already has + microsecond precision is unchanged. Day takes the UTC calendar day. +- **Text fold, v1**: NFD, then full Unicode case folding (`CaseFolding.txt` + statuses C and F, so `ß` becomes `ss`), then NFD again, then removal of + every accent, then NFC. An accent is a mark (General_Category `Mn`, `Mc` + or `Me`) with a non-zero canonical combining class: the acute in `é`, the + umlaut in `ö`, a Devanagari virama. A mark of class zero is a letter of + its own in its script, such as a Thai or Devanagari vowel sign (U+0E31, + U+0901), and is kept. The order of the steps is part of the transform, + because folding can produce text that is no longer normalised and the + steps do not commute. + *Amended 2026-10-19:* this step said "every code point with + General_Category `Mn`", which would also drop class-zero vowel signs and + so tie different words. The fold that ships, `vitaminc-ore`'s + `vitaminc/ore/value/text-folded/unicode-16/v1`, keeps them, and this + bullet now describes it. +- **Prefix truncation**: a number of code points kept after any other + transform. Alphabet packing, if ever built, is a transform of the same + kind. + +Text transforms are pinned to a Unicode version, which is part of the label +(for example `text-fold/unicode-16/v1`), and the `unicode-normalization` and +case-folding tables are pinned to it. Code points unassigned in that version +pass through unchanged (canonical combining class 0, no decomposition, no +case mapping), so the transform is a fixed function and nothing is refused on +write. The cost is that two strings using characters added after the pin, +which a later Unicode would treat as equivalent, may not match. Moving the +pin is a new label: existing columns keep the label they were written under +and stay queryable, and a column moves only by re-encryption. +*Amended 2026-10-18:* vitaminc 0.6 refuses a code point unassigned in the +pinned version instead of passing it through. `vitaminc-normalize` (equality +and match terms) and `vitaminc-ore`'s fold (order terms) both return +`UnassignedCodePoint`, so text holding one has no term, and writing it to an +indexed column or querying with it is refused. The refusal is the same on +every path and in every language, so the transform is still a fixed +function of the text it accepts, and moving the pin is still a new label. + +Order terms fold case and accents because code-point order puts `é` after +`z`; a fixed fold approximates the first level of Unicode collation without +depending on ICU, whose sort keys change between versions. Equality on text +is not folded by default: a folded order term only produces ties, while a +folded equality term produces false matches. A case-insensitive equality is +its own domain. + +**Equality and order may take different transforms**, for example an exact +timestamp for equality and the day for order, or the same one ("locked"). +Stack's index spec carries the choice per column. Two rules bound it: + +- **A non-injective order transform needs an equality term beside it.** In + the EQL SQL, the numeric, date and timestamp `_ord`, `_ord_ope` and + `_ord_ore` domains store no `hm` and answer `=` with the order term + (`timestamp_ord_functions.sql`: `eq` is `ord_term(a) = ord_term(b)`). A + day-resolution order term there would make `=` match every row from that + day. So a lossy order transform is allowed only on a domain that also + stores an equality term and answers `=` through it, the shape `text_ord` + already has (`hm` and `op`). On the other domains the order transform is + injective: exact for numbers and dates, and for timestamps whatever + resolution the equality term would have used. +- **Labels separate domains; they do not make terms incomparable.** Terms + built with different transforms are unrelated bytes, so a probe built with + one matches nothing built with the other. Nothing in a stored term records + its label. Keeping a query on the same transforms as the column is the + index spec's job, and the EQL domain is what ties a column to its spec. + +A column's leakage is the combined leakage of all its terms. Truncating the +order term to the day hides the order of events within a day, but an exact +equality term on the same column still reveals which rows share a timestamp. + +### Which kinds get which terms + +- **Every scalar kind has a ciphertext.** Containers and null have no terms. +- **Equality:** every scalar kind except `Bool`, including floats over their + baseline bits. Stack Encrypt refused float equality until now, on the + grounds that equality on IEEE-754 values is a modelling error. The baseline + removes the two cases where bitwise equality and numeric equality disagree + (signed zero and NaN payloads), and what is left is exactly Postgres's + `float8 =`, which EQL's `real_eq` and `double_eq` domains already expose. + Whether a computed float is the value the caller meant is the caller's + problem, as it is for a plaintext float column. +- **Order:** every scalar kind except `Bool`, under all three schemes, with + one exception: block ORE for text, which waits for ore-rs's variable-length + block ORE (see Deferred). +- **`Bool` has a ciphertext only.** A keyed hash or an order term over a + domain of two values hides nothing: it splits the rows into two groups, and + an order term also says which group is `true`. Stack Encrypt stops + producing CLLW order terms for `Bool`, and `vitaminc-ore` has no `Bool` + encoding. cllw-ore keeps its `Bool` impl, so cipherstash-client and its + stored v3 terms are unaffected. + +These exceptions are an explicit, documented list kept next to vitaminc's +conformance test. The test fails for any kind that is missing from +`vitaminc-prf` or `vitaminc-ore` without an entry, and checks that values +equal under `Value` semantics produce equal terms in both. + +### Where each encoding lives + +- **Ciphertext:** `vitaminc-aead-value`. It does no term normalisation: its + `canonical` module and its dependency on `orderable-bytes` are removed. +- **Equality:** `vitaminc-prf`, which depends only on `vitaminc-aead-value`, + gains domains for every new kind, floats and `Decimal`, and applies the + baseline and its own transforms. It has no ordering dependency. The + value-derived PRF domains landed after vitaminc 0.5.1 and are unreleased, + so their bytes are still free to choose. +- **Order:** a new `vitaminc-ore` crate, released in lockstep with the other + vitaminc crates. + - It owns the order encodings (ported from `orderable-bytes`, kept in + `Protected`, pinned by golden vectors), the baseline, the order + transforms, and derivation of order terms from `&Value`. + - Its `OrderScheme` trait takes a sealed `OrderPlaintext`, fixed-length or + variable-length, that only `vitaminc-ore` can build, and returns a + scheme-defined term, roughly `type Term: Ord + AsRef<[u8]>`. Each scheme + keeps its own comparison and stored bytes. The trait also covers the key + type, domain separation (the label goes in as the salt) and typed errors. + - It depends on no scheme crate; its tests use a mock scheme. +- **Schemes:** cllw-ore (CLLW ORE and OPE) and ore-rs (block ORE) implement + `OrderScheme` behind an optional `vitaminc` feature, so cipherstash-client + takes no vitaminc dependency. Their typed APIs are unchanged and not + feature-gated. Block ORE through the trait uses each kind's natural width; + the 8-byte padding stays a detail of the typed API cipherstash-client uses. +- **`orderable-bytes` is frozen.** It stays as it is for cipherstash-client's + stored terms and is not part of the target design. +- **Term derivation** takes a `&Value` in `vitaminc-prf` and `vitaminc-ore` + and keeps leaves inside `Protected`. A pairing a layer does not support + returns a typed error from vitaminc. + +### Stack Encrypt + +- `dynamic::Value` and `dynamic::term::Scalar` are deleted. `dynamic::term` + takes any source that describes itself to vitaminc (amended 2026-10-17, + #1232: there is no `vitaminc_aead_value::Value`; a binding's value arrives + as a transport frame and stays one, `dynamic::ValueFrame`). `admits` keeps + only the rules that belong to Stack Encrypt, such as `Match` taking text + only. +- Order terms go through `vitaminc-ore`. The index for an ORE or OPE column + picks the concrete scheme (cllw-ore or ore-rs, through `OrderScheme`) and + its transforms; Stack Encrypt no longer calls cllw-ore's typed API. A block + ORE term kind joins CLLW ORE and OPE. +- `TextEq` normalises to NFC and moves to EQL v4. The Stack Encrypt targets on + `eql_v3_*` domains are deleted. The `stack-encrypt:1:` ciphertext prefix + stays: decryption does not pass through Postgres types, and the prefix is + what lets it reject the other producer's payload. + +### Host languages + +A binding picks the kind from the field's **declared EQL target**, never +from the host type. This keeps the rule `eql-bindings` already enforces: a +target accepts exactly one kind, and nothing below the binding converts. The +binding converts a host value into the target's kind when it can do so +without loss, and refuses it otherwise. + +| Kind | EQL family | | +|---|---|---| +| `Int16` | `smallint` | | +| `Int32` | `integer` | | +| `Int64` | `bigint` | | +| `Float32` | `real` | | +| `Float64` | `double` | | +| `Decimal` | `numeric` | | +| `Date` | `date` | | +| `Timestamp` | `timestamp` | | +| `String` | `text` | | +| `Bool` | `boolean` | | +| `Int8`, `UInt8`, `UInt16`, `UInt32`, `UInt64`, `Int128`, `UInt128`, `Bytes` | none | no EQL domain and no target name yet; a kind is selectable only once a target names it | + +- **Go.** Any Go integer type whose every value fits the target's kind is + accepted (`int8` into `smallint`, `int32` into `bigint`); a wider one is + range-checked and refused if the value does not fit. `int8`, `int16`, + `uint8` and `uint16` get their own kinds when a target names them; no + target does yet, so today they reach `Int16`, `Int32` or `Int64` through + the fits-losslessly rule. + *Amended 2026-10-18 (#1144):* a field with no EQL target (`encrypt`, + `index=`) has no target to pick a kind from, so Go picks it from the Go + type: each integer type is its own kind (`int8` is `Int8`, `int16` + `Int16`, `uint8` `UInt8`, `uint16` `UInt16`, `int` and `int64` `Int64`, + `uint` and `uint64` `UInt64`), and its order terms are that width's. A + field stored as an EQL target still takes the target's kind, by the rule + above. + `Int128` and `Uint128` are SDK value types. `time.Time` means `Timestamp`, + and `encrypt.Date{Year, Month, Day}` is a date. A field whose target is a + date family also accepts `time.Time` and takes its calendar day **in the + value's own location** (`t.Date()`), which is how Go code builds a date; + taking the UTC day would store the previous day for a local midnight east + of UTC. +- **JavaScript.** A `BigInt` takes the target's kind, and is refused if it + does not fit. It decodes as a `BigInt`. `Date` means `Timestamp`; a date + has its own wrapper. +- **Decimal.** A host decimal (Go's `shopspring/decimal`, a JavaScript + string) is refused if it is NaN or infinite, has more than 28 digits after + the point, or does not fit a 96-bit mantissa at its scale. Postgres + `numeric` holds values that `Decimal` cannot, and a binding refuses them + rather than rounding. +- **Every binding** runs vitaminc's shared test vectors: a host value, the + target, the kind it must map to, and the exact `[tag] ++ payload` leaf + bytes, including normalisation and refusal cases. The leaf is + deterministic even though the AEAD is not. + +### EQL v4 + +- **v4 is the v3 SQL with Stack Encrypt terms.** One SQL source is emitted + under two names. The hand-written SQL takes the schema as a build-time + placeholder, as eql-codegen's templates already do. Consistent with + ADR-0001, the data-bearing domains (`eql_v3_*`, `eql_v4_*`) live in + `public` and survive reinstall, and the implementation schemas + (`eql_v3`, `eql_v4` and their `_internal` schemas) stay disposable. The + second name separates producers; it is not a versioned upgrade mechanism of + the kind ADR-0001 rejects. +- **A v4 payload's envelope carries `"v": 4`**, and the `eql_v4_*` domains' + check constraints test it, as the `eql_v3_*` ones test `3`. The version is + one more build-time placeholder. A payload written to the other producer's + domain then fails on insert, rather than only matching nothing when it is + queried. Queries are a different matter; see Consequences. +- **New EQL targets are v4-only.** In v3 they stay refused, with a reason + that points to v4. A domain that a lossy order transform needs, with an + `hm` beside its `op`, is one of these, and is the first point where the v4 + SQL differs from the v3 SQL. +- **`@cipherstash/eql` 4.x ships both bundles** from `main`. A SQL fix lands in + both names in one release. +- **`--eql-version` comes back, on purpose.** It was removed when v3 became + the only installable generation, and the CLI now refuses it. It returns as + `--eql-version 3|4|all` on both `stash eql install` and + `stash eql migration`, so the migration-first paths (Drizzle, and Supabase + with a local `supabase/` directory, where a direct install does not survive + `supabase db reset`) can install v4 too. The migration they write carries + the chosen bundles, and `--supabase` grants on each bundle's schemas. The + default is 3, which is today's behaviour, and changes to 4, announced in + advance, when the TypeScript stack has moved to Stack Encrypt. `2` keeps + its current message pointing at the EQL 2.3.1 release, rather than + becoming an ordinary invalid value. +- **During the overlap**, expected to last a quarter or more, cipherstash-client + takes fixes only. New kinds and domains are produced through Stack Encrypt + and v4. An exception is a decision written down in its issue. + +### Review + +A domain that locks equality and order together derives both from the same +transformed bytes, and that choice is frozen once data is stored under it. +Dan Draper signs off each such domain in writing before it ships. Domains +whose equality and order transforms are independent need no such sign-off. + +## Exhaustive handling of kinds + +`vitaminc-prf`, `vitaminc-ore` and every binding must handle every kind of +value, and adding a kind should fail to build until each one does. This was +left open between dropping `#[non_exhaustive]` (A) and a visitor trait with +one required method per kind (B). + +*Settled 2026-10-18 by vitaminc 0.6's design.* There is no value enum to +match. A sink receives each scalar as a physical value and an optional +logical type. The physical enums (`Physical`, `Int`, `Float`) are exhaustive, +so a new physical kind fails to build in every sink that matches them, which +is A for the bytes a value is made of. `Logical` is `#[non_exhaustive]`, so a +new logical type (a date, a timestamp) is additive, and a sink that does not +know it refuses it at run time. Stack Encrypt's `ValueKind` is exhaustive. +The conformance test stays the backstop for the logical types a sink reaches +through a wildcard. + +## Consequences + +- **The release order is fixed.** vitaminc 0.6.0 first, then cllw-ore and + ore-rs (additive releases implementing `OrderScheme`), then the Stack + Encrypt breaking release. Stack Encrypt must reach crates.io before + `eql-bindings` uses its new API, since `cargo publish` builds + `eql-bindings` against the registry. The EQL v4 bundle and the Go SDK + changes follow. +- **Adding a kind later** takes a tag, PRF and order encodings, a codec in + every binding, test vectors and a row in the kind-to-family table, or an + entry in the exceptions list. A new physical kind is a breaking change for + every sink. A new logical type is not. +- **Stack Encrypt's terms change** for `-0.0` and negative-sign NaN floats, + for non-NFC text equality, for `Bool` order terms, which are removed, and + for every text order term: `orderize_string` drops symbols and keeps case, + while the fold keeps symbols and folds case. None is deployed, so the + breaking release carries them without migration. +- **cipherstash-client's terms do not change.** `orderable-bytes`, cllw-ore's + typed impls (`Bool` included) and its block ORE padding are all kept, so + every stored v3 payload stays queryable. +- **Separate names do not stop a cross-producer comparison in SQL.** EQL's + domains are over `jsonb`, and when no operator is defined for an exact pair + of types, Postgres treats a domain as its base type. `v3col = v4term` then + runs as the built-in `jsonb = jsonb` and returns no rows, silently, as + `eql_v3_text_eq = eql_v3.query_integer_eq` already does within v3. A join + between a v3 and a v4 column does the same, and + `eql_v3.eq_term(v3col) = eql_v4.eq_term(v4term)` compares the two terms as + text. Three things do fail loudly: an insert of the wrong version (the + domain check), the function form `eql_v3.eq(v3col, v4term)` ("not unique"), + and `OPERATOR(public.=)` between a v3 and a v4 column ("not unique"). + Verified on Postgres 17 with both bundles installed in one database. +- **Tooling that recognises encrypted columns by the `eql_v3_` prefix must + learn `eql_v4_` before any v4 column can exist.** Today that is + `stash init`'s introspection (`cli/src/commands/init/lib/introspect.ts`), + the wizard's tools (`wizard/src/tools/wizard-tools.ts`) and + `classifyEqlDomain` (`migrate/src/version.ts`), which `stash status` and + `stash encrypt status` use. Getting this wrong shows an encrypted column as + plaintext, which invites encrypting it a second time. The installer's + ADR-0001 capture, rebuild and verify logic hard-codes the disposable + schemas as `('eql_v3', 'eql_v3_internal')` + (`installer/derived-search-index-restoration.ts`, + `installer/installation-state.ts`); without `eql_v4` and + `eql_v4_internal` there, a v4 reinstall would capture and restore none of + its own indexes. Both land with the first released v4 bundle. +- **The release tooling assumes one bundle.** The lockstep stamp is read from + `COMMENT ON SCHEMA eql_v3` (`scripts/sync-lockstep-versions.mjs`, + `packages/eql/tasks/release/prepare-bindings-assets.sh`); there is one + `release-manifest.json` per artefact, which the CLI's `bundle-digest.ts` + and `eql-sql-asset-freshness.test.mjs` check; `eql_bindings::sql` embeds + only the v3 files; and `_build-eql-sql.yml` uploads only them. The v4 + bundle needs its own stamp, manifest entries, freshness check, crate + constants and release upload before it ships, or v4 drift goes unnoticed + with every digest still verifying. The `postgres-eql` image states which + bundles it installs. +- **Moving a column from v3 to v4 means re-encrypting it.** The ciphertext and + every term change. How that migration runs belongs to the decision that + moves the TypeScript stack onto Stack Encrypt. +- **The CLI surface changes** (`--eql-version` on `stash eql install` and + `stash eql migration`), so `skills/stash-cli`, `skills/stash-indexing` and + `skills/stash-postgres` change in the same PR. +- **This replaces a definition in a plan.** `docs/plans/2026-10-04-plan-builder.md` + called "EQL v4" a name for a Stack Encrypt payload in the v3 envelope and + the `eql_v3_*` domains. That plan is updated to this ADR. + +## Deferred + +- **Block ORE for text** waits for ore-rs's chained, variable-length block ORE + to be reviewed and released, then arrives in a minor release of + `vitaminc-ore`. Until then it is an entry in the exceptions list. +- **Block ORE for `Bool`.** Block ORE stored as right ciphertexts only is + fully randomised and semantically secure, so a two-value domain leaks + nothing through it. `Bool` could support that scheme alone, enforced by a + marker trait on schemes. Not built until needed. +- **Cross-version blocker operators.** Blockers for every v3/v4 pair of the + same type family and capability would turn the silent cross-producer `=` + into an error. About 2,300 operators, generated from the catalog like the + existing blockers. Not built yet; until then, a cross-producer query is + caught only by typed clients, the function form and `OPERATOR(public.=)`; + the plain `=` returns no rows. When they are built, + **the v4 bundle owns them**: it creates them in `eql_v4_internal`, against + whichever `public.eql_v3_*` domains exist, on every install. A v4 reinstall + drops them with its schema and creates them again. A v3 reinstall leaves + them alone, because they depend only on the `public` domains, which + survive, and not on anything in `eql_v3`. Installing v3 after v4 into a + database that had no v3 domains leaves them absent until v4 is reinstalled, + so `--eql-version all` installs v3 first. +- **Locale-aware collation**, as its own domain with the collation version in + its name. +- **ASCII-packed text domains**, until a customer's column sizes make the + case. diff --git a/docs/plans/2026-10-04-plan-builder.md b/docs/plans/2026-10-04-plan-builder.md index 88dd628fb..5037c67ad 100644 --- a/docs/plans/2026-10-04-plan-builder.md +++ b/docs/plans/2026-10-04-plan-builder.md @@ -662,9 +662,11 @@ In the `Text` family, the three `Ord` suffixes carry equality too. Each type has a query type, with `Query` after its name: `TextEqQuery`. The value of `encrypt_into` is the Go type name. -An EQL value has the EQL v3 envelope: its version field is `3`, and Postgres stores it in an `eql_v3` domain. +Once EQL v4 lands, an EQL value from the engine is an EQL v4 value: its version field is `4`, and Postgres stores it in an `eql_v4_*` domain. The ciphertext inside it is a Stack Encrypt ciphertext, which starts with `stack-encrypt:1:`. -"EQL v4" in this plan is the name of that form, and not a new envelope. +EQL v4 is the v3 SQL, emitted from the same source under a second name, so that a column written by Stack Encrypt and one written by cipherstash-client are different Postgres types ([ADR-0002](../adr/0002-one-value-model-three-encodings-and-eql-v4-by-producer.md)). +This replaces this plan's first definition, under which "EQL v4" named a Stack Encrypt payload in the v3 envelope and an `eql_v3` domain; Postgres could not tell the two producers apart, and a query from one against a column written by the other matched nothing. +The `TextEq` described below is still produced into an `eql_v3` domain until that move lands. The engine produces one EQL type today: `TextEq`. Status (2026-10-06, #1062): `TextEq` is producible through the data plan's target form. @@ -1157,9 +1159,10 @@ model rather than a strain: it puts key material in the database. ## EQL v4 types as field targets -Naming: **EQL v4** is the EQL form of a stack-encrypt payload. **EQL v3** is -the existing SQL bundle and its `eql_v3_*` domains, which this section does -not change. Depends on #971 (`TextEq` / `TextEqQuery` through stack-encrypt +Naming: **EQL v4** is the EQL form of a stack-encrypt payload: the v3 SQL +emitted under a second name, with `eql_v4_*` domains and `"v": 4` envelopes +(ADR-0002). **EQL v3** is the same SQL holding cipherstash-client payloads in +its `eql_v3_*` domains, which this section does not change. Depends on #971 (`TextEq` / `TextEqQuery` through stack-encrypt in `eql-bindings`, and `Identifier` as a two-segment `Label`). **The engine returns an EQL type only when a plan names it as a target.** diff --git a/docs/plans/2026-10-11-order-and-equality-terms-layering.md b/docs/plans/2026-10-11-order-and-equality-terms-layering.md new file mode 100644 index 000000000..aacd27a2d --- /dev/null +++ b/docs/plans/2026-10-11-order-and-equality-terms-layering.md @@ -0,0 +1,343 @@ +# Order and equality terms: vitaminc at the bottom + +> **Plan, not specification.** This document is an indicative sketch of the +> steps required, written before the work was done. It is not kept in step +> with the implementation and must not be used as a formal specification or +> as a reference for reviewing what was actually built: the code, its rustdoc +> and the tests are the source of truth. Where the two disagree, the code wins +> and this document is simply out of date. + +**Status:** planned. Decisions settled 2026-10-11, except the one listed +under "Open decision". +**Date:** 2026-10-11 +**Amends:** ADR-0002 (`docs/adr/0002-one-value-model-three-encodings-and-eql-v4-by-producer.md`). +The decisions below were folded into the ADR on 2026-10-12, and the ADR is +now the reference for them. This plan keeps the steps. +**Issues:** cipherstash/vitaminc#374 (`vitaminc-ore`), #1063 (index crates) + +## Why + +Starting on cipherstash/vitaminc#374 under ADR-0002 turned up four problems. + +- **Too many dependencies across repositories.** `vitaminc-ore` was to depend + on cllw-ore and ore-rs and adapt each to its `Scheme` trait, with + `orderable-bytes` underneath both. Order encodings, scheme traits and term + derivation ended up spread over three repositories, and every change needed + releases in all of them. +- **Raw bytes reach the schemes.** cllw-ore and ore-rs accept bytes that the + caller has already encoded. Bytes encoded by hand (little-endian integers, + an unflipped sign bit, `f64::to_bits`) encrypt without error and sort + wrong. Fixing that inside cllw-ore needed wrapper types in `orderable-bytes` + (cipherstash/ore.rs#103) and a feature split in cllw-ore + (cipherstash/cipherstash-suite#2308). Cargo features unify across a build, + so the feature split could not hold whenever anything else in the build + turned the feature on. +- **PRF depends on ordering.** `vitaminc-prf` reaches `orderable-bytes` + through `vitaminc-aead-value`'s `canonical` module, which reuses order + encodings as equality input. Equality needs a canonical form, not an order. +- **One canonical form for both term kinds is too rigid.** ADR-0002 builds + equality and order terms from the same canonical form. A leakage-tuned + domain needs them to differ, for example an exact timestamp for equality + and only the day for order. + +## Decisions + +### vitaminc is the bottom of the stack + +- `vitaminc-ore` owns: + - the order encodings; + - an `OrderScheme` trait; + - the derivation of order terms from `&Value`, generic over the scheme. + + It depends on no scheme crate. +- A scheme's input is a sealed type, `OrderPlaintext`, that only + `vitaminc-ore` can construct. It comes in fixed-length and variable-length + forms. A scheme can't be given bytes that skipped the encoding, so no + wrapper types or feature flags are needed to keep raw input out. +- `OrderScheme` returns a scheme-defined term, roughly + `type Term: Ord + AsRef<[u8]>`, whose length is only known at runtime. Each + scheme keeps its own comparison (CLLW ORE and block ORE don't compare byte + by byte) and its own stored bytes. Fixed-width types such as + `OreCllw8V1` stay as inherent APIs on the scheme crates, because stable + Rust can't name their width generically. +- The trait also covers the key type, domain separation (the term's domain + label goes in as the salt) and typed errors. +- cllw-ore and ore-rs depend on `vitaminc-ore` and implement `OrderScheme` + behind an optional `vitaminc` feature, so cipherstash-client doesn't take a + vitaminc dependency. Their existing typed APIs stay as they are, so + cipherstash-client's stored terms don't change. +- `vitaminc-ore` releases in lockstep with the other vitaminc crates. On each + vitaminc minor release, cllw-ore and ore-rs bump their optional + `vitaminc-ore` dependency before stack can upgrade. That is acceptable + while stack is the only user of the trait path. +- `vitaminc-ore`'s tests use a mock scheme defined inside the crate. A + dev-dependency on cllw-ore would form a cycle across repositories and pull + a second `vitaminc-ore` in from crates.io. + +### Equality and order are tuned per domain + +- There is no shared canonical form. Each kind has a **semantic baseline**, + which makes values that are equal under `Value`'s own semantics encode the + same: decimal scale (`1.0` = `1.00`), signed zero, NaN, NFC. +- On top of the baseline, each term's domain chooses its own **lossy + transforms**, such as timestamp resolution (exact, microsecond, day), + text folding (removing combining marks, case folding, with the Unicode + version pinned) and prefix truncation. +- Each transform is named in its term's domain label, for example + `…/timestamp/day/v1`, so terms built with different transforms are + domain-separated: a probe built with one matches nothing built with the + other. A stored term does not record its label, so they are not made + incomparable. Keeping a query on the column's transforms is the index + spec's job. +- Equality and order can be **independent** (an exact timestamp for + equality, the day for order) or **locked** (the same transform value + passed to both). Stack's index spec (#1063) carries the choice per column. +- A **lossy order transform needs an equality term beside it.** EQL's + numeric, date and timestamp `_ord` domains store no `hm` and answer `=` + with the order term, so a day-resolution order term there would make `=` + match every row from that day. A non-injective order transform is allowed + only on a domain that stores an equality term and answers `=` through it, + as `text_ord` does. Those domains are new, v4-only EQL targets. +- The semantic baseline lives in each term crate: `vitaminc-prf` and + `vitaminc-ore` each apply it. A conformance test checks that values equal + under `Value` semantics produce equal terms in both. There is no shared + canonicalisation crate. +- A column's leakage is the combined leakage of all its terms. Truncating the + order term to the day hides the order of events within a day, but an exact + equality term on the same column still reveals which rows share a + timestamp. Domain design must account for the combination. + +### PRF has no ordering dependency + +- `vitaminc-prf` depends only on `vitaminc-aead-value` and applies its own + baseline and transforms. +- `vitaminc-aead-value` does no term normalisation. Its `canonical` module and + its dependency on `orderable-bytes` are removed. +- The value-derived PRF domains (cipherstash/vitaminc#380) haven't been + released: they landed on 2026-10-08, after vitaminc 0.5.1. So `vitaminc-prf` + can choose its own canonical bytes for dates, timestamps and decimals + without affecting any stored term. + +### `orderable-bytes` is frozen + +- `orderable-bytes` stays as it is for cipherstash-client's stored terms. It + is not part of the target design. +- There is no 0.3. cipherstash/ore.rs#103 (binary wrapper types) is closed. +- 0.2.0 is not yanked: ore-rs 0.8.4 depends on it and nothing new needs it + gone. + +## Open decision: exhaustive matching over `Value` + +Once `canonical.rs` leaves `vitaminc-aead-value`, `vitaminc-prf` and +`vitaminc-ore` must each handle every kind of `Value`, and adding a kind must +fail to compile until each one does. Two approaches are on the table. + +### Prerequisite for either approach: variants that exist in every build + +`Value::Date` and `Value::Timestamp` exist only with `vitaminc-aead-value`'s +`chrono` feature, and `Value::Decimal` only with its `rust_decimal` feature. +Because features unify across a build, an exhaustive match outside +`vitaminc-aead-value` breaks: + +1. `vitaminc-prf` matches `Value` exhaustively, with its `Date` arm behind its + own `chrono` feature. +2. In a build where another crate turns on `vitaminc-aead-value/chrono` and + `vitaminc-prf`'s `chrono` is off, `Value::Date` exists and `vitaminc-prf` + has no arm for it. `vitaminc-prf` fails to compile in that build. + +A visitor fails the same way: a required `visit_date` that exists only with +`chrono` is a method an implementor can't know whether to write. A crate can +check its own features, never a dependency's. Today's design avoids this only +because the match sits inside `vitaminc-aead-value`, which checks its own +features. + +The fix is to make every variant exist in every build, using vitaminc's own +representation, with conversions to and from chrono and rust_decimal behind +the features: + +| Variant | Representation | +|---|---| +| `Date` | days from the start of the common era, `i32` | +| `Timestamp` | Unix seconds `i64`, nanoseconds `u32` | +| `Decimal` | mantissa and scale | + +The ciphertext wire format already uses these payloads (tags `0x12`–`0x14` +are independent of chrono), so stored ciphertexts don't change. The Rust +types do, which is a breaking change to `Value`. + +### The two approaches + +**A: drop `#[non_exhaustive]`.** `vitaminc-prf`, `vitaminc-ore` and the +bindings match `Value` exhaustively in their own crates. + +**B: a visitor trait, keeping `#[non_exhaustive]`.** `vitaminc-aead-value` +defines a `ValueVisitor` with one required method per kind and does the +dispatch. Crates that must handle every kind implement it. Other crates keep +matching with a `_ =>` arm. + +| | A: drop `#[non_exhaustive]` | B: visitor, keep `#[non_exhaustive]` | +|---|---|---| +| Who gets exhaustiveness | Every crate that matches `Value` | Crates that implement the visitor | +| Adding a kind | Breaking for every crate that matches | Breaking for visitor implementors, additive for others | +| Code to maintain | Nothing new | One trait, one dispatch function, a method per kind in each implementor | +| Grouping | Each match writes out every integer width | The trait can offer grouped hooks, such as one integer method that the per-width methods default to | +| Changing `Value`'s representation | Breaks every match | Hidden behind the method signatures | +| Main risk | Low | A default on a per-kind method lets a new kind compile without being handled. Per-kind methods need no defaults; only grouping hooks may have them. | + +**Evidence:** +- Outside `vitaminc-aead-value`, `Value` is matched in `vitaminc-prf` (through + `canonical`), in `aead-napi`'s `convert.rs` and `scalar.rs`, and in the hmac + tests. +- `aead-napi` already has `_ => Err("unsupported value kind")` + (`convert.rs`). That is the silent refusal `#[non_exhaustive]` invites. +- ADR-0002 requires every binding to handle every kind, so the bindings want + exhaustiveness as well. +- Under A they get it automatically. Under B each binding opts in by + implementing the visitor. + +**Leaning:** B. The decision waits on a closer look at the `Value` enum's +design, which may change the representation in ways that favour one +approach. + +## Current state + +Arrows point from a crate to what it depends on. cipherstash-client and +`vitaminc-protected` are left out. + +```mermaid +flowchart TB + subgraph stack + SE[stack-encrypt] + end + subgraph suite["cipherstash-suite"] + CLLW["cllw-ore 0.5
typed impls, own encodings"] + end + subgraph vitaminc + PRF[vitaminc-prf] + AV["vitaminc-aead-value
Value, canonical module"] + end + subgraph orers["ore.rs"] + ORERS["ore-rs 0.8"] + OB["orderable-bytes"] + end + SE --> PRF + SE --> AV + SE --> CLLW + PRF -- "canonical feature" --> AV + AV -- "git pin, pre-0.2" --> OB + CLLW -- "0.1, chrono and decimal" --> OB + ORERS -- "0.2" --> OB +``` + +- stack-encrypt calls cllw-ore directly for order terms. There is no block + ORE path. +- Equality bytes for dates, timestamps and decimals come from order + encodings, through `vitaminc-aead-value`. +- `orderable-bytes` is reached three ways, at three different versions. + +## Target state + +```mermaid +flowchart TB + subgraph stack + EQI["Equality index
picks transforms"] + ORI["Ore / Ope index
picks scheme and transforms"] + end + subgraph schemes["scheme crates"] + ORERS["ore-rs
block ORE"] + CLLW["cllw-ore
CLLW ORE and OPE"] + end + subgraph vitaminc + PRF["vitaminc-prf
equality terms, own baseline and transforms"] + VORE["vitaminc-ore
order encodings, transforms,
OrderScheme, sealed OrderPlaintext"] + AV["vitaminc-aead-value
Value"] + end + EQI --> PRF + ORI --> VORE + ORI --> ORERS + ORI --> CLLW + ORERS -- "impl OrderScheme" --> VORE + CLLW -- "impl OrderScheme" --> VORE + PRF --> AV + VORE --> AV +``` + +- vitaminc depends on nothing in the other repositories. +- The scheme crates implement `vitaminc-ore`'s trait. The index crates choose + a concrete scheme and the transforms for each column. +- `orderable-bytes` doesn't appear. It stays frozen for cipherstash-client. + +## Changes to ADR-0002 + +These have been made in the ADR itself. + +| ADR-0002 says | Now | +|---|---| +| "Equality and order terms are computed from one canonical form per kind, and both layers use the same one" | Each kind has a semantic baseline; lossy transforms are chosen per domain, independently or locked | +| Canonical forms table: timestamp truncated to microseconds, text order folded | These become per-domain transforms, named in each domain's label | +| Order: "The plaintext layer is `orderable-bytes`, which … gains a variable-length encoding" | `vitaminc-ore` owns the order encodings; `orderable-bytes` is frozen | +| "A `Scheme` trait, with block ORE (over ore-rs), CLLW ORE and CLLW OPE (over cllw-ore)" | `OrderScheme` lives in `vitaminc-ore`; ore-rs and cllw-ore implement it | +| "cllw-ore keeps its typed impls … behind a cargo feature that cipherstash-client enables, and gains a bytes-level entry point" | cllw-ore's typed API is unchanged and not feature-gated; it gains an `OrderScheme` impl behind an optional `vitaminc` feature | +| Review: "Using the canonical order bytes as the PRF input … Dan Draper signs it off" | PRF no longer uses order bytes; the review item applies only to domains that lock equality and order together | +| `Value` and `ValueKind` become `#[non_exhaustive]` | Open: see "Open decision" | +| Release order: "ore.rs (`orderable-bytes`) and cllw-ore first, then vitaminc 0.6.0" | vitaminc first, then cllw-ore and ore-rs, then stack | + +## Steps + +### Phase 1: tidy up work in flight + +1. Close cipherstash/ore.rs#103. Don't yank `orderable-bytes` 0.2.0. +2. Cut cipherstash/cipherstash-suite#2308 down to its first two commits: + known-answer tests that pin every cllw-ore encrypt path, and wiping the + plaintext bit buffer in `encrypt_ope_bits`. It becomes a cllw-ore patch + release. The known-answer tests then protect cipherstash-client's terms + through the rest of this work. + +### Phase 2: vitaminc + +3. Settle the open decision. If the `Value` changes are accepted, make every + variant exist in every build. +4. `vitaminc-aead-value` and `vitaminc-prf`: + - add the chosen exhaustiveness mechanism; + - remove `canonical.rs` and the `orderable-bytes` dependency from + `vitaminc-aead-value`; + - move the equality baseline and transforms into `vitaminc-prf`, with each + transform named in its domain label. +5. New crate `vitaminc-ore` (rewrite cipherstash/vitaminc#374 to match): + - `OrderScheme` and the sealed `OrderPlaintext`; + - order encodings ported from `orderable-bytes`, kept in `Protected`, + pinned by golden vectors, and checked against `orderable-bytes` where + they match byte for byte; + - per-domain transforms: timestamp resolution, text folding with a pinned + Unicode version, room for prefix truncation; + - order-term derivation from `&Value`, generic over the scheme; + - a mock scheme for tests; + - docs that state the combined-leakage rule. +6. A conformance test across `vitaminc-prf` and `vitaminc-ore`: every kind is + handled or listed as an exception, and values equal under `Value` + semantics produce equal terms. +7. Release vitaminc 0.6.0. + +### Phase 3: scheme crates + +8. cllw-ore: implement `OrderScheme` behind an optional `vitaminc` feature, + with known-answer tests for the trait path. This is an additive release. +9. ore-rs: the same. Block ORE uses each kind's natural width; + cipherstash-client keeps its 8-byte padding through the existing API. + Block ORE for text waits for cipherstash/ore.rs#95 and goes on the + exceptions list. +10. Release both. + +### Phase 4: stack + +11. Index crates (#1063): each index spec carries its scheme and transforms. + The Equality index calls `vitaminc-prf`; the Ore and Ope index builds the + concrete scheme and calls `vitaminc-ore`. stack-encrypt drops its direct + use of cllw-ore. +12. EQL v4 domain labels name their transforms. + +### Later + +- Block ORE for text, once cipherstash/ore.rs#95 is released. +- Retire cllw-ore's typed impls and `orderable-bytes` once cipherstash-client + is retired. diff --git a/languages/golang/CHANGELOG.md b/languages/golang/CHANGELOG.md new file mode 100644 index 000000000..2a78111e1 --- /dev/null +++ b/languages/golang/CHANGELOG.md @@ -0,0 +1,170 @@ +# Changelog + +Changes to the Go module `github.com/cipherstash/stack/languages/golang`: +the SDK (`encrypt`), the generator (`stashgen`, `cmd/stashgen`) and the +credential package (`auth`). + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +The module is pre-1.0, so a minor version may break the API; every break is +listed under **Breaking**. Releases are tagged `languages/golang/vX.Y.Z`. + +## [Unreleased] + +### Breaking + +- **An `int8`, `int16`, `uint8` or `uint16` sealed field seals at its own + width; run stashgen again.** It used to seal as a 32-bit integer. Values + stored before do not decrypt under the regenerated declaration: the + engine checks the stored leaf's kind against the declared one and + refuses an int32 leaf for an `int16` field. Equality terms are the same + at every width, order terms are not. To keep reading stored values, + declare the field `int32` or `uint32` (or re-encrypt them). +- **Run stashgen again.** A field's query methods are now one per operator + the engine answers on it (`Eq`, `Lt`, `Lte`, `Gt`, `Gte`, `Between`, + `Matches`), in place of one per index (`Equality`, `Match`, `Ore`, `Ope`, + `Query`, `JSON`). A file generated by the alpha's stashgen no longer + compiles against this library. +- **`Cipher.Query` and `Cipher.Derive` are gone**, with the guest's + `se_query` export. Generated methods derive terms through + `Cipher.QueryTerm`, named by operator. +- **`gensupport.Field`** loses `Equality`, `Match`, `Ore`, `Ope`, `Query` and + `JSON`, and gains `Term` and `Range`; `gensupport.Matches` and + `gensupport.EQLMatches` derive match queries. +- **`stashgen.Engine.Check` returns the operators each field answers**: + `Check(ctx, d) (map[string][]stashgen.Operator, error)`. An engine + implemented outside this module (a wrapper, or a fake in a generator's + tests) changes its `Check` to return them; `enginetest.Static` shows the + table. +- **An `int8`, `uint8` or `byte` field takes no `ore` or `ope` index; drop + the index and run stashgen again.** With 256 values, an order term ranks + every row among 256, which a few known rows resolve to the values, the + leak a `bool`'s order term is already refused for. The engine refuses the + declaration as it refuses one on a `bool`, so stashgen stops at it. The + field keeps `equality` and `Eq`; a value that must order declares a wider + type. +- **Every ORE and OPE term changes bytes; encrypt indexed rows again.** + Order terms now encrypt through cllw-ore's vitaminc schemes, for every + type: integers of every width, floats, text and bytes. A term v0.1.0-alpha.1 + stored does not compare with one this release derives, and nothing + refuses it: `Lt`, `Between` or an `ORDER BY` over a column holding the + alpha's terms silently misses or misplaces rows. Re-derive a column's + order terms (encrypt its rows again) before querying it. + +### Added + +- **The date, timestamp and numeric EQL v4 types are producible** (#1130): + `Date` and `DateEq` from an `encrypt.Date`, `Timestamp` and `TimestampEq` + from a `time.Time`, and `Numeric` and `NumericEq` from an + `encrypt.Decimal`, with `encrypt_into=`. The `Eq` types answer `Eq`: + `NumericEq` normalises the scale (`1.5 = 1.50`) and `TimestampEq` compares + to the microsecond (truncated, never rounded), while each value opens as it was sealed. A + `time.Time` seals its instant and opens in UTC. Their `Ord`, `OrdOpe` and + `OrdOre` types stay unproducible until the engine derives order terms + for these kinds (#1236). +- **Every integer width, 128-bit integers, dates, timestamps and decimals + as sealed fields** (#1144). Each integer type seals at its own width + (`int8` as an int8, `uint16` as a uint16), so `record.Kind` and + `gensupport` gain `Int8`, `Int16`, `Int128`, `Uint8`, `Uint16`, + `Uint128`, `Decimal`, `Date` and `Timestamp`. A `time.Time` field seals + as a timestamp and opens in UTC. `encrypt.Date`, `Int128`, `Uint128` and + `Decimal` are vitaminc's `vcvalue` types, with `encrypt.DateOf`, + `ParseInt128`, `ParseUint128` and `ParseDecimal` (which refuses NaN and + the infinities with `ErrNonFiniteDecimal`). Equality applies to all of + them, ORE and OPE to every integer width but 8 bits. stashgen refuses an + order index on a decimal, date or timestamp, naming #1236. The value-kinds fixture + test opens a record the Rust lowering sealed and derives the same terms. +- **Any built-in Go integer field takes an integer EQL type** (ADR-0002): + an `int16` or a `uint16` into `Integer`, an `int` into `Bigint`. The + field is sealed at the type's width and opens back into the field's + type. A type wider than the EQL type (an `int64` into `Integer`) is range + checked value by value, and `Encrypt` refuses a value that does not fit + with `ErrEncoding`. `encrypt.Int128` and `Uint128` are not converted. +- **Range query types in `encrypt/eql`**, one per ordered family and order + index: `eql.IntegerRangeOreQuery`, `eql.IntegerRangeOpeQuery`, + `eql.TextRangeOreQuery`, `eql.TextRangeOpeQuery`, and the same for + `smallint`, `bigint`, `date`, `timestamp`, `numeric`, `real` and `double`. + Each holds both bounds of one `BETWEEN` (each bound the single-bound + domain's `ob` or `op` value, in a `{v, i, lo, hi}` envelope) as the JSON + value `eql_v4.between(column, $1::eql_v4.query__range_)` + takes, so a range binds as one parameter. The cast to the exact range + domain is required, or the statement fails with SQLSTATE 42725. Each type + implements `driver.Valuer`, `sql.Scanner` and JSON like the other query + types. They are not in + `eql.Types`, which lists stored types, and no generated method returns one + yet: the ordered EQL types are not producible. +- **`encrypt.MatchQuery` and `encrypt.EQLMatchQuery`**: what a `Matches` + method returns. Each carries the term or EQL query value to bind, + `Verify` (check decrypted rows, since a match can return false positives) + and `TargetLimit` (size the fetch). A `TextMatch` field gets `Matches`, + returning an `EQLMatchQuery`. Neither prints its query text, through any + fmt verb, reflection or slog. The zero value of either returns + `ErrEncoding` from every method, `Value` included, so it never binds as + NULL. +- **`encrypt.Range`**: what `Between` returns, the low and high bound's + terms. +- **`IntegerEq`, `BigintEq`, `RealEq` and `DoubleEq`**: an `int32`, `int64`, + `float32` or `float64` field tagged `encrypt_into=` one of them gets `Eq`. + `=` compares as PostgreSQL compares the plain types: an integer has one + term whatever its width, and for floats `-0.0 = 0.0` and `NaN = NaN`. +- **`Smallint` and `SmallintEq`**: an `int16` field (or any Go integer + type, range checked as for `Integer`) tagged `encrypt_into=` one of them + seals at 16 bits; `SmallintEq` gets `Eq`, with the same equality term as + an integer of the same value under the same column. +- **`IntegerOrd`, `SmallintOrd`, `BigintOrd`, `RealOrd`, `DoubleOrd`, + `TextOrd` and their `OrdOpe` twins**: a field tagged `encrypt_into=` one of them gets `Lt`, + `Lte`, `Gt` and `Gte`, and a text one `Eq` too. They store an OPE term + that orders by ADR-0002's order key: floats as PostgreSQL's `float8` + sorts them, text by its fold. No `Between` yet: it needs EQL v4's range + query domains. +- **Ordering methods on text.** A string field with `index=ore` or + `index=ope` gets `Lt`, `Lte`, `Gt`, `Gte` and `Between`. Text orders by its + folded form (ADR-0002: case and accents folded, under Unicode 16), so + `Café` and `cafe` tie and `alice` orders before `Zoe`. +- **Ordering methods on floats.** A `float32` or `float64` field with + `index=ore` or `index=ope` gets `Lt`, `Lte`, `Gt`, `Gte` and `Between`. + Floats order as PostgreSQL's `float8` does (ADR-0002): `-0.0` ties `0.0`, + and every NaN is one value, above `+Inf`. A `float32` orders as the + `float64` it widens to. +- **stashgen notices an index no generated method queries**: an `ore` or + `ope` index on bytes (the engine answers the orderings over integers, + floats and text only), or the second of two order indexes on a field. + The index is still stored; the notice is on stderr and in the file. + +### Changed + +- **A call whose context ends fails on its own and leaves the client + open.** A cancelled or timed-out call used to close the `encrypt.Client`, + or the `auth` profile behind its strategy, for every later caller, and a + request whose deadline passed while it waited for the client closed it + before running. Now a call waiting for the client leaves the queue with + the context's error; a ZeroKMS request in flight is cancelled, and the + error matches both the context's error and `ErrTransport`; a device + session's refresh in flight finishes in the background, for up to 10 + seconds, so a rotated refresh token is never lost; and the client stays + open. A client or profile still closes itself (`ErrState`) when the + guest traps, or when a call runs on for 30 seconds after its context + ended. +- **A call no longer holds the client across a ZeroKMS round trip.** The + guest returns each ZeroKMS request to the client instead of performing it + through a blocking host import (`transport_send` is gone; the guest's one + import is `token_get`). The client performs the request with its lock + free, so other callers run meanwhile, then resumes the call. A call whose + context ends between those steps returns the context's error, matching + `ErrTransport` too, and the guest drops the paused call, wiping what it + held; the client stays open. + The token is fetched once per call, before its first step and outside + the lock. That includes a call the guest answers from its cache (a query + term on a loaded keyset, a cached keyset lookup), which never asked for + a token before, so a token source sees one request per such call; one + that fails is still reported only when the guest needs the token. At + most 64 calls that can reach ZeroKMS are in progress at once (the + guest's cap on paused calls); one past that waits for another to finish, + as it waited for the client before. This is the step loop an + edge runtime's host needs, where `fetch` cannot block. +- **stashgen refuses a match index on an index-only field** + (`stash:"name,index=match"` with no `encrypt`). A match query's rows are + checked by decrypting them, and such a field stores no ciphertext. +- A query with a nil cipher returns `ErrEncoding` from generated code as from + the library. +- stashgen's refusal of an EQL type it cannot produce names the issue that + tracks the blocker, in place of telling you to wait for vitaminc 0.6. diff --git a/languages/golang/auth/cancel_test.go b/languages/golang/auth/cancel_test.go new file mode 100644 index 000000000..1dda26166 --- /dev/null +++ b/languages/golang/auth/cancel_test.go @@ -0,0 +1,303 @@ +package auth + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "sync" + "sync/atomic" + "testing" + "time" + + "github.com/cipherstash/stack/languages/golang/internal/guest" + "github.com/tetratelabs/wazero/api" +) + +// A profile serves every strategy, and through them every encrypt client, +// in a process: a request cancelled while its token is fetched must fail +// on its own and leave the profile open for the next. + +// tokenServer answers the access-key exchange, holding each request until +// the client gives up while hold is set. +func tokenServer(t *testing.T, hold *atomic.Bool) *httptest.Server { + t.Helper() + var jwt string + // The server notices a client that hung up a moment after the client + // has gone: it reads the closed connection on a goroutine of its own. + // So the test's end waits for each held request to see its + // cancellation, for a bounded time, before the server is closed (which + // would end the request's context itself and hide a request the client + // never cancelled). + var held sync.WaitGroup + done := make(chan struct{}) + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if hold.Load() { + held.Add(1) + defer held.Done() + // The server notices a client that hung up only once the body + // is read. + _, _ = io.Copy(io.Discard, r.Body) + select { + case <-r.Context().Done(): + return + case <-done: + } + select { + case <-r.Context().Done(): + case <-time.After(5 * time.Second): + t.Error("a held request was never cancelled") + } + return + } + fmt.Fprintf(w, `{"accessToken":%q,"expiry":%d}`, jwt, time.Now().Add(time.Hour).Unix()) + })) + t.Cleanup(server.Close) + t.Cleanup(func() { + close(done) + held.Wait() + }) + jwt = testJWT(t, server.URL) + return server +} + +func TestATokenFetchCancelledFailsOnlyItself(t *testing.T) { + guestOrSkip(t) + var hold atomic.Bool + server := tokenServer(t, &hold) + profile, err := Open(context.Background(), t.TempDir()) + if err != nil { + t.Fatal(err) + } + defer profile.Close() + strategy, err := profile.AccessKey(context.Background(), testCRN, "CSAKtestKeyId.testKeySecret", WithBaseURL(server.URL)) + if err != nil { + t.Fatal(err) + } + defer strategy.Close() + + hold.Store(true) + ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond) + defer cancel() + if _, err := strategy.Token(ctx); !errors.Is(err, context.DeadlineExceeded) { + t.Fatalf("cancelled Token: %v, want the deadline", err) + } + hold.Store(false) + // The next Token waits for the abandoned one to finish. + if token, err := strategy.Token(context.Background()); err != nil || token == "" { + t.Fatalf("the next Token: %q, %v", token, err) + } + if profile.root.closed || profile.root.inst.module.IsClosed() { + t.Fatal("the profile was closed") + } +} + +// An access-key exchange rotates nothing, so it ends with its caller: the +// held request is cancelled at the caller's deadline, not run on for the +// refresh grace, and Close does not wait for it. +func TestAnAccessKeyExchangeEndsWithItsCaller(t *testing.T) { + guestOrSkip(t) + var hold atomic.Bool + server := tokenServer(t, &hold) + profile, err := Open(context.Background(), t.TempDir()) + if err != nil { + t.Fatal(err) + } + defer profile.Close() + strategy, err := profile.AccessKey(context.Background(), testCRN, "CSAKtestKeyId.testKeySecret", WithBaseURL(server.URL)) + if err != nil { + t.Fatal(err) + } + + hold.Store(true) + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Millisecond) + defer cancel() + if _, err := strategy.Token(ctx); !errors.Is(err, context.DeadlineExceeded) { + t.Fatalf("cancelled Token: %v, want the deadline", err) + } + // The grace is 10 seconds; a Close that waited for it would take that. + start := time.Now() + if err := strategy.Close(); err != nil { + t.Fatal(err) + } + if waited := time.Since(start); waited > 2*time.Second { + t.Fatalf("Close took %v: the exchange ran on past its caller", waited) + } +} + +// A device session's refresh is the request that rotates a credential: the +// service answers with a new refresh token and retires the old one. A +// caller that gives up returns at once, but the refresh runs on, and what +// it brings is saved. The next Token is served from it with no second +// request, and the profile on disk holds the rotated refresh token. +func TestARefreshAnsweredAfterItsCallerGaveUpIsKept(t *testing.T) { + guestOrSkip(t) + dir, _ := expiredDeviceProfile(t) + var requests atomic.Int32 + answered := make(chan struct{}) + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if requests.Add(1) > 1 { + // The old refresh token is retired once the service answers. + w.WriteHeader(http.StatusBadRequest) + fmt.Fprint(w, `{"error":"invalid_grant"}`) + return + } + _, _ = io.Copy(io.Discard, r.Body) + time.Sleep(150 * time.Millisecond) + fmt.Fprint(w, `{"access_token":"fresh","token_type":"Bearer","expires_in":3600,"refresh_token":"refresh-2"}`) + close(answered) + })) + t.Cleanup(server.Close) + profile, err := Open(context.Background(), dir) + if err != nil { + t.Fatal(err) + } + defer profile.Close() + ws, err := profile.WorkspaceStore(context.Background(), wsA) + if err != nil { + t.Fatal(err) + } + strategy, err := ws.DeviceSession(context.Background(), WithBaseURL(server.URL)) + if err != nil { + t.Fatal(err) + } + defer strategy.Close() + + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Millisecond) + defer cancel() + if _, err := strategy.Token(ctx); !errors.Is(err, context.DeadlineExceeded) { + t.Fatalf("cancelled Token: %v, want the deadline", err) + } + select { + case <-answered: + t.Fatal("the cancelled Token waited for the service's answer") + default: + } + if token, err := strategy.Token(context.Background()); err != nil || token != "fresh" { + t.Fatalf("the next Token: %q, %v, want the refreshed token", token, err) + } + if n := requests.Load(); n != 1 { + t.Fatalf("%d refresh requests, want 1: the late answer was dropped", n) + } + data, err := os.ReadFile(filepath.Join(dir, "workspaces", wsA, "auth.json")) + if err != nil { + t.Fatal(err) + } + var stored map[string]any + if err := json.Unmarshal(data, &stored); err != nil { + t.Fatal(err) + } + if stored["refresh_token"] != "refresh-2" { + t.Fatalf("stored refresh token = %v, want the rotated one", stored["refresh_token"]) + } +} + +// A refresh runs on after its caller gives up, so the guest call under it +// can succeed after the caller's context ended. It still fails with the +// context's error; what the refresh brought is kept for the next call. +func TestARefreshThatSucceedsAfterItsContextEndsFailsWithIt(t *testing.T) { + guestOrSkip(t) + dir, _ := expiredDeviceProfile(t) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + _, _ = io.Copy(io.Discard, r.Body) + cancel() + fmt.Fprint(w, `{"access_token":"fresh","token_type":"Bearer","expires_in":3600,"refresh_token":"refresh-2"}`) + })) + t.Cleanup(server.Close) + profile, err := Open(context.Background(), dir) + if err != nil { + t.Fatal(err) + } + defer profile.Close() + ws, err := profile.WorkspaceStore(context.Background(), wsA) + if err != nil { + t.Fatal(err) + } + strategy, err := ws.DeviceSession(context.Background(), WithBaseURL(server.URL)) + if err != nil { + t.Fatal(err) + } + defer strategy.Close() + + out, err := strategy.store.callArgs(withRefresh(ctx), func(i *instance) api.Function { return i.authRefresh }, guest.BufArg([]byte(strategy.handle))) + if !errors.Is(err, context.Canceled) || out != nil { + t.Fatalf("refresh: %q, %v, want no token and context.Canceled", out, err) + } + if token, err := strategy.Token(context.Background()); err != nil || token != "fresh" { + t.Fatalf("the next Token: %q, %v, want the refreshed token", token, err) + } +} + +func TestATokenRequestWhoseContextEndsInTheQueueNeverReachesTheGuest(t *testing.T) { + guestOrSkip(t) + var hold atomic.Bool + server := tokenServer(t, &hold) + profile, err := Open(context.Background(), t.TempDir()) + if err != nil { + t.Fatal(err) + } + defer profile.Close() + strategy, err := profile.AccessKey(context.Background(), testCRN, "CSAKtestKeyId.testKeySecret", WithBaseURL(server.URL)) + if err != nil { + t.Fatal(err) + } + defer strategy.Close() + + for name, lock := range map[string]interface { + Acquire(context.Context) error + Unlock() + }{"the strategy's": &strategy.mu, "the profile's": &profile.root.mu} { + t.Run(name, func(t *testing.T) { + if err := lock.Acquire(context.Background()); err != nil { + t.Fatal(err) + } + released := make(chan struct{}) + time.AfterFunc(200*time.Millisecond, func() { lock.Unlock(); close(released) }) + ctx, cancel := context.WithTimeout(context.Background(), 20*time.Millisecond) + defer cancel() + if _, err := strategy.Token(ctx); !errors.Is(err, context.DeadlineExceeded) { + t.Fatalf("queued Token: %v, want the deadline", err) + } + <-released + }) + } + if token, err := strategy.Token(context.Background()); err != nil || token == "" { + t.Fatalf("the next Token: %q, %v", token, err) + } +} + +// The backstop: a call still running long after its caller gave up closes +// the profile. The caller has returned by then; the next call is ErrState. +func TestATokenFetchThatRunsOnAfterItsContextEndsClosesTheProfile(t *testing.T) { + guestOrSkip(t) + profile, err := Open(context.Background(), t.TempDir(), WithRoundTripper(roundTripFunc(func(*http.Request) (*http.Response, error) { + // A RoundTripper that ignores the request's context. + time.Sleep(300 * time.Millisecond) + return nil, errors.New("too late") + }))) + if err != nil { + t.Fatal(err) + } + defer profile.Close() + strategy, err := profile.AccessKey(context.Background(), testCRN, "CSAKtestKeyId.testKeySecret", WithBaseURL("https://cts.example.com")) + if err != nil { + t.Fatal(err) + } + defer strategy.Close() + profile.root.stuck = 20 * time.Millisecond + ctx, cancel := context.WithTimeout(context.Background(), 20*time.Millisecond) + defer cancel() + if _, err := strategy.Token(ctx); !errors.Is(err, context.DeadlineExceeded) { + t.Fatalf("stuck Token: %v, want the deadline", err) + } + if _, err := strategy.Token(context.Background()); !errors.Is(err, ErrState) { + t.Fatalf("a Token after the close: %v, want ErrState", err) + } +} diff --git a/languages/golang/auth/doc.go b/languages/golang/auth/doc.go index b0bf4f16d..d61e99371 100644 --- a/languages/golang/auth/doc.go +++ b/languages/golang/auth/doc.go @@ -39,6 +39,18 @@ // [OAuth2TokenSource] adapts an existing golang.org/x/oauth2.TokenSource // into the OIDC provider interface. // +// A call whose context ends, [Strategy.Token] included, fails with the +// context's error and leaves the store and its strategies open: a request +// cancelled while its token is exchanged or refreshed does not stop the +// encrypt clients that read tokens from the same store. A request to the +// token service is cancelled with its caller, except a device session's +// refresh: the service rotates the refresh token when it answers one, so +// the caller returns at once while the refresh runs on, for up to 10 +// seconds, and the store keeps what it sends back for the next call. +// [Strategy.Close] waits for such a refresh. The store closes itself, and +// every later call is [ErrState], only when its guest traps or a call runs +// on for 30 seconds after its context ended. +// // # Why a second guest // // The crypto guest behind encrypt has no filesystem and no diff --git a/languages/golang/auth/guest.go b/languages/golang/auth/guest.go index 5c17ef261..69e395a3a 100644 --- a/languages/golang/auth/guest.go +++ b/languages/golang/auth/guest.go @@ -111,6 +111,9 @@ func newInstance(ctx context.Context, wasm []byte, hostDir string, policy guest. return nil, fmt.Errorf("%w: %s: %w", ErrNoProfile, hostDir, err) } } + // A call never runs under its caller's context (see guest.Detach), so + // this closes the module only for a call that ran on long after its + // caller gave up: ProfileStore.callArgs. config := wazero.NewRuntimeConfig(). WithCompilationCache(compilationCache()). WithCloseOnContextDone(true) @@ -183,8 +186,8 @@ func newInstance(ctx context.Context, wasm []byte, hostDir string, policy guest. // release runs the guest's shutdown — every buffer it still holds wiped — // and closes the runtime, which frees the linear memory through the -// allocator's wipe, then the directory handle the mount holds. A module an -// interrupted call or a trap already closed cannot run sa_shutdown; the +// allocator's wipe, then the directory handle the mount holds. A module a +// stuck call or a trap already closed cannot run sa_shutdown; the // runtime close still wipes and frees its memory. func (inst *instance) release() error { ctx := context.Background() diff --git a/languages/golang/auth/guest/Cargo.lock b/languages/golang/auth/guest/Cargo.lock index 6b36c6d82..ce1a5e7eb 100644 --- a/languages/golang/auth/guest/Cargo.lock +++ b/languages/golang/auth/guest/Cargo.lock @@ -419,7 +419,7 @@ dependencies = [ "url", "utoipa", "uuid", - "vitaminc", + "vitaminc 0.5.1", ] [[package]] @@ -1365,6 +1365,15 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -1838,8 +1847,8 @@ dependencies = [ "tracing", "url", "uuid", - "vitaminc", - "vitaminc-protected", + "vitaminc 0.6.1", + "vitaminc-protected 0.6.1", "web-time", "zeroize", "zerokms-protocol", @@ -1858,8 +1867,7 @@ dependencies = [ "stack-profile", "tempfile", "url", - "vitaminc-aead-value", - "vitaminc-protected", + "vitaminc-protected 0.6.1", "zeroize", ] @@ -1870,8 +1878,9 @@ dependencies = [ "miette", "serde_json", "thiserror 1.0.69", - "vitaminc-aead-value", - "vitaminc-protected", + "vitaminc-aead 0.6.1", + "vitaminc-aead-frame", + "vitaminc-protected 0.6.1", "zeroize", ] @@ -2066,6 +2075,36 @@ dependencies = [ "syn 3.0.6", ] +[[package]] +name = "toml_datetime" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.25.17+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3641d5bbb5349a79e1020a242d251efbc546ad8048d133958323ce9c40a9c9c" +dependencies = [ + "indexmap", + "toml_datetime", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.1.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c" +dependencies = [ + "winnow", +] + [[package]] name = "tracing" version = "0.1.44" @@ -2250,12 +2289,26 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35042fb7a81d72dc43c53fec835e61027f18b4d01cc0f7e12d6c6a6ffbf3bfb9" dependencies = [ - "vitaminc-aead", - "vitaminc-context", - "vitaminc-encrypt", - "vitaminc-protected", - "vitaminc-random", - "vitaminc-traits", + "vitaminc-aead 0.5.1", + "vitaminc-context 0.5.1", + "vitaminc-encrypt 0.5.1", + "vitaminc-protected 0.5.1", + "vitaminc-random 0.5.1", + "vitaminc-traits 0.5.1", +] + +[[package]] +name = "vitaminc" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac5c15b6c25efcb9a6111f7108ab8101947a7bf7e9af3ff6d6a73358a1ace0da" +dependencies = [ + "vitaminc-aead 0.6.1", + "vitaminc-context 0.6.1", + "vitaminc-encrypt 0.6.1", + "vitaminc-protected 0.6.1", + "vitaminc-random 0.6.1", + "vitaminc-traits 0.6.1", ] [[package]] @@ -2266,10 +2319,27 @@ checksum = "62cacd4dae485e98cfe5407e919187a8468dd933ea4234be5115b7d13a30f3c6" dependencies = [ "bytes", "serde", - "vitaminc-aead-derive", - "vitaminc-context", - "vitaminc-protected", - "vitaminc-random", + "vitaminc-aead-derive 0.5.1", + "vitaminc-context 0.5.1", + "vitaminc-protected 0.5.1", + "vitaminc-random 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-aead" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71b8c5c4ced92545dce5fd7cf04581d08210def174cc81475cf227fa2506c5b7" +dependencies = [ + "bytes", + "futures-util", + "serde", + "thiserror 2.0.20", + "vitaminc-aead-derive 0.6.1", + "vitaminc-context 0.6.1", + "vitaminc-protected 0.6.1", + "vitaminc-random 0.6.1", "zeroize", ] @@ -2285,14 +2355,23 @@ dependencies = [ ] [[package]] -name = "vitaminc-aead-value" -version = "0.5.1" +name = "vitaminc-aead-derive" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d78cdadbc6374c3bd7c19fb4d99abca693b96953b18fef8c608efbe092cf3ea" +checksum = "4c546497a972d0f0498f2f8d5f537c514bad82df8662951c63d0c80023808900" dependencies = [ - "vitaminc-aead", - "vitaminc-protected", - "zeroize", + "proc-macro2", + "quote", + "syn 3.0.6", +] + +[[package]] +name = "vitaminc-aead-frame" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35992a269bcaa5b201f1938e54bfbf167bfa6fe975d83cbdbdb54c2a363c5ef" +dependencies = [ + "vitaminc-aead 0.6.1", ] [[package]] @@ -2302,7 +2381,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7df52501fe33cdb3ee9e155b5242fac184c037d147e58c96e5143ed011252a8" dependencies = [ "mutants", - "vitaminc-protected", + "vitaminc-protected 0.5.1", +] + +[[package]] +name = "vitaminc-context" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4c4bc2bd9811253eb427657565a45bd4826e2379e93ee1c4d00c808a769882" +dependencies = [ + "mutants", + "vitaminc-protected 0.6.1", ] [[package]] @@ -2313,9 +2402,23 @@ checksum = "9fbd0e1748055e381e02033e08af385de879c4dcf32e0f6739ac0c0cf0c6f13d" dependencies = [ "aes-gcm", "aws-lc-rs", - "vitaminc-aead", - "vitaminc-protected", - "vitaminc-random", + "vitaminc-aead 0.5.1", + "vitaminc-protected 0.5.1", + "vitaminc-random 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-encrypt" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0923694602855b33a296d9af473e282e8096c1cfe1b30b8695d3b6651717fc5" +dependencies = [ + "aes-gcm", + "aws-lc-rs", + "vitaminc-aead 0.6.1", + "vitaminc-protected 0.6.1", + "vitaminc-random 0.6.1", "zeroize", ] @@ -2332,7 +2435,24 @@ dependencies = [ "serde_bytes", "subtle", "thiserror 2.0.20", - "vitaminc-protected-derive", + "vitaminc-protected-derive 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-protected" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1bb76dd473f5aa89b844f92018ebe3041deb8e5390e7061cca4283d959ff855" +dependencies = [ + "bitvec", + "digest 0.11.3", + "libc", + "serde", + "serde_bytes", + "subtle", + "thiserror 2.0.20", + "vitaminc-protected-derive 0.6.1", "zeroize", ] @@ -2347,6 +2467,18 @@ dependencies = [ "syn 3.0.6", ] +[[package]] +name = "vitaminc-protected-derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7478ed160c019059746e75fc613563dcdcd5266d155a34601d29377a1c4afc3" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 3.0.6", +] + [[package]] name = "vitaminc-random" version = "0.5.1" @@ -2357,8 +2489,23 @@ dependencies = [ "getrandom 0.4.3", "rand 0.10.3", "thiserror 2.0.20", - "vitaminc-protected", - "vitaminc-random-derives", + "vitaminc-protected 0.5.1", + "vitaminc-random-derives 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-random" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b477af7c01c3d9ef2647e46952ad3df7f246b3f806b1d4009ee83beecec613a" +dependencies = [ + "chacha20", + "getrandom 0.4.3", + "rand 0.10.3", + "thiserror 2.0.20", + "vitaminc-protected 0.6.1", + "vitaminc-random-derives 0.6.1", "zeroize", ] @@ -2373,6 +2520,17 @@ dependencies = [ "syn 3.0.6", ] +[[package]] +name = "vitaminc-random-derives" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5a0de8da428c6789dc067a578a0462e411099721d616736cf29e1622230c35" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.6", +] + [[package]] name = "vitaminc-traits" version = "0.5.1" @@ -2384,8 +2542,24 @@ dependencies = [ "rmp-serde", "serde", "thiserror 2.0.20", - "vitaminc-protected", - "vitaminc-random", + "vitaminc-protected 0.5.1", + "vitaminc-random 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-traits" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a900f0edcacd49c8557ab54722175869fec66926054a6fbdc53a05069db3c922" +dependencies = [ + "anyhow", + "bytes", + "rmp-serde", + "serde", + "thiserror 2.0.20", + "vitaminc-protected 0.6.1", + "vitaminc-random 0.6.1", "zeroize", ] @@ -2622,6 +2796,15 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winnow" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" +dependencies = [ + "memchr", +] + [[package]] name = "wit-bindgen" version = "0.57.1" diff --git a/languages/golang/auth/guest/Cargo.toml b/languages/golang/auth/guest/Cargo.toml index d3928e995..df3ce1563 100644 --- a/languages/golang/auth/guest/Cargo.toml +++ b/languages/golang/auth/guest/Cargo.toml @@ -41,10 +41,6 @@ stack-guest-abi = { path = "../../../../packages/stack-guest-abi" } # hostname and the process id are native-only there, and creating a device # identity is CLI territory. stack-profile = { path = "../../../../packages/stack-profile" } -# The FFI codec for the structured results (a list of workspace ids, the -# fields of a token): the one codec every binding carries. Same vitaminc -# version the crypto guest builds against. -vitaminc-aead-value = "0.5.0" # The deserialized form of `secretkey.json` is wiped when it drops. zeroize = { version = "1", features = ["derive"] } @@ -52,7 +48,7 @@ zeroize = { version = "1", features = ["derive"] } serde_json = "1" tempfile = "3" # `Controlled::risky_ref`, to read a codec value back in the tests. -vitaminc-protected = "0.5.0" +vitaminc-protected = "0.6.0" [profile.release] # Smaller .wasm; the guest is IO-bound on the FFI copy and the file reads, diff --git a/languages/golang/auth/guest/src/lib.rs b/languages/golang/auth/guest/src/lib.rs index fb9986d4c..a95e5c511 100644 --- a/languages/golang/auth/guest/src/lib.rs +++ b/languages/golang/auth/guest/src/lib.rs @@ -58,8 +58,8 @@ //! //! Profile inputs are UTF-8 strings: the store directory (a guest path under //! the mount), a workspace id, a filename. Outputs are either a UTF-8 string -//! (an id, a path) or a value in vitaminc's FFI codec -//! (`vitaminc_aead_value::transport`): a list of ids, or the fields of +//! (an id, a path) or a vitaminc transport frame +//! ([`HostValue`](stack_guest_abi::value::HostValue)): a list of ids, or the fields of //! `secretkey.json`, `auth.json` or `device.json` as an object. The client //! key in `secretkey.json` crosses as the text the file holds; the Go side //! wraps it in its opaque `ClientKey` and wipes its transport copy. A diff --git a/languages/golang/auth/guest/src/ops.rs b/languages/golang/auth/guest/src/ops.rs index 6a32bfa5d..19e80580a 100644 --- a/languages/golang/auth/guest/src/ops.rs +++ b/languages/golang/auth/guest/src/ops.rs @@ -30,8 +30,8 @@ use serde::Deserialize; use stack_auth::Token; +use stack_guest_abi::value::HostValue; use stack_profile::{DeviceIdentity, ProfileStore}; -use vitaminc_aead_value::{transport as codec, FfiValue}; use zeroize::{Zeroize, ZeroizeOnDrop}; use stack_guest_abi::last_error::{internal, malformed}; @@ -76,18 +76,18 @@ fn text(bytes: &[u8]) -> Result<&str, u32> { std::str::from_utf8(bytes).map_err(|_| malformed("an input is not UTF-8")) } -fn string(value: impl Into) -> FfiValue { - FfiValue::String(value.into().into()) +fn string(value: impl Into) -> HostValue { + HostValue::text(value) } -fn optional(value: Option<&str>) -> FfiValue { - value.map_or(FfiValue::Null, string) +fn optional(value: Option<&str>) -> HostValue { + value.map_or(HostValue::Null, string) } -fn encode(value: FfiValue) -> Result, u32> { - let mut out = Vec::new(); - codec::encode_value(value, &mut out).map_err(|_| internal("an output did not encode"))?; - Ok(out) +fn encode(value: HostValue) -> Result, u32> { + value + .encode() + .map_err(|_| internal("an output did not encode")) } /// The current workspace id, as text. @@ -122,7 +122,7 @@ pub fn list_workspaces(dir: &[u8]) -> Result, u32> { let ids = store(dir)? .list_workspaces() .map_err(|e| fail_profile(&e))?; - encode(FfiValue::Array(ids.into_iter().map(string).collect())) + encode(HostValue::List(ids.into_iter().map(string).collect())) } /// The directory of the store scoped to workspace `id`, as text: what @@ -165,11 +165,11 @@ pub fn secret_key(dir: &[u8]) -> Result, u32> { // fields cannot be moved out of it directly. let client_id = std::mem::take(&mut file.client_id); let client_key = std::mem::take(&mut file.client_key); - encode(FfiValue::Object(vec![ + encode(HostValue::Map(vec![ ("client_id".to_string(), string(client_id)), ( "client_key".to_string(), - FfiValue::Bytes(client_key.into_bytes().into()), + HostValue::Bytes(client_key.into_bytes().into()), ), ])) } @@ -184,7 +184,7 @@ pub fn token(dir: &[u8]) -> Result, u32> { let token: Token = store(dir)? .load(AUTH_FILENAME) .map_err(|e| fail_profile(&e))?; - encode(FfiValue::Object(vec![ + encode(HostValue::Map(vec![ ( "access_token".to_string(), string(token.access_token().as_str()), @@ -192,7 +192,7 @@ pub fn token(dir: &[u8]) -> Result, u32> { ("token_type".to_string(), string(token.token_type())), ( "expires_at".to_string(), - FfiValue::UInt64(token.expires_at()), + HostValue::UInt(token.expires_at()), ), ("region".to_string(), optional(token.region())), ("client_id".to_string(), optional(token.client_id())), @@ -214,7 +214,7 @@ pub fn has_token(dir: &[u8]) -> Result, u32> { /// `{device_instance_id, device_name}`. Creating one is the CLI's. pub fn device_identity(dir: &[u8]) -> Result, u32> { let identity = DeviceIdentity::load(&store(dir)?).map_err(|e| fail_profile(&e))?; - encode(FfiValue::Object(vec![ + encode(HostValue::Map(vec![ ( "device_instance_id".to_string(), string(identity.device_instance_id.to_string()), @@ -235,12 +235,12 @@ mod tests { t.path().to_str().unwrap().as_bytes().to_vec() } - fn decode(bytes: &[u8]) -> FfiValue { - codec::decode_value(&mut codec::Reader::new(bytes)).unwrap() + fn decode(bytes: &[u8]) -> HostValue { + HostValue::decode(bytes).unwrap() } - fn field<'a>(value: &'a FfiValue, key: &str) -> &'a FfiValue { - let FfiValue::Object(entries) = value else { + fn field<'a>(value: &'a HostValue, key: &str) -> &'a HostValue { + let HostValue::Map(entries) = value else { panic!("not an object"); }; entries @@ -250,16 +250,16 @@ mod tests { .unwrap_or_else(|| panic!("no field {key}")) } - fn as_text(value: &FfiValue) -> String { - let FfiValue::String(s) = value else { + fn as_text(value: &HostValue) -> String { + let HostValue::Text(s) = value else { panic!("not a string"); }; - String::from_utf8(s.risky_ref().to_vec()).unwrap() + s.to_string() } - fn as_bytes(value: &FfiValue) -> Vec { + fn as_bytes(value: &HostValue) -> Vec { use vitaminc_protected::Controlled; - let FfiValue::Bytes(b) = value else { + let HostValue::Bytes(b) = value else { panic!("not bytes"); }; b.risky_ref().to_vec() @@ -314,7 +314,7 @@ mod tests { assert_eq!(current_workspace(&d).unwrap(), WS_A.as_bytes()); let listed = decode(&list_workspaces(&d).unwrap()); - let FfiValue::Array(items) = listed else { + let HostValue::List(items) = listed else { panic!("not an array"); }; let ids: Vec = items.iter().map(as_text).collect(); @@ -411,11 +411,11 @@ mod tests { assert_eq!(as_text(field(&tok, "token_type")), "Bearer"); assert!(matches!( field(&tok, "expires_at"), - FfiValue::UInt64(1_800_000_000) + HostValue::UInt(1_800_000_000) )); assert_eq!(as_text(field(&tok, "region")), "ap-southeast-2"); - assert!(matches!(field(&tok, "client_id"), FfiValue::Null)); - let FfiValue::Object(entries) = tok else { + assert!(matches!(field(&tok, "client_id"), HostValue::Null)); + let HostValue::Map(entries) = tok else { panic!("not an object"); }; assert!( diff --git a/languages/golang/auth/guest/tests/leak.rs b/languages/golang/auth/guest/tests/leak.rs index 6d08d4cf5..ae0083d80 100644 --- a/languages/golang/auth/guest/tests/leak.rs +++ b/languages/golang/auth/guest/tests/leak.rs @@ -25,7 +25,7 @@ use stack_auth::AuthError; use stack_auth_guest::ops; use stack_auth_guest::status::fail_auth; use stack_guest_abi::call; -use vitaminc_aead_value::{transport as codec, FfiValue}; +use stack_guest_abi::value::HostValue; const ACCESS_TOKEN: &str = "leak-marker-access-token"; const ACCESS_KEY: &str = "leak-marker-access-key"; @@ -43,18 +43,18 @@ fn failure( what: &str, expect: &[&str], step: impl FnOnce() -> Result, -) -> FfiValue { +) -> HostValue { let _ = call::run(step).expect_err(what); let bytes = call::take_last_error().unwrap_or_else(|| panic!("{what}: no error recorded")); - let error = codec::decode_value(&mut codec::Reader::new(&bytes)).expect("an error decodes"); + let error = HostValue::decode(&bytes).expect("an error decodes"); assert_eq!(codes(&error), expect, "{what}: the codes it reaches"); error } /// An error's code, then its causes' codes, in order. -fn codes(value: &FfiValue) -> Vec { +fn codes(value: &HostValue) -> Vec { let mut out: Vec = text(get(value, "code")).into_iter().collect(); - if let Some(FfiValue::Array(causes)) = get(value, "causes") { + if let Some(HostValue::List(causes)) = get(value, "causes") { out.extend(causes.iter().filter_map(|cause| text(get(cause, "code")))); } out @@ -71,19 +71,19 @@ fn check(text: &[u8], at: &str, found: &mut Vec) { } } -fn leaks(value: &FfiValue, path: &str, found: &mut Vec) { +fn leaks(value: &HostValue, path: &str, found: &mut Vec) { match value { - FfiValue::String(text) => check(text.risky_ref(), path, found), - FfiValue::Bytes(bytes) => { + HostValue::Text(text) => check(text.as_bytes(), path, found), + HostValue::Bytes(bytes) => { use vitaminc_protected::Controlled; check(bytes.risky_ref(), path, found); } - FfiValue::Array(items) => { + HostValue::List(items) => { for (at, item) in items.iter().enumerate() { leaks(item, &format!("{path}[{at}]"), found); } } - FfiValue::Object(entries) => { + HostValue::Map(entries) => { for (key, item) in entries { check(key.as_bytes(), &format!("{path} key"), found); leaks(item, &format!("{path}.{key}"), found); @@ -93,16 +93,16 @@ fn leaks(value: &FfiValue, path: &str, found: &mut Vec) { } } -fn get<'a>(value: &'a FfiValue, key: &str) -> Option<&'a FfiValue> { +fn get<'a>(value: &'a HostValue, key: &str) -> Option<&'a HostValue> { match value { - FfiValue::Object(entries) => entries.iter().find(|(k, _)| k == key).map(|(_, v)| v), + HostValue::Map(entries) => entries.iter().find(|(k, _)| k == key).map(|(_, v)| v), _ => None, } } -fn text(value: Option<&FfiValue>) -> Option { +fn text(value: Option<&HostValue>) -> Option { match value? { - FfiValue::String(s) => String::from_utf8(s.risky_ref().to_vec()).ok(), + HostValue::Text(s) => Some(s.to_string()), _ => None, } } @@ -111,7 +111,7 @@ fn dir(path: &Path) -> Vec { path.to_str().expect("utf8 temp dir").as_bytes().to_vec() } -fn scenarios() -> Vec<(&'static str, FfiValue)> { +fn scenarios() -> Vec<(&'static str, HostValue)> { let root = tempfile::tempdir().expect("temp dir"); let store = dir(root.path()); let workspace = root.path().join("workspaces").join("AAAAAAAAAAAAAAAA"); @@ -268,7 +268,7 @@ fn a_profile_json_error_points_at_the_line() { Some("stack_profile::json") ); let fields = get(&error, "fields").expect("fields"); - assert!(matches!(get(fields, "line"), Some(FfiValue::UInt64(2)))); + assert!(matches!(get(fields, "line"), Some(HostValue::UInt(2)))); assert!( text(get(&error, "help")).is_some(), "the help says how to fix it" diff --git a/languages/golang/auth/store.go b/languages/golang/auth/store.go index b5baea7a6..23b9b5915 100644 --- a/languages/golang/auth/store.go +++ b/languages/golang/auth/store.go @@ -10,7 +10,7 @@ import ( "path/filepath" "runtime" "strings" - "sync" + "time" "github.com/cipherstash/stack/languages/golang/internal/guest" "github.com/cipherstash/vitaminc/bindings/go/vcffi" @@ -53,6 +53,15 @@ func RequireLockedMemory() Option { // stores from one root share one guest instance over the one mounted // directory; Close on any of them releases it. It is safe for concurrent // use; calls are serialised, because a wasm instance is single-threaded. +// +// A call whose context ends fails with the context's error, and only that +// call: a request cancelled while its token is fetched or refreshed never +// closes the profile, or the strategies and encrypt clients that read +// tokens from it. A device session's refresh already sent finishes in the +// background, for up to 10 seconds, so a rotated refresh token is never +// lost (see refreshGrace). The profile closes itself, and every later call is +// [ErrState], only when the guest's state is unknown: it trapped, or it +// went on running long after its caller gave up, which is a bug. type ProfileStore struct { root *root // dir is the store's directory as the guest sees it: guestRoot, or a @@ -62,13 +71,17 @@ type ProfileStore struct { // root is the guest instance the stores of one profile share. type root struct { - mu sync.Mutex + mu guest.Lock inst *instance hostDir string - closed bool - // released is the runtime's own state, apart from closed: an - // interrupted call closes the module, and so the stores, while the - // runtime is still allocated. Close frees it even then. + // stuck is how long a call may run on after its context ends before + // the guest is treated as stuck and closed. guest.StuckAfter; tests + // shorten it. + stuck time.Duration + closed bool + // released is the runtime's own state, apart from closed: a stuck + // call closes the module, and so the stores, while the runtime is + // still allocated. Close frees it even then. released bool cleanup runtime.Cleanup } @@ -135,7 +148,7 @@ func open(ctx context.Context, hostDir string, opts []Option) (*ProfileStore, er if err != nil { return nil, err } - r := &root{inst: inst, hostDir: hostDir} + r := &root{inst: inst, hostDir: hostDir, stuck: guest.StuckAfter} // The cleanup takes the instance, not the root: a cleanup whose // argument reaches its object keeps that object alive forever. r.cleanup = runtime.AddCleanup(r, func(inst *instance) { _ = inst.release() }, inst) @@ -204,7 +217,7 @@ func (s *ProfileStore) Close() error { type export func(*instance) api.Function // call runs one export under the profile's lock, closing the profile if -// the guest trapped or an interrupted call took the module down. +// the guest trapped or a stuck call took the module down. func (s *ProfileStore) call(ctx context.Context, fn export, args ...string) ([]byte, error) { // Every profile export works on the mount; without one the guest would // report an I/O error that says less than this does. @@ -221,23 +234,32 @@ func (s *ProfileStore) call(ctx context.Context, fn export, args ...string) ([]b // callArgs is the shared checked call path for profile exports and auth // exports. The latter pass secret-bearing byte buffers and wipe host copies. +// +// The caller's context bounds the wait for the lock, as encrypt's +// Client.call does, and the guest runs under guest.Detach, so a caller +// that gives up never closes the profile. A refresh request runs on for +// refreshGrace, so the guest keeps the rotated token the service sends. func (s *ProfileStore) callArgs(ctx context.Context, fn export, args ...guest.Arg) ([]byte, error) { r := s.root - r.mu.Lock() + if err := r.mu.Acquire(ctx); err != nil { + return nil, err + } defer r.mu.Unlock() if r.closed || r.inst.module.IsClosed() { r.closed = true return nil, ErrState } growth := r.inst.mem.GrowthRefusal() - out, err := guest.Call(ctx, r.inst.mem, r.inst.module, r.inst.exports, fn(r.inst), args...) + run, done := guest.Detach(ctx, r.stuck) + out, err := guest.Call(run, r.inst.mem, r.inst.module, r.inst.exports, fn(r.inst), args...) + done() switch { case r.inst.module.IsClosed(): r.closed = true if err == nil { err = ErrState } - err = fmt.Errorf("%w: interrupted call closed the profile", err) + err = fmt.Errorf("%w: the guest ran on after its caller's context ended, and the profile is closed", err) case errors.Is(err, guest.ErrTrap): r.closed = true _ = r.inst.module.Close(context.Background()) @@ -253,8 +275,19 @@ func (s *ProfileStore) callArgs(ctx context.Context, fn export, args ...guest.Ar err = fmt.Errorf("%w (growth refused under RequireLockedMemory): %w", guest.MemoryLockError(g.Reason), err) } if err != nil { + if ctxErr := ctx.Err(); ctxErr != nil && !errors.Is(err, ctxErr) { + err = fmt.Errorf("%w: %w", ctxErr, err) + } return nil, err } + // A call that succeeded after its context ended fails too, as in + // encrypt's Client.call, and its output (a token, say) is wiped. What + // the guest wrote stays written: a refresh that ran on keeps the + // rotated token, and the next call reads it. + if ctxErr := ctx.Err(); ctxErr != nil { + guest.Wipe(out) + return nil, ctxErr + } return out, nil } diff --git a/languages/golang/auth/strategy.go b/languages/golang/auth/strategy.go index 5fadc7bce..51379cbdf 100644 --- a/languages/golang/auth/strategy.go +++ b/languages/golang/auth/strategy.go @@ -7,7 +7,6 @@ import ( "fmt" "os" "strconv" - "sync" "github.com/cipherstash/stack/languages/golang/internal/guest" "github.com/tetratelabs/wazero/api" @@ -58,7 +57,7 @@ type Strategy struct { handle string providerID uint32 device bool - mu sync.Mutex + mu guest.Lock closed bool } @@ -182,28 +181,63 @@ func (s *ProfileStore) hasToken(ctx context.Context) (bool, error) { // Token gets the current CTS bearer credential. Device sessions read a fresh // token without a file lock; only a refresh call takes the cross-process lock. func (s *Strategy) Token(ctx context.Context) (string, error) { - s.mu.Lock() - defer s.mu.Unlock() + // A request queued behind another's refresh leaves when its context + // ends, as at the profile's own lock. + if err := s.mu.Acquire(ctx); err != nil { + return "", err + } if s.closed { + s.mu.Unlock() return "", ErrState } - ctx, status := withAuthHTTPStatus(ctx) - token, err := s.token(ctx) - return token, status.wrap(err) + // The work runs on its own goroutine, which holds the lock until it is + // done, so a caller that gives up returns at once. A device session's + // refresh already sent finishes there, and the guest keeps what the + // service sends (see refreshGrace): a rotated refresh token is never + // lost. The token it brings is dropped; the next Token reads it. Any + // other request ends with the caller. + type result struct { + token string + err error + } + done := make(chan result, 1) + go func() { + defer s.mu.Unlock() + ctx, status := withAuthHTTPStatus(ctx) + token, err := s.token(ctx) + done <- result{token, status.wrap(err)} + }() + select { + case r := <-done: + return r.token, r.err + case <-ctx.Done(): + // A call that finished as the context ended still answers. + select { + case r := <-done: + return r.token, r.err + default: + return "", ctx.Err() + } + } } // token is Token under the strategy's lock: a read, then a locked refresh // for a device session that needs one. func (s *Strategy) token(ctx context.Context) (string, error) { - call := func(export func(*instance) api.Function) (string, error) { + call := func(ctx context.Context, export func(*instance) api.Function) (string, error) { out, err := s.store.callArgs(ctx, export, guest.BufArg([]byte(s.handle))) if err != nil { return "", err } defer guest.Wipe(out) + // A caller that has left gets no copy: a string cannot be wiped, + // and the next Token reads the guest's. + if err := ctx.Err(); err != nil { + return "", err + } return string(out), nil } - token, err := call(func(i *instance) api.Function { return i.authToken }) + token, err := call(ctx, func(i *instance) api.Function { return i.authToken }) if !s.device || !errors.Is(err, guest.ErrAuthRefreshRequired) { return token, err } @@ -213,7 +247,9 @@ func (s *Strategy) token(ctx context.Context) (string, error) { } err = withRefreshLock(ctx, path, func() error { var err error - token, err = call(func(i *instance) api.Function { return i.authRefresh }) + // The one request that rotates a credential: it runs on after its + // caller leaves (see refreshGrace). + token, err = call(withRefresh(ctx), func(i *instance) api.Function { return i.authRefresh }) return err }) return token, err @@ -229,6 +265,9 @@ func (s *Strategy) token(ctx context.Context) (string, error) { func (s *Strategy) MemoryLockError() error { return s.store.MemoryLockError() } // Close drops the strategy's cached token and unregisters its provider. +// It waits for a call in flight, including a device session's refresh that +// a cancelled Token left running: that refresh finishes, for up to 10 +// seconds, so the rotated refresh token it brings is saved rather than lost. func (s *Strategy) Close() error { s.mu.Lock() defer s.mu.Unlock() diff --git a/languages/golang/auth/transport.go b/languages/golang/auth/transport.go index 599f40dab..b2e18d89c 100644 --- a/languages/golang/auth/transport.go +++ b/languages/golang/auth/transport.go @@ -10,6 +10,7 @@ import ( "sort" "strings" "sync" + "time" "github.com/cipherstash/stack/languages/golang/internal/guest" "github.com/tetratelabs/wazero" @@ -70,7 +71,10 @@ func (s *authHTTPStatus) wrap(err error) error { } type authTransport struct { - rt http.RoundTripper + rt http.RoundTripper + // grace is how long a refresh request runs on after its caller gives + // up: refreshGrace, shortened by tests. + grace time.Duration mu sync.Mutex providers map[uint32]OIDCProvider nextProvider uint32 @@ -80,7 +84,7 @@ func newAuthTransport(rt http.RoundTripper) *authTransport { if rt == nil { rt = http.DefaultTransport } - return &authTransport{rt: rt, providers: make(map[uint32]OIDCProvider)} + return &authTransport{rt: rt, grace: refreshGrace, providers: make(map[uint32]OIDCProvider)} } func (t *authTransport) register(provider OIDCProvider) uint32 { @@ -101,6 +105,40 @@ func (t *authTransport) unregister(id uint32) { t.mu.Unlock() } +// refreshGrace is how long a device session's refresh request runs on after +// its caller's context ends. The token service rotates the refresh token +// when it answers a refresh, so a refresh abandoned after the service +// answered would lose the new token, and the next refresh would send one +// the service has retired. So a refresh is not cancelled with its caller: +// the caller returns at once (Strategy.Token), the request finishes, and +// the guest saves what came back. A refresh still running this long after +// its caller gave up fails as a transport failure, well inside +// guest.StuckAfter, so the profile stays open. +// +// Every other request to the token service (an access-key exchange, an +// OIDC exchange) rotates nothing, and is cancelled with its caller. +const refreshGrace = 10 * time.Second + +// refreshKey marks the context of a device session's refresh call +// (withRefresh), whose requests get refreshGrace. +type refreshKey struct{} + +// withRefresh marks ctx as a refresh call's. +func withRefresh(ctx context.Context) context.Context { + return context.WithValue(ctx, refreshKey{}, true) +} + +// requestContext is the context a request to the token service runs under: +// the caller's, so a caller that gives up cancels it, except for a refresh, +// which runs on for the grace (see refreshGrace). done must be called when +// the request is finished with. +func (t *authTransport) requestContext(ctx context.Context) (context.Context, func()) { + if refresh, _ := ctx.Value(refreshKey{}).(bool); refresh { + return guest.Detach(guest.Caller(ctx), t.grace) + } + return guest.Caller(ctx), func() {} +} + func (t *authTransport) instantiate(ctx context.Context, r wazero.Runtime) error { _, err := r.NewHostModuleBuilder("cipherstash_transport"). NewFunctionBuilder().WithFunc(t.send).Export("transport_send"). @@ -124,7 +162,9 @@ func (t *authTransport) send(ctx context.Context, m api.Module, return t.placeResponse(ctx, m, respHeadersPtrOut, respHeadersLenOut, respBodyPtrOut, respBodyLenOut, -1, nil, []byte("request buffer out of range")) } requestBody := newAuthRequestBody(body) - req, err := http.NewRequestWithContext(ctx, string(method), string(url), requestBody) + reqCtx, done := t.requestContext(ctx) + defer done() + req, err := http.NewRequestWithContext(reqCtx, string(method), string(url), requestBody) if err != nil { _ = requestBody.Close() return t.placeResponse(ctx, m, respHeadersPtrOut, respHeadersLenOut, respBodyPtrOut, respBodyLenOut, -1, nil, []byte(err.Error())) @@ -174,7 +214,7 @@ func (t *authTransport) oidcTokenGet(ctx context.Context, m api.Module, provider if source == nil { return 1 } - token, err := source.Token(ctx) + token, err := source.Token(guest.Caller(ctx)) if err != nil || token == "" || strings.ContainsAny(token, "\r\n\x00") { return 1 } diff --git a/languages/golang/cmd/stashgen/README.md b/languages/golang/cmd/stashgen/README.md index d3f38554e..89e095cae 100644 --- a/languages/golang/cmd/stashgen/README.md +++ b/languages/golang/cmd/stashgen/README.md @@ -40,11 +40,11 @@ Your program calls those functions, and it never builds or names a plan. ```go encrypted, err := users.Encrypt(ctx, cipher, people) opened, err := users.Decrypt(ctx, cipher, encrypted) - query, err := users.Fields.Email.Query(ctx, cipher, "bob@example.com") + query, err := users.Fields.Email.Eq(ctx, cipher, "bob@example.com") ``` 6. Store the encrypted type. - Each `encrypt_into` field is one EQL column: `eql.TextEq` implements `driver.Valuer` and `sql.Scanner`, so a database library binds and scans it as the JSON a `public.eql_v3_text_eq` column holds. + Each `encrypt_into` field is one EQL column: `eql.TextEq` implements `driver.Valuer` and `sql.Scanner`, so a database library binds and scans it as the JSON a `public.eql_v4_text_eq` column holds. Stack Encrypt writes EQL v4; see the `encrypt` package README for the EQL types it produces and the Go field type each takes. 7. Run the generator again after each change to the struct or to a tag. A change to the fields of the struct stops the build until you do. @@ -96,9 +96,9 @@ A query on such a type derives its term under the context the cipher names, so i > To update one column, use its `Fields` entry, such as `Fields.Email.Encrypt`. The index names are `equality`, `match`, `ore`, `ope` and `json`. -A `match` index needs text with at least one token: the engine derives no match term for an empty string, separator-only text, or text shorter than the n-gram length (3 characters), because an empty term would match every row. -`Encrypt` then fails for the whole batch, with an error naming the row, the field and the index. -So an optional or short value does not belong under `match`: give the field `equality` alone, or make the value required. +A `match` index stores text with no token (an empty string, separator-only text, or text shorter than the n-gram length of 3 characters) as the empty filter, which no query matches, so an optional or short value can live under `match`; the empty filter tells a reader of the column that the value is one of those. +A match query of such text is refused, because an empty filter as a query would match every row. +An EQL `TextMatch` field is stricter: see below. An index takes its options in parentheses after its name, separated by commas: `index=equality;match(k=3)`. This build refuses an index with options: a query term is derived with the default options only, so a stored term with other options would never match one. These words are the same as the Rust API's words for the same behaviour, with two that only Go has. @@ -123,7 +123,12 @@ For `-type User`, the file `user_stash.go` holds: - `Encrypt` and `Decrypt`, which take a slice and return a slice, and send one ZeroKMS request for each 500 sealed values in it, plus one the first time a keyset is used. - `Fields`, with one entry for each sealed field. An opaque struct, or a struct with no sealed field outside an opaque one, gets no `Fields`: nothing in it is sealed on its own, so nothing can be queried. - An entry encrypts one value, and it has a query method only for what the field declares: `Query` for `encrypt_into`, and `Equality`, `Match`, `Ore` or `Ope` for `index=`. + An entry encrypts one value, and has one query method for each operator the engine answers on the field: `Eq`, `Lt`, `Lte`, `Gt`, `Gte`, `Between` or `Matches`. + stashgen asks the embedded engine which operators each field answers, and which index answers each one, so it holds no copy of those rules: an equality index answers `Eq`, a match index on a string `Matches`, and an ORE or OPE index on an integer, a float or a string the four orderings and `Between`, through ORE when the field declares both. A float orders as PostgreSQL's `float8` does (`-0.0` ties `0.0`, NaN sorts last), and a string by its folded form: case and accents folded, under Unicode 16. + `encrypt_into=TextEq` answers `Eq`, which returns the type's query value, `eql.TextEqQuery`. + `encrypt_into=TextMatch` answers `Matches`, which returns an `encrypt.EQLMatchQuery`: the `eql.TextMatchQuery` operand, with `Verify` and `TargetLimit`. + The query of `Matches` carries `Verify` and `TargetLimit`, because its answer can hold rows that do not match; an exact operator's query carries neither. + See the encrypt package's README for each method's result and the query with `database/sql`. - `String` and `LogValue` on `EncryptedUser`, which print the passthrough fields and hide the sealed ones. - A copy of the fields of `User`, so a change to them stops the build. @@ -149,7 +154,29 @@ The same input always gives the same file: fields keep their declared order, and `stashgen` checks each declaration with the engine, and holds no copy of the engine's rules: it runs the WASI guest the SDK embeds and asks it, one field at a time, so the error names the field. It asks the engine for the EQL types it holds: each name, its plaintext type, its indexes, its query form, and whether the engine produces it today. The command links the build of the engine that holds the EQL types (`encrypt/eql`), so it can answer for every type; a generated file imports `encrypt/eql` only when it names one. -The engine produces `TextEq` today; `encrypt_into` with any other type is refused with the type's name. +The engine produces these EQL types today, each from one Go field type: + +| `encrypt_into` | Go field | +|---|---| +| `TextEq`, `Text`, `TextMatch`, `TextOrd`, `TextOrdOpe` | `string` | +| `Smallint`, `SmallintEq`, `SmallintOrd`, `SmallintOrdOpe` | `int16`, or any Go integer type | +| `Integer`, `IntegerEq`, `IntegerOrd`, `IntegerOrdOpe` | `int32`, or any Go integer type | +| `Bigint`, `BigintEq`, `BigintOrd`, `BigintOrdOpe` | `int64`, or any Go integer type | +| `Boolean` | `bool` | +| `Real`, `RealEq`, `RealOrd`, `RealOrdOpe` | `float32` | +| `Double`, `DoubleEq`, `DoubleOrd`, `DoubleOrdOpe` | `float64` | +| `Date`, `DateEq` | `encrypt.Date` | +| `Timestamp`, `TimestampEq` | `time.Time` | +| `Numeric`, `NumericEq` | `encrypt.Decimal` | + +The `Eq` types answer `Eq`; the `Ord` and `OrdOpe` types answer `Lt`, `Lte`, `Gt` and `Gte`, and on text `Eq` too; `Text`, `Smallint`, `Integer`, `Bigint`, `Boolean`, `Real`, `Double`, `Date`, `Timestamp` and `Numeric` are stored and read only, with no query method. +The ordered date, timestamp and numeric types are refused: the engine derives no order term for these kinds yet. +An ordered type has no `Between` method yet, because a `BETWEEN` operand needs EQL v4's range query domains. + +Any built-in Go integer field takes an integer type (ADR-0002) and seals at the type's width: an `int16` field always fits an `Integer`, and an `int64` field is range checked value by value, `Encrypt` refusing a value that does not fit with `encrypt.ErrEncoding`. `encrypt.Int128` and `encrypt.Uint128` are not converted. A float's width must match: a `float64` field is not a `Real`. +A `TextMatch` field refuses text shorter than three characters, such as an empty string or a two-letter code, because it has no 3-grams to index; its query refuses such text too. +Put the column on the left of `@@` (`WHERE name @@ $1::eql_v4.query_text_match`): the other operand order finds nothing until #1171 is fixed. +`encrypt_into` with any other type is refused with the type's name and the reason it is not produced yet. Separate columns work today for four indexes: `equality`, `match`, `ore` and `ope`. A field with `encrypt_into` is stored under its table and column, which is what an EQL value records in its `i`. @@ -219,10 +246,13 @@ No warning, error or log line holds a plaintext value. ## What crosses the binding Generated code sends the engine every sealed field with its value, under the declaration lowered to data: each field's label (`/`), its outputs and its wire type (`int64`, `string`, `bytes`, ...), which `stashgen` chose from the field's Go type. -A passthrough field stays on the host: the engine does nothing to it a program could observe, and the FFI codec cannot carry every Go type a program stores beside a ciphertext. +A passthrough field stays on the host: the engine does nothing to it a program could observe, and the FFI codec cannot carry every Go type a program stores beside a ciphertext (a `driver.Valuer`, a `sql.NullTime`). An `opaque` struct crosses as one JSON document and is one column, decoded back into the exact Go types the struct declares; a field may be any type `encoding/json` carries both ways (a scalar or a type defined over one, `[]byte`, slices, maps with string or integer keys, pointers, structs whose fields are all exported, `time.Time`). A float in an opaque struct must be finite: `encoding/json` refuses NaN and the infinities, so `Encrypt` fails for the batch with `encrypt.ErrEncoding`. A sealed float field outside an opaque struct carries them. A sealed field outside an opaque struct is one scalar, or a type defined over one; a struct, slice or map field seals only inside an opaque struct. +The scalars are `string`, `[]byte`, `bool`, every integer type (each sealed at its own width, `int` and `uint` as 64-bit), `encrypt.Int128` and `encrypt.Uint128`, `float32`, `float64`, `encrypt.Decimal`, `encrypt.Date` and `time.Time` (a timestamp). The wire type `stashgen` writes for each is the field's own: `int8` is `gensupport.Int8`, `time.Time` is `gensupport.Timestamp`, and so on. +An order index (`ore`, `ope`) on a decimal, date or timestamp is refused: those order terms wait for new cllw-ore and ore-rs releases (#1236). +The zero `encrypt.Date` is not a date: a date field must be set, and `Encrypt` refuses a zero one with `encrypt.ErrEncoding`, naming the field. A sealed field cannot be a pointer (`*encrypt.Date` is refused as a composite), so an optional date has no sealed form yet: keep it in an opaque struct, or store a sentinel date. A nil `[]byte` in a sealed field, or a nil slice of a type defined over `[]byte`, comes back from `Decrypt` as an empty, non-nil slice; inside an opaque struct, nil comes back as nil. A protobuf message with a `oneof` cannot be generated from a policy: protoc-gen-go puts its members in wrapper types, not in the message struct, and `Generate` refuses it. diff --git a/languages/golang/cmd/stashgen/main_test.go b/languages/golang/cmd/stashgen/main_test.go index b832fcb4f..a9558ab1a 100644 --- a/languages/golang/cmd/stashgen/main_test.go +++ b/languages/golang/cmd/stashgen/main_test.go @@ -142,7 +142,7 @@ func TestRunAsksTheEmbeddedEngine(t *testing.T) { t.Fatalf("the generated file does not name the EQL type:\n%s", written) } // A type the engine cannot produce yet: refused by name, nothing written. - unproducible := strings.Replace(userSource, "encrypt_into=TextEq", "encrypt_into=TextMatch", 1) + unproducible := strings.Replace(userSource, "encrypt_into=TextEq", "encrypt_into=TextOrdOre", 1) dir = writeModule(t, map[string]string{"model.go": unproducible}) stderr.Reset() if code := run([]string{"-type", "User"}, dir, &stdout, &stderr, stashgen.GuestEngine); code != 1 { @@ -150,7 +150,7 @@ func TestRunAsksTheEmbeddedEngine(t *testing.T) { } // Refused by the generator with the engine's reason, before the engine // is asked: se_targets lists the type as not producible. - if !strings.Contains(stderr.String(), "cannot produce the EQL type TextMatch yet") { + if !strings.Contains(stderr.String(), "cannot produce the EQL type TextOrdOre yet") { t.Fatalf("stderr = %q", stderr.String()) } if _, err := os.Stat(filepath.Join(dir, "user_stash.go")); !os.IsNotExist(err) { diff --git a/languages/golang/encrypt/README.md b/languages/golang/encrypt/README.md index 6f8f51904..e7ff591eb 100644 --- a/languages/golang/encrypt/README.md +++ b/languages/golang/encrypt/README.md @@ -31,11 +31,15 @@ The package reference is on [pkg.go.dev]; the generator's reference is type User struct { _ struct{} `stash:"context=users"` ID int64 `stash:"id,passthrough"` - Email string `stash:"email,encrypt,index=equality;match"` - Age uint32 `stash:"age,encrypt,index=equality;ore"` + Email string `stash:"email,encrypt_into=TextEq"` + Name string `stash:"name,encrypt_into=TextMatch"` + Age int32 `stash:"age,encrypt_into=Integer"` } ``` + `encrypt_into=` names the EQL type the field is stored as. The Go field + type must match it; see [EQL columns](#eql-columns). + 3. Run the generator. It writes `user_stash.go` beside the struct. ```sh @@ -56,17 +60,28 @@ The package reference is on [pkg.go.dev]; the generator's reference is encrypted, err := users.Encrypt(ctx, cipher, people) opened, err := users.Decrypt(ctx, cipher, encrypted) - term, err := users.Fields.Email.Equality(ctx, cipher, "bob@example.com") + term, err := users.Fields.Email.Eq(ctx, cipher, "bob@example.com") ``` `Encrypt` and `Decrypt` send one ZeroKMS request for each 500 sealed values in the batch, plus one request the first time a keyset is used. + A query derives its term locally and sends no request of its own; only + the first use of a keyset, by a query or anything else, loads it from + ZeroKMS. See [Queries](#queries). + +6. Store the encrypted type. Each `encrypt_into` field is one EQL v4 column: + `eql.TextEq` implements `driver.Valuer` and `sql.Scanner`, so a database + library binds and scans it as the JSON a `public.eql_v4_text_eq` column + holds. Install EQL v4 into PostgreSQL first, with the + `eql-v4-install.sql` attached to the release. A query casts its parameter + to the column's query type: + + ```sql + SELECT id, email, name, age FROM users WHERE email = $1::eql_v4.query_text_eq + ``` -6. Store the encrypted type. Each sealed field is one or more byte columns: - `e.Email.Ciphertext`, `e.Email.Equality`, `e.Email.Match`. `Ciphertext` - and each term type implement `driver.Valuer` and `sql.Scanner`, so a - database library binds and scans each column as bytes; map each one to - its own column. + A field tagged `encrypt` or `index=` stores its ciphertext and each term + as separate byte columns instead; see [What is stored](#what-is-stored). 7. Run the generator again after each change to the struct or to a tag. A change to the fields of the struct stops the build until you do. @@ -80,14 +95,18 @@ The package reference is on [pkg.go.dev]; the generator's reference is `git diff` sees only files git already tracks; the `git status` check also fails on a generated file that was never committed. -The rest of this file is the reference. [`example/`](example/) is the eight -steps as a program. +The rest of this file is the reference. [`example/`](example/) is a program +that stores separate byte columns (`index=`) against real ZeroKMS. ## Connect A `Client` is one ZeroKMS client: its client key, its default keyset, and the keysets it has loaded since. Make one per process and share it; it is safe -for concurrent use. +for concurrent use. The guest runs one call at a time, but never holds the +client across a ZeroKMS round trip: a call that needs ZeroKMS hands its +request to the client, which performs it with the client free for other +callers, and then carries on. A call whose context ends while its request +is in flight returns the context's error and leaves the client open. ```go client, err := encrypt.NewClient(ctx) @@ -102,6 +121,25 @@ ZeroKMS round trip `NewClient` makes. It has nothing to do with an *encryption* context, which is what a field is sealed under; that is the `context=` tag. +Every call takes a `ctx` too, and a call whose `ctx` is cancelled or passes +its deadline fails with the context's error. Only that call fails: one +request giving up never closes the shared client for the others. + +- A call waiting for the client (it runs one call at a time) leaves the + queue when its `ctx` ends, and never starts. +- A call waiting on ZeroKMS has that request cancelled. Its error matches + both `context.Canceled` or `context.DeadlineExceeded` and `ErrTransport`. +- A call waiting on its auth strategy for a token returns too, with the + context's error. If the strategy is refreshing a device session, the + refresh finishes in the background, for up to 10 seconds. The service + rotates the refresh token when it answers, and dropping that answer + would leave the strategy unable to refresh. + +A client closes itself, and every later call returns `ErrState`, only when +the guest's state is unknown: the guest trapped, or a call ran on for 30 +seconds after its `ctx` ended, which means a bug. A service that sees +`ErrState` from a client it did not close builds a new one. + Every other setting is a functional option with a default: ```go @@ -190,15 +228,56 @@ and `Equality`, `Match`, `Ore` or `Ope` (the term types). A field with An `opaque` struct is one `Sealed` field. Every stored type implements `driver.Valuer` and `sql.Scanner`. -A `match` index needs text with at least one token. The engine derives no -match term for an empty string, separator-only text, or text shorter than the -n-gram length (3 characters), because an empty term would match every row. -`Encrypt` then fails for the whole batch with `ErrTerm`, naming the row, the -field and the index. So an optional or short value does not belong under -`match`: give such a field `equality` alone, or make the value required. +A sealed field outside an opaque struct is one value of one of these types, +or a type defined over one (`type Email string`): + +| Go field | Seals as | Indexes it can store | Query methods | +|---|---|---|---| +| `string` | text | `equality`, `match`, `ore`, `ope` | `Eq`, `Matches`, `Lt`, `Lte`, `Gt`, `Gte`, `Between` | +| `[]byte` | bytes | `equality`, `ore`, `ope` | `Eq` | +| `bool` | a boolean | none | none | +| `int16`, `int32`, `int64`, `int` | an integer of the field's own width (`int` is 64-bit) | `equality`, `ore`, `ope` | `Eq`, `Lt`, `Lte`, `Gt`, `Gte`, `Between` | +| `uint16`, `uint32`, `uint64`, `uint` | the same, unsigned | `equality`, `ore`, `ope` | the same | +| `int8`, `uint8` (`byte`) | an 8-bit integer | `equality` | `Eq` | +| `encrypt.Int128`, `encrypt.Uint128` | a 128-bit integer | `equality`, `ore`, `ope` | the same | +| `float32`, `float64` | a float of its width | `equality`, `ore`, `ope` | `Eq`, `Lt`, `Lte`, `Gt`, `Gte`, `Between` | +| `encrypt.Decimal` | a decimal: a 96-bit coefficient and a scale up to 28 | `equality` | `Eq` | +| `encrypt.Date` | a calendar date | `equality` | `Eq` | +| `time.Time` | a timestamp, to the nanosecond, in UTC | `equality` | `Eq` | + +Each query method needs its index declared. An `ore` or `ope` index on bytes +stores its term, but the engine answers no ordering through it, so such a +field has no `Lt` (see [Queries](#queries)). + +`encrypt.Date`, `Int128`, `Uint128` and `Decimal` are vitaminc's `vcvalue` +types; build them with `encrypt.DateOf`, `ParseInt128`, `ParseUint128` and +`ParseDecimal` (which refuses NaN and the infinities). A `time.Time` opens in +UTC: compare it with `Equal`, not `==`. A decimal opens at the scale it was +sealed with, but a zero has no sign: `-0.00` opens as `0.00`. The zero +`encrypt.Date` is not a date, and `Encrypt` or a query refuses it with +`ErrEncoding`, naming the field; so is a decimal or a `time.Time` outside +vitaminc's range. A sealed field cannot be a pointer, so an optional date has +no sealed form yet: keep it in an opaque struct, or use a sentinel date. Each integer type seals at its own +width, and each width is passed to the order scheme as itself, so an `int16` +field's terms are an `int16`'s. An `int8` or `uint8` field has no order +index: with 256 values, an order term would rank every row among 256, which +a few known rows resolve to the values, as a `bool`'s would say which rows +are true. Equality follows vitaminc's normalisation: an +integer equals itself at every width, decimals compare at any scale +(`1.50 = 1.5`), and a timestamp compares to the microsecond, truncated, never rounded. An order index on +a decimal, date or timestamp is refused for now: the engine derives no +order term for those kinds yet. + +A `match` index stores text with no token (an empty string, separator-only +text, or text shorter than the n-gram length of 3 characters) as the empty +filter: a valid value that no query matches, so an optional or short value can +live under `match`. The empty filter tells anyone who can read the column that +the value is one of those. A match *query* of such text is refused with +`ErrTerm`, because an empty filter as a query would match every row. An EQL +`TextMatch` field is stricter, as "EQL columns" below says. Terms are byte-equal to the ones the Rust crate derives, so a term from -`users.Fields.Email.Equality` compares against a stored term written from any +`users.Fields.Email.Eq` compares against a stored term written from any language. `EqualityTerm.Equal` compares in constant time; `OreTerm.Compare` and `OpeTerm.Compare` order as the plaintexts; `MatchTerm.Positions` decodes the token positions. @@ -211,8 +290,122 @@ A database can compare some terms by itself: - `Ore`: do not compare in SQL. Plain byte order is almost always right, and sometimes wrong, with no error. Compare in Go with `OreTerm.Compare`, or use an EQL type (`encrypt_into=`), which the database compares correctly. -- `Match`: do not compare in SQL. Decode the positions in Go with - `MatchTerm.Positions`, or use an EQL type. +- `Match`: a row matches when its stored filter holds every position of the + query's term. Decode both into positions in SQL and compare with `@>`, as + [Queries](#queries) shows, or in Go with `MatchTerm.Positions`. + +## Queries + +Each sealed field's entry in `Fields` has one method for each operator the +engine answers on the field: `Eq`, `Lt`, `Lte`, `Gt`, `Gte`, `Between` and +`Matches`. A field has no method for an operator it does not answer, so such +a query does not compile. The generator asks the engine which operators each +field answers, and which index answers each one; it holds no copy of those +rules. + +| The field declares | Methods | Each returns | +|---|---|---| +| `index=equality` | `Eq` | `encrypt.EqualityTerm` | +| `index=ore` or `index=ope`, on an integer of 16 bits or wider or a string | `Lt`, `Lte`, `Gt`, `Gte` | `encrypt.OreTerm`, or `encrypt.OpeTerm` when the field declares no `ore` | +| the same | `Between(ctx, cipher, lo, hi)` | `encrypt.Range[encrypt.OreTerm]` or `encrypt.Range[encrypt.OpeTerm]`, the two bounds' terms | +| `index=match`, on a string | `Matches` | `encrypt.MatchQuery[T]` | +| `encrypt_into=TextEq` | `Eq` | `eql.TextEqQuery` | +| `encrypt_into=TextMatch` | `Matches` | `encrypt.EQLMatchQuery[eql.TextMatchQuery, T]` | + +A method takes the field's own Go type, so `Fields.Age.Lt` on a `uint32` +field takes a `uint32`. + +Text orders by its folded form (ADR-0002): case and accents are folded and +`ß` becomes `ss`, under Unicode 16. So `Café`, `cafe` and `CAFÉ` are one +value and tie, `alice` orders before `Zoe`, and `é` orders with `e`, not +after `z`. `Between` is inclusive at both ends and, as SQL's `BETWEEN`, +does not refuse a range whose low bound is above its high bound: such a +range matches nothing. So `Between("b", "A")` matches nothing, since `A` +folds to `a`, below `b`. Text holding a code point Unicode 16 does not assign has no +fold, and its query or write is refused with `encrypt.ErrTerm`. + +Floats order as PostgreSQL's `float8` does (ADR-0002): `-0.0` and `0.0` are +one value, and every NaN is one value, above `+Inf`, so `Between(math.NaN(), +math.Inf(1))` matches nothing. A `float32` orders as the `float64` it +widens to. + +An order index on bytes stores its term but answers no ordering +operator, so such a field has no `Lt`; nor does the `ope` index of a field +that declares `ore` too, since `ore` answers the orderings. stashgen prints a notice for each such index, on stderr and in +the generated file: the terms are stored, and only your own code can compare +them. A match index on an index-only field (`index=match` with no `encrypt`) +is refused, because `Verify` checks a match query's rows by decrypting them. + +Every query type implements `driver.Valuer`, so it binds as a parameter in +any library built on `database/sql` or pgx. A `Range` binds as two +parameters, `Low` and `High`. On an EQL column a range is one value instead: +package `encrypt/eql` has a range query type per ordered family and order +index (`eql.IntegerRangeOreQuery`, `eql.TextRangeOpeQuery`, ...), the one +operand of `eql_v4.between(column, $1::eql_v4.query_integer_range_ore)`. Keep +the cast to the exact range domain: an uncast `$1`, a `jsonb` parameter, or a +range of another term or family fails with SQLSTATE 42725 ("function ... is +not unique"), unlike the single-bound operators, which resolve an untyped +`$1`. No generated method returns one yet, because the ordered EQL types are +not producible. + +`Eq`, the orderings and `Between` are exact: the server's answer is the +answer. `Matches` is probabilistic: the server answers with every row whose +stored filter holds the query's bits, which can include rows that do not +hold the query's text. So `MatchQuery` carries two more methods, and an +exact query's type carries neither (on an `encrypt_into=TextMatch` field, +`Matches` returns an `encrypt.EQLMatchQuery`, the `eql.TextMatchQuery` +operand with the same two): + +- `TargetLimit(ctx, want, stats)` is how many rows to fetch for `want` of + them to verify. A field declared with tags states no expected number of + tokens, so with no measured histogram of the stored filters in + `encrypt.Stats` the limit is unbounded, and `Limit.FetchOr(page)` fetches + a page. +- `Verify(ctx, values)` says, for each decrypted value of a page, whether it + really holds the query's text: one call into the engine for the page, with + no key. + +The example below uses separate byte columns, as [`example/`](example/) +declares its fields (`Email` with `stash:"email,encrypt,index=equality;match"`, +`Age` with `stash:"age,encrypt,index=equality;ore"`), not the `encrypt_into` +`User` of the quick start: + +```go +// Positions of a stored filter or a match term, for @>. +const positions = `CREATE FUNCTION match_positions(term bytea) RETURNS int[] +LANGUAGE sql IMMUTABLE STRICT AS $$ + SELECT coalesce(array_agg(get_byte(term, 2 * i) | (get_byte(term, 2 * i + 1) << 8)), '{}') + FROM generate_series(0, length(term) / 2 - 1) AS i +$$` + +q, err := users.Fields.Email.Matches(ctx, cipher, "alice") +limit, err := q.TargetLimit(ctx, 10, encrypt.Stats{Rows: rowCount}) + +rows, err := db.QueryContext(ctx, ` + SELECT id, email, email_eq, email_match, age, age_eq, age_ore FROM users + WHERE match_positions(email_match) @> match_positions($1) + ORDER BY id LIMIT $2`, q, limit.FetchOr(50)) +// scan each row into a users.Encrypted, then +people, err := users.Decrypt(ctx, cipher, encrypted) +emails := make([]string, len(people)) +for i, p := range people { + emails[i] = p.Email +} +verified, err := q.Verify(ctx, emails) +hits := people[:0] +for i, p := range people { + if verified[i] { + hits = append(hits, p) + } +} +``` + +`Verify` cuts the query's text into tokens again in the engine, with the +field's own tokenizer, so a `MatchQuery` keeps that text for as long as the +program holds the query. Go cannot wipe a string: the text stays in memory +until the garbage collector reclaims it, as the string you passed in does. +A `MatchQuery` never prints it; `fmt`, `slog` and `%#v` show the field and +the size of the term only. ## Errors @@ -229,7 +422,11 @@ or for stored data. Check an error two ways. its field's context (ZeroKMS refuses the key, or the AEAD fails). - `ErrEncoding`: a stored value or a call that does not fit the declaration. - `ErrUnauthorized`, `ErrNotFound`, `ErrTransport`, `ErrKMS`: ZeroKMS. -- `ErrState`: a call on a closed client. `ErrMemoryLock`: see below. +- `ErrState`: a call on a closed client: you closed it, or the guest + trapped or ran on long after a call's context ended (see Connect). + `ErrMemoryLock`: see below. +- `context.Canceled`, `context.DeadlineExceeded`: the call's `ctx` ended. + The client is still open. `errors.As` with a `*Diagnostic` gives you the detail behind a failure the engine reports: a stable `Code` (`stack_encrypt::foreign_keyset`, @@ -276,12 +473,97 @@ package documentation for the full account. ## EQL columns A field tagged `encrypt_into=TextEq` is stored as one EQL value, the JSON -PostgreSQL holds in a `public.eql_v3_text_eq` column, as an `eql.TextEq` -from package `encrypt/eql`. The guest builds the value: the generated code +PostgreSQL holds in a `public.eql_v4_text_eq` column, as an `eql.TextEq` +from package `encrypt/eql`. Stack Encrypt writes EQL v4, the `eql_v4` install +of EQL's SQL; the `eql_v3` columns the TypeScript SDK writes hold +cipherstash-client's terms, which these never match. Install EQL v4 into +PostgreSQL first, with the `eql-v4-install.sql` attached to each Go release +(`psql -f eql-v4-install.sql`); `stash eql install` installs EQL v3 only, and +an `eql_v4_*` column needs the v4 domains. + +The EQL types the engine produces, and the Go field types each takes: + +| EQL type | Go field | Queries | +|---|---|---| +| `TextEq` | `string` | `=`, `<>` | +| `TextMatch` | `string` | `@@` (substring match, 3-grams, case-insensitive) | +| `TextOrd`, `TextOrdOpe` | `string` | `=`, `<>`, `<`, `<=`, `>`, `>=`, `ORDER BY` | +| `Text` | `string` | none: stored and read only | +| `Smallint` | `int16`, or any Go integer type (see below) | none | +| `SmallintEq` | the same | `=`, `<>` | +| `SmallintOrd`, `SmallintOrdOpe` | the same | `=`, `<>`, `<`, `<=`, `>`, `>=`, `ORDER BY` | +| `Integer` | `int32`, or any Go integer type (see below) | none | +| `IntegerEq` | the same | `=`, `<>` | +| `IntegerOrd`, `IntegerOrdOpe` | the same | `=`, `<>`, `<`, `<=`, `>`, `>=`, `ORDER BY` | +| `Bigint` | `int64`, or any Go integer type | none | +| `BigintEq` | the same | `=`, `<>` | +| `BigintOrd`, `BigintOrdOpe` | the same | `=`, `<>`, `<`, `<=`, `>`, `>=`, `ORDER BY` | +| `Boolean` | `bool` | none | +| `Real` | `float32` | none | +| `RealEq` | `float32` | `=`, `<>` | +| `RealOrd`, `RealOrdOpe` | `float32` | `=`, `<>`, `<`, `<=`, `>`, `>=`, `ORDER BY` | +| `Double` | `float64` | none | +| `DoubleEq` | `float64` | `=`, `<>` | +| `DoubleOrd`, `DoubleOrdOpe` | `float64` | `=`, `<>`, `<`, `<=`, `>`, `>=`, `ORDER BY` | +| `Date` | `encrypt.Date` | none | +| `DateEq` | `encrypt.Date` | `=`, `<>` | +| `Timestamp` | `time.Time` | none | +| `TimestampEq` | `time.Time` | `=`, `<>` (to the microsecond, truncated) | +| `Numeric` | `encrypt.Decimal` | none | +| `NumericEq` | `encrypt.Decimal` | `=`, `<>` (`1.5 = 1.50`) | + +Any built-in Go integer field takes an integer EQL type (ADR-0002): the field +is sealed at the type's width, and opens back into the field's type. A type +every value of which fits (an `int16` or a `uint16` field for `Integer`, an +`int8` for `Smallint`) +always seals; a wider one (an `int64` or a `uint32` field for `Integer`) is +range checked value by value, and `Encrypt` refuses a value that does not fit +with `ErrEncoding`, naming the field's kind and not the value. +`encrypt.Int128` and `encrypt.Uint128` are not converted, and floats take +exactly their own width. + +A `TextMatch` value must be at least three characters long: shorter text has +no 3-grams to index and is refused. The number equality types compare as +PostgreSQL compares the plain types: an integer equals itself whatever its +width, and for floats `-0.0 = 0.0` and `NaN = NaN`; the stored value still +decrypts to exactly what was written. The same holds for the date, +timestamp and numeric types: `NumericEq` normalises the scale, so `1.5` and +`1.50` are equal, and `TimestampEq` compares to the microsecond, truncating +(never rounding) the nanoseconds below it, so two instants in one +microsecond are equal; each still opens as it was written, a +decimal with its scale and a `time.Time` with its nanoseconds, in UTC. A +`time.Time` is sealed as its instant, whatever its location. A zero +`encrypt.Date`, a date or instant outside years -262143 to 262142 and a +decimal with more than 28 digits after the point are refused with +`ErrEncoding`. The ordered date, timestamp and numeric types are not +produced yet: the engine derives no order term for these kinds. + +The `Ord` and `OrdOpe` types store an OPE term, which EQL compares as bytes, +and order by ADR-0002's order key: integers by value, floats as PostgreSQL's +`float8` sorts them (`-0.0` ties `0.0`, every NaN is one value after +`+Infinity`), text by its fold (case and accents folded, under Unicode 16). +A field gets `Lt`, `Lte`, `Gt` and `Gte`, and a text field `Eq` too; sort +with `ORDER BY eql_v4.ord_term(col)`. `ord_term` returns a `bytea` domain, so +a plain functional btree index, `CREATE INDEX ON t (eql_v4.ord_term(col))`, +serves `<`, `>` and `ORDER BY` with no operator class. That is why these +types work on an install without superuser rights, where the ORE operator +class is skipped. On a number column SQL's `=` compares +the order term; stashgen writes no `Eq` method for one yet, since the engine +answers `Eq` through an equality term only. A text order type also stores +`TextEq`'s equality term, and `=` reads that, so `Café` and `cafe` are +neither `<` nor `>` each other and not `=` either. Text holding a code point +Unicode 16 does not assign has no order term and is refused. There is no +`Between` method yet: a `BETWEEN` needs EQL v4's range query domains. The rest of +the catalog (ORE ordering, ordered dates, timestamps and decimals, JSON) is listed in +`eql.Types` with the reason it is not produced yet, and `stashgen` refuses it +with that reason. The guest builds the value: the generated code imports `encrypt/eql`, which embeds the build of the engine that holds the EQL types and registers it on import, so the program runs that build and -stores what it returns. `Fields.Email.Query` returns the `eql.TextEqQuery` -the column's `eql_v3.query_text_eq` operand takes. `mise run +stores what it returns. `Fields.Email.Eq` returns the `eql.TextEqQuery` +the column's `eql_v4.query_text_eq` operand takes; `TextEq` answers `eq` +alone, and a `TextMatch` field's `Matches` returns an +`encrypt.EQLMatchQuery`: the `eql.TextMatchQuery` operand with `Verify` and +`TargetLimit`. `mise run wasm:guest:build:eql` builds that guest beside the other. A cipher extended with a tenant part refuses a struct with an `encrypt_into` field: an EQL value is stored under a table and a column, and the extended label has no diff --git a/languages/golang/encrypt/cancel_test.go b/languages/golang/encrypt/cancel_test.go new file mode 100644 index 000000000..0e7d7018a --- /dev/null +++ b/languages/golang/encrypt/cancel_test.go @@ -0,0 +1,484 @@ +package encrypt + +import ( + "context" + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "io" + "math/rand/v2" + "net/http" + "net/http/httptest" + "runtime" + "strings" + "sync" + "sync/atomic" + "testing" + "time" + + "github.com/cipherstash/stack/languages/golang/auth" + "github.com/cipherstash/stack/languages/golang/internal/guest" + "github.com/cipherstash/stack/languages/golang/internal/record" +) + +// One encrypt.Client serves every request in a service, so a caller's +// context ending must fail that caller's call and nothing else. These tests +// pin that contract, and the one case that still closes the client: a guest +// that runs on long after its caller gave up. + +// unauthorized answers every ZeroKMS request with a 401: a full round trip +// through the guest's network path that ends in a status the client can +// tell apart from ErrState. +func unauthorized(*http.Request) (*http.Response, error) { + return &http.Response{StatusCode: http.StatusUnauthorized, Body: io.NopCloser(strings.NewReader("nope")), Header: http.Header{}}, nil +} + +// switchable is a RoundTripper whose behaviour a test changes between calls. +type switchable struct { + mu sync.Mutex + rt roundTripFunc + sent atomic.Int32 +} + +func (s *switchable) set(rt roundTripFunc) { + s.mu.Lock() + defer s.mu.Unlock() + s.rt = rt +} + +func (s *switchable) RoundTrip(r *http.Request) (*http.Response, error) { + s.sent.Add(1) + s.mu.Lock() + rt := s.rt + s.mu.Unlock() + return rt(r) +} + +// cancelClient is a guest not yet given a key, whose ZeroKMS requests go to +// rt and whose token comes from token. Its se_cipher_init is the call the +// tests drive: it pauses on a load-keyset request, so it reaches the +// network between two steps. +func cancelClient(t *testing.T, rt http.RoundTripper, token tokenSource) *Client { + t.Helper() + tr := &transport{rt: rt, token: token} + inst, err := newInstance(context.Background(), guestOrSkip(t), tr, guest.BestEffort) + if err != nil { + t.Fatal(err) + } + c := newClient(inst, tr) + t.Cleanup(func() { _ = c.Close() }) + return c +} + +// cipherInit runs se_cipher_init on c under ctx. +func cipherInit(ctx context.Context, c *Client) error { + encoded, err := encodeConfig(testInit("http://zerokms.invalid")) + if err != nil { + return err + } + defer wipe(encoded) + _, err = c.callKMS(ctx, func(ctx context.Context, inst *instance) ([]byte, error) { + return inst.call(ctx, inst.cipherInit, buf(encoded)) + }) + return err +} + +// wantOpen fails the test unless c is still open: its next call reaches +// ZeroKMS and comes back with ZeroKMS's answer, not ErrState. +func wantOpen(t *testing.T, c *Client, rt *switchable) { + t.Helper() + if c.closed || c.inst.module.IsClosed() { + t.Fatal("the client was closed") + } + rt.set(unauthorized) + if err := cipherInit(context.Background(), c); !errors.Is(err, ErrUnauthorized) { + t.Fatalf("the next call: %v, want ErrUnauthorized from ZeroKMS", err) + } +} + +// The request runs between two steps, under the caller's context, with the +// guest paused: cancelling it ends the call and aborts the paused +// operation, and the client stays open. +func TestACallCancelledBetweenStepsFailsOnlyItself(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + rt := &switchable{rt: func(r *http.Request) (*http.Response, error) { + // The caller gives up once its request is in flight. + cancel() + <-r.Context().Done() + return nil, r.Context().Err() + }} + c := cancelClient(t, rt, staticToken("t")) + err := cipherInit(ctx, c) + if !errors.Is(err, context.Canceled) || !errors.Is(err, ErrTransport) { + t.Fatalf("cancelled call: %v, want context.Canceled and ErrTransport", err) + } + wantOpen(t, c, rt) +} + +// The token is fetched before the operation's first step: a caller that +// gives up waiting on it never starts the operation. +func TestACallCancelledDuringATokenFetchFailsOnlyItself(t *testing.T) { + rt := &switchable{rt: unauthorized} + var blocking atomic.Bool + blocking.Store(true) + token := tokenFunc(func(ctx context.Context) (string, error) { + if blocking.Load() { + <-ctx.Done() + return "", ctx.Err() + } + return "t", nil + }) + c := cancelClient(t, rt, token) + ctx, cancel := context.WithCancel(context.Background()) + time.AfterFunc(50*time.Millisecond, cancel) + err := cipherInit(ctx, c) + if !errors.Is(err, context.Canceled) || errors.Is(err, ErrState) { + t.Fatalf("cancelled call: %v, want context.Canceled", err) + } + if n := rt.sent.Load(); n != 0 { + t.Fatalf("%d request(s) sent without a token", n) + } + blocking.Store(false) + wantOpen(t, c, rt) +} + +func TestACallWhoseContextEndsInTheQueueNeverReachesTheGuest(t *testing.T) { + rt := &switchable{rt: unauthorized} + c := cancelClient(t, rt, staticToken("t")) + + t.Run("ends while waiting", func(t *testing.T) { + // Another call holds the client: the slow ZeroKMS round trip the + // queue is waiting behind. + if err := c.mu.Acquire(context.Background()); err != nil { + t.Fatal(err) + } + released := make(chan struct{}) + time.AfterFunc(200*time.Millisecond, func() { c.mu.Unlock(); close(released) }) + ctx, cancel := context.WithTimeout(context.Background(), 20*time.Millisecond) + defer cancel() + err := cipherInit(ctx, c) + if !errors.Is(err, context.DeadlineExceeded) { + t.Fatalf("queued call: %v, want the deadline", err) + } + // It left at its deadline, not when the lock came free. + select { + case <-released: + t.Error("the queued call waited past its deadline for the lock") + default: + } + <-released + }) + t.Run("already ended", func(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + cancel() + if err := cipherInit(ctx, c); !errors.Is(err, context.Canceled) { + t.Fatalf("call with an ended context: %v, want context.Canceled", err) + } + }) + if n := rt.sent.Load(); n != 0 { + t.Fatalf("%d request(s) reached ZeroKMS from calls whose context had ended", n) + } + wantOpen(t, c, rt) +} + +// The backstop: a step still running long after its caller gave up is a +// guest or host function that ignores cancellation. Its state is unknown, +// so the client closes, and says so. The step here waits out its caller's +// context and the backstop and only then enters the guest, as a guest +// stuck in a loop would still be running when the backstop fired. +func TestAStepThatRunsOnAfterItsContextEndsClosesTheClient(t *testing.T) { + rt := &switchable{rt: unauthorized} + c := cancelClient(t, rt, staticToken("t")) + c.stuck = 20 * time.Millisecond + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + _, err := c.call(ctx, func(run context.Context, inst *instance) ([]byte, error) { + cancel() + <-run.Done() + return inst.call(run, inst.targets) + }) + if err == nil || !strings.Contains(err.Error(), "the client is closed") { + t.Fatalf("stuck call: %v, want the client closed", err) + } + if !errors.Is(err, context.Canceled) { + t.Errorf("stuck call: %v, want it to match context.Canceled", err) + } + if err := cipherInit(context.Background(), c); !errors.Is(err, ErrState) { + t.Fatalf("a call after the close: %v, want ErrState", err) + } +} + +// A request that ignores its context holds up only its own call: the guest +// is paused while it runs, so nothing is stuck, and the client stays open. +func TestARequestThatIgnoresItsContextLeavesTheClientOpen(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + rt := &switchable{rt: func(*http.Request) (*http.Response, error) { + // The caller gives up once its request is in flight, and the + // request runs on past the backstop regardless. + cancel() + time.Sleep(100 * time.Millisecond) + return unauthorized(nil) + }} + c := cancelClient(t, rt, staticToken("t")) + c.stuck = 20 * time.Millisecond + if err := cipherInit(ctx, c); !errors.Is(err, context.Canceled) || !errors.Is(err, ErrTransport) { + t.Fatalf("call: %v, want context.Canceled and ErrTransport", err) + } + wantOpen(t, c, rt) +} + +// A call that finishes in time stops the backstop: the client stays open +// however long after the call its context ends. +func TestAFinishedCallStopsTheBackstop(t *testing.T) { + rt := &switchable{rt: unauthorized} + c := cancelClient(t, rt, staticToken("t")) + c.stuck = time.Millisecond + ctx, cancel := context.WithCancel(context.Background()) + if err := cipherInit(ctx, c); !errors.Is(err, ErrUnauthorized) { + t.Fatalf("call: %v, want ErrUnauthorized", err) + } + cancel() + time.Sleep(20 * time.Millisecond) + wantOpen(t, c, rt) +} + +// Work the guest does without the network runs on through a cancellation, +// so a call can succeed after its caller gave up. It still fails with the +// context's error, and the output nobody will read is wiped. +func TestACallThatSucceedsAfterItsContextEndsFailsWithIt(t *testing.T) { + rt := &switchable{rt: unauthorized} + c := cancelClient(t, rt, staticToken("t")) + ctx, cancel := context.WithCancel(context.Background()) + plaintext := []byte("plaintext") + out, err := c.call(ctx, func(context.Context, *instance) ([]byte, error) { + cancel() + return plaintext, nil + }) + if !errors.Is(err, context.Canceled) || out != nil { + t.Fatalf("call: %q, %v, want no output and context.Canceled", out, err) + } + if string(plaintext) != string(make([]byte, len(plaintext))) { + t.Error("the discarded output was not wiped") + } + wantOpen(t, c, rt) +} + +// A step that pauses after its caller gave up sends no request: the +// operation is aborted in the guest, so its handle is spent, and the call +// fails with the context's error. +func TestAStepThatPausesAfterItsContextEndsSendsNothing(t *testing.T) { + rt := &switchable{rt: unauthorized} + c := cancelClient(t, rt, staticToken("t")) + encoded, err := encodeConfig(testInit("http://zerokms.invalid")) + if err != nil { + t.Fatal(err) + } + ctx, cancel := context.WithCancel(context.Background()) + _, err = c.callKMS(ctx, func(run context.Context, inst *instance) ([]byte, error) { + cancel() + return inst.call(run, inst.cipherInit, buf(encoded)) + }) + if !errors.Is(err, context.Canceled) || !errors.Is(err, ErrTransport) { + t.Fatalf("call: %v, want context.Canceled and ErrTransport", err) + } + if n := rt.sent.Load(); n != 0 { + t.Fatalf("%d request(s) sent for a caller that had given up", n) + } + if _, err := c.inst.call(context.Background(), c.inst.abort, scalar(1)); !errors.Is(err, ErrState) { + t.Fatalf("the paused operation's handle: %v, want ErrState (already dropped)", err) + } + wantOpen(t, c, rt) +} + +// A caller whose context ends while its resume waits for the client never +// resumes: the paused operation is still aborted in the guest once the +// client is free. +func TestAResumeWhoseContextEndsInTheQueueAbortsTheOperation(t *testing.T) { + stub := newHeldStub(t) + c := stepClient(t, staticToken("stub-token")) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + done := make(chan error, 1) + go func() { + _, err := c.callKMS(ctx, initStep(t, stub.URL)) + done <- err + }() + waitFor(t, stub.arrived, "the init's request") + // Another call holds the client when the response comes back. + if err := c.mu.Acquire(context.Background()); err != nil { + t.Fatal(err) + } + close(stub.release) + time.Sleep(50 * time.Millisecond) + cancel() + time.Sleep(20 * time.Millisecond) + c.mu.Unlock() + if err := <-done; !errors.Is(err, context.Canceled) { + t.Fatalf("call: %v, want context.Canceled", err) + } + if _, err := c.inst.call(context.Background(), c.inst.abort, scalar(1)); !errors.Is(err, ErrState) { + t.Fatalf("the paused operation's handle: %v, want ErrState (already dropped)", err) + } + if c.closed || c.inst.module.IsClosed() { + t.Fatal("giving up closed the client") + } +} + +// A closed module is ErrState, and Close still releases the runtime. +func TestAClosedModuleIsState(t *testing.T) { + ctx := context.Background() + c := rawInstance(t) + if err := c.inst.module.Close(ctx); err != nil { + t.Fatal(err) + } + if _, err := c.Keyset(KeysetName("k")).KeysetID(ctx); !errors.Is(err, ErrState) { + t.Fatalf("Keyset on a closed module: %v, want ErrState", err) + } + if err := c.Close(); err != nil { + t.Fatalf("Close after the module closed: %v", err) + } + // The close must reach the runtime. A stuck call closes the module and + // marks the client closed; a Close that treated that as "already done" + // would leave the runtime and the host module it carries allocated for + // the life of the process. + if !c.released { + t.Error("Close after the module closed left the runtime unreleased") + } + if m := c.inst.runtime.Module(transportModule); m != nil { + t.Errorf("host module %s is still registered after Close", transportModule) + } + // Still idempotent. + if err := c.Close(); err != nil { + t.Fatalf("second Close: %v", err) + } +} + +// Many callers share one client, as a service's requests do, and each call +// gets a deadline: none, already passed, or one that may pass in the queue +// or in the guest. The client never closes, every call whose context did +// not end succeeds, and nothing is left running afterwards. +func TestManyCallersCancellingAtRandomShareOneClient(t *testing.T) { + c, err := NewDeterministicClient(context.Background(), [32]byte{7}) + if errors.Is(err, ErrDeterministicGuestNotBuilt) { + t.Skip(err) + } + if err != nil { + t.Fatal(err) + } + defer c.Close() + cipher := c.DefaultKeyset() + plan := usersPlan() + before := runtime.NumGoroutine() + + const callers, calls = 16, 40 + var succeeded atomic.Int32 + var wg sync.WaitGroup + for g := range callers { + wg.Add(1) + go func() { + defer wg.Done() + r := rand.New(rand.NewPCG(uint64(g), 1)) + for i := range calls { + ctx, cancel := context.Background(), context.CancelFunc(func() {}) + switch r.IntN(4) { + case 0: // no deadline + case 1: + ctx, cancel = context.WithCancel(ctx) + cancel() + default: + ctx, cancel = context.WithTimeout(ctx, time.Duration(r.IntN(2000))*time.Microsecond) + } + rows := []record.Source{usersRow(uint32(i), "user@example.com")} + _, err := cipher.Seal(ctx, plan, rows) + ended := ctx.Err() != nil + cancel() + switch { + case errors.Is(err, ErrState): + t.Errorf("the client closed: %v", err) + return + case err == nil: + succeeded.Add(1) + case !ended: + t.Errorf("a call whose context did not end failed: %v", err) + case !errors.Is(err, context.Canceled) && !errors.Is(err, context.DeadlineExceeded): + t.Errorf("a cancelled call: %v, want the context's error", err) + } + } + }() + } + wg.Wait() + if succeeded.Load() == 0 { + t.Fatal("no call succeeded") + } + if _, err := cipher.Seal(context.Background(), plan, []record.Source{usersRow(1, "a@example.com")}); err != nil { + t.Fatalf("a call after the load: %v", err) + } + // Every backstop timer and context watcher has stopped. + deadline := time.Now().Add(2 * time.Second) + for runtime.NumGoroutine() > before && time.Now().Before(deadline) { + time.Sleep(10 * time.Millisecond) + } + if n := runtime.NumGoroutine(); n > before { + t.Errorf("%d goroutines after the load, %d before", n, before) + } +} + +// The encrypt client and the auth profile fail together or not at all: a +// call cancelled while the auth strategy exchanges its access key for a +// token leaves both open, and the next call gets a token and reaches +// ZeroKMS. +func TestACallCancelledDuringATokenExchangeLeavesTheProfileOpen(t *testing.T) { + var hold atomic.Bool + done := make(chan struct{}) + var jwt string + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + _, _ = io.Copy(io.Discard, r.Body) + if hold.Load() { + select { + case <-r.Context().Done(): + case <-done: + t.Error("a held token request was never cancelled") + } + return + } + fmt.Fprintf(w, `{"accessToken":%q,"expiry":%d}`, jwt, time.Now().Add(time.Hour).Unix()) + })) + t.Cleanup(server.Close) + t.Cleanup(func() { close(done) }) + claims, err := json.Marshal(map[string]any{"iss": server.URL, "sub": "CS|test", "workspace": "ZVATKW3VHMFG27DY", "exp": time.Now().Add(time.Hour).Unix()}) + if err != nil { + t.Fatal(err) + } + jwt = "e30." + base64.RawURLEncoding.EncodeToString(claims) + ".c2ln" + + store, err := auth.OpenWithoutProfile(context.Background()) + if errors.Is(err, auth.ErrGuestNotBuilt) { + t.Skip(err) + } + if err != nil { + t.Fatal(err) + } + defer store.Close() + strategy, err := store.AccessKey(context.Background(), testCRN, testAccessKey, auth.WithBaseURL(server.URL)) + if err != nil { + t.Fatal(err) + } + defer strategy.Close() + + rt := &switchable{rt: unauthorized} + c := cancelClient(t, rt, strategy) + hold.Store(true) + ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond) + defer cancel() + if err := cipherInit(ctx, c); !errors.Is(err, context.DeadlineExceeded) || errors.Is(err, ErrState) { + t.Fatalf("call cancelled during the exchange: %v, want the deadline", err) + } + hold.Store(false) + wantOpen(t, c, rt) + if n := rt.sent.Load(); n != 1 { + t.Fatalf("%d ZeroKMS request(s), want the one after the token arrived", n) + } +} diff --git a/languages/golang/encrypt/checker.go b/languages/golang/encrypt/checker.go index 7f3a99e25..a4ce1228d 100644 --- a/languages/golang/encrypt/checker.go +++ b/languages/golang/encrypt/checker.go @@ -57,7 +57,7 @@ func (k *Checker) engineCheck(ctx context.Context, plan *record.Plan) error { if err != nil { return fmt.Errorf("%w: %v", ErrEncoding, err) } - _, err = k.c.call(ctx, func(inst *instance) ([]byte, error) { + _, err = k.c.call(ctx, func(ctx context.Context, inst *instance) ([]byte, error) { return inst.call(ctx, inst.planCheck, buf(encoded)) }) return err @@ -66,7 +66,7 @@ func (k *Checker) engineCheck(ctx context.Context, plan *record.Plan) error { // Targets lists the EQL types this build of the engine produces: none until // the EQL target dispatch lands. func (k *Checker) Targets(ctx context.Context) ([]record.Target, error) { - out, err := k.c.call(ctx, func(inst *instance) ([]byte, error) { + out, err := k.c.call(ctx, func(ctx context.Context, inst *instance) ([]byte, error) { return inst.call(ctx, inst.targets) }) if err != nil { @@ -79,6 +79,37 @@ func (k *Checker) Targets(ctx context.Context) ([]record.Target, error) { return parseTargets(decoded) } +// Operators lists the operators one field of a plan answers, in the +// engine's order, each with its fidelity, its arity and the index that +// answers it: exactly the operators [Cipher.QueryTerm] derives a term for +// on that field, so stashgen writes one query method for each and holds no +// copy of which index answers which operator. A field the plan does not +// have is [ErrEncoding]. +func (k *Checker) Operators(ctx context.Context, plan *record.Plan, field string) ([]record.Operator, error) { + if err := plan.Validate(); err != nil { + return nil, fmt.Errorf("%w: %v", ErrEncoding, err) + } + encoded, err := vcffi.Marshal(plan.Wire()) + if err != nil { + return nil, fmt.Errorf("%w: %v", ErrEncoding, err) + } + out, err := k.c.call(ctx, func(ctx context.Context, inst *instance) ([]byte, error) { + return inst.call(ctx, inst.operators, buf(encoded), buf([]byte(field))) + }) + if err != nil { + return nil, err + } + decoded, err := vcffi.Unmarshal(out) + if err != nil { + return nil, fmt.Errorf("%w: %v", ErrInternal, err) + } + operators, err := parseOperators(decoded) + if err != nil { + return nil, fmt.Errorf("%w: se_operators: %v", ErrInternal, err) + } + return operators, nil +} + // parseTargets reads se_targets's decoded value: {"targets": [entry, ...]}, // each entry an object with exactly the keys record.Target documents. The // shape is a contract between eql-bindings' serialiser and this reader, so @@ -165,6 +196,8 @@ func parseTarget(entry vcvalue.Object) (record.Target, error) { t.Producible = b case "reason": t.Reason, err = targetOptionalString(f) + case "operators": + t.Operators, err = parseOperators(f.Value) default: return t, fmt.Errorf("unknown key %q", f.Key) } @@ -175,7 +208,7 @@ func parseTarget(entry vcvalue.Object) (record.Target, error) { if t.Name == "" { return t, errors.New("no name") } - for _, key := range []string{"indexes", "producible"} { + for _, key := range []string{"indexes", "producible", "operators"} { if !seen[key] { return t, fmt.Errorf("no %s", key) } @@ -183,6 +216,93 @@ func parseTarget(entry vcvalue.Object) (record.Target, error) { return t, nil } +// parseOperators reads a list of operators, an se_targets entry's or +// se_operators's: a list of objects, each with exactly the keys operator, +// fidelity, arity and index, every value one the engine writes. +func parseOperators(value any) ([]record.Operator, error) { + list, ok := value.([]any) + if !ok { + return nil, fmt.Errorf("operators is %T, not a list", value) + } + operators := make([]record.Operator, 0, len(list)) + for i, item := range list { + entry, ok := item.(vcvalue.Object) + if !ok { + return nil, fmt.Errorf("operator %d is %T, not an object", i, item) + } + var op record.Operator + seen := map[string]bool{} + for _, f := range entry { + if seen[f.Key] { + return nil, fmt.Errorf("operator %d: key %q twice", i, f.Key) + } + seen[f.Key] = true + s, err := targetString(f) + if err != nil { + return nil, fmt.Errorf("operator %d: %v", i, err) + } + switch f.Key { + case "operator": + op.Name, err = parseOperatorName(s) + case "fidelity": + op.Fidelity, err = parseFidelity(s) + case "arity": + switch s { + case "one": + case "pair": + op.Pair = true + default: + return nil, fmt.Errorf("operator %d: unknown arity %q", i, s) + } + case "index": + op.Index, err = parseOperatorIndex(s) + default: + return nil, fmt.Errorf("operator %d: unknown key %q", i, f.Key) + } + if err != nil { + return nil, fmt.Errorf("operator %d: %v", i, err) + } + } + if len(seen) != 4 || op.Name == "" { + return nil, fmt.Errorf("operator %d: not every key, or no name", i) + } + operators = append(operators, op) + } + return operators, nil +} + +// parseOperatorName reads an operator's name as the engine writes it: one +// of eq, lt, lte, gt, gte, between and matches, the names the engine's +// OpSpec::parse accepts. The catalog (se_targets) and se_query_term are +// read through this, parseFidelity and parseOperatorIndex, so the two +// readers refuse the same values. +func parseOperatorName(s string) (string, error) { + switch s { + case "eq", "lt", "lte", "gt", "gte", "between", "matches": + return s, nil + } + return "", fmt.Errorf("unknown operator %q", s) +} + +// parseFidelity reads an operator's fidelity: exact or probabilistic. +func parseFidelity(s string) (record.Fidelity, error) { + switch f := record.Fidelity(s); f { + case record.Exact, record.Probabilistic: + return f, nil + } + return "", fmt.Errorf("unknown fidelity %q", s) +} + +// parseOperatorIndex reads the index that answers an operator: eq, match, +// ore or ope. +func parseOperatorIndex(s string) (record.Output, error) { + switch o := record.Output(s); o { + case record.Equality, record.Match, record.Ore, record.Ope: + return o, nil + } + return "", fmt.Errorf("unknown index %q", s) +} + func targetString(f vcvalue.Field) (string, error) { s, ok := f.Value.(string) if !ok { diff --git a/languages/golang/encrypt/ciphertext.go b/languages/golang/encrypt/ciphertext.go index 242d85d67..7d70475d8 100644 --- a/languages/golang/encrypt/ciphertext.go +++ b/languages/golang/encrypt/ciphertext.go @@ -50,8 +50,9 @@ func scanBytes(kind string, src any) ([]byte, error) { } // otherLeaf is a leaf of a kind the SDK does not store: the authenticated -// markers for an absent value, an empty sequence and an empty map, which a -// record field never produces. Decoding one is an error at the use site. +// markers for an empty sequence and an empty map, which a record field never +// produces. Decoding one is an error at the use site. An absent value is a +// sealed null, a Ciphertext like any other value. type otherLeaf struct { kind vcffi.LeafKind bytes []byte diff --git a/languages/golang/encrypt/client.go b/languages/golang/encrypt/client.go index 4f89bd4ff..042a7d09c 100644 --- a/languages/golang/encrypt/client.go +++ b/languages/golang/encrypt/client.go @@ -8,7 +8,7 @@ import ( "net/http" "runtime" "strconv" - "sync" + "time" "github.com/cipherstash/stack/languages/golang/internal/guest" "github.com/cipherstash/vitaminc/bindings/go/vcffi" @@ -17,8 +17,19 @@ import ( // Client is one wasm instance holding one ZeroKMS client: its key, its // default keyset, and the keysets it has loaded since. It is safe for -// concurrent use; calls are serialised internally, because a wasm instance -// is single-threaded. Close it when done, as with any resource. +// concurrent use; the guest runs one call's step at a time, because a wasm +// instance is single-threaded, but never waits on the network inside one: +// a ZeroKMS request is performed between steps, with the client free for +// other callers (see step.go). Close it when done, as with any resource. +// +// A call whose context ends fails with the context's error, and only that +// call: one request's cancellation or deadline never closes the client for +// the others sharing it. A call waiting its turn leaves the queue when its +// context ends; a call waiting on ZeroKMS has its request cancelled, and +// the error matches both the context's error and [ErrTransport]. The +// client closes itself, and every later call is [ErrState], only when the +// guest's state is unknown: it trapped, or it went on running long after +// its caller gave up, which is a bug. // // Its key material lives in the guest's linear memory, which this package // supplies: reserved once so it never moves, locked in RAM and excluded @@ -29,13 +40,23 @@ import ( // where the protection lives. [Client.MemoryLocked] reports whether the // lock was granted. type Client struct { - mu sync.Mutex + mu guest.Lock inst *instance transport *transport - // closed refuses further calls: either Close ran, or an interrupted - // call took the module down under us (see Client.call). released is - // the runtime's own state, tracked apart from it because those two - // things come apart: an interrupted call closes the module — and so + // stuck is how long a call may run on after its context ends before + // the guest is treated as stuck and closed. guest.StuckAfter; tests + // shorten it. + stuck time.Duration + // paused bounds the operations that may be paused in the guest at once + // to its cap (maxPaused): an operation that can reach ZeroKMS takes a + // slot before its first step and gives it back when it ends, so a + // caller past the cap waits here for one rather than being refused by + // the guest. + paused chan struct{} + // closed refuses further calls: either Close ran, or a stuck or + // trapped call took the module down under us (see Client.call). + // released is the runtime's own state, tracked apart from it because + // those two things come apart: a stuck call closes the module — and so // the client — while the runtime and the host modules beside it are // still allocated. Close is what frees those, so it must do its work // even on a client that is already closed. @@ -175,7 +196,7 @@ func NewClient(ctx context.Context, opts ...ClientOption) (_ *Client, err error) c.releaseCredentials = resolved.Close c.credentialsLockErr = resolved.MemoryLockError owned = true - out, err := c.call(ctx, func(inst *instance) ([]byte, error) { + out, err := c.callKMS(ctx, func(ctx context.Context, inst *instance) ([]byte, error) { return inst.call(ctx, inst.cipherInit, buf(encoded)) }) if err != nil { @@ -217,7 +238,7 @@ func consumeUnresolved(creds Credentials) { // instance, not the client: a cleanup whose argument reaches its object // keeps that object alive forever. func newClient(inst *instance, t *transport) *Client { - c := &Client{inst: inst, transport: t} + c := &Client{inst: inst, transport: t, stuck: guest.StuckAfter, paused: make(chan struct{}, maxPaused)} c.cleanup = runtime.AddCleanup(c, func(inst *instance) { _ = inst.release() }, inst) return c } @@ -323,8 +344,8 @@ func encodeConfig(cfg initConfig) ([]byte, error) { func (c *Client) Close() error { c.mu.Lock() defer c.mu.Unlock() - // Idempotency turns on the runtime, not on the client: a client an - // interrupted call already closed has never released its runtime. + // Idempotency turns on the runtime, not on the client: a client a + // stuck call already closed has never released its runtime. if c.released { return nil } @@ -368,7 +389,7 @@ func (c *Client) resolveKeyset(ctx context.Context, sel KeysetSelector) (KeysetI if err != nil { return KeysetID{}, err } - out, err := c.call(ctx, func(inst *instance) ([]byte, error) { + out, err := c.callKMS(ctx, func(ctx context.Context, inst *instance) ([]byte, error) { return inst.call(ctx, inst.keyset, buf(encoded)) }) if err != nil { @@ -382,35 +403,203 @@ func (c *Client) resolveKeyset(ctx context.Context, sel KeysetSelector) (KeysetI return id, nil } -// call runs f on the instance under the client's lock. +// maxPaused is the most operations the guest holds paused at once: MAX_OPEN +// in stack-guest-abi's step module. One more is refused there, so the +// client never starts more than this many operations that can pause. +const maxPaused = 64 + +// call runs an operation that never reaches ZeroKMS (a plan check, the +// catalog, a verify): the step loop with no token to fetch. +func (c *Client) call(ctx context.Context, f stepFunc) ([]byte, error) { + return c.drive(ctx, false, f) +} + +// callKMS runs an operation that can reach ZeroKMS: the step loop, with a +// token fetched before its first step. +func (c *Client) callKMS(ctx context.Context, f stepFunc) ([]byte, error) { + return c.drive(ctx, true, f) +} + +// drive runs an operation to its end, a step at a time (see step.go): its +// first step is f, and each later one resumes it with the responses to the +// requests the step before asked for. The client's lock is held for each +// step and released while the requests run, so callers share the client +// between steps rather than queue behind a round trip. // -// A call interrupted by its context (the runtime closes the module on a -// deadline or cancellation, see newInstance) leaves the instance closed: -// its key material is gone with its memory and no further call can run. -// The client is then closed, so later calls are ErrState rather than a -// runtime error, and Close releases the runtime without a shutdown call. -// A guest that trapped is closed the same way, by this method: the guest -// builds with panic-as-abort, so a trap is an abort mid-export, after -// which its state is unknown and its keys are better wiped than reused. -func (c *Client) call(ctx context.Context, f func(*instance) ([]byte, error)) ([]byte, error) { +// When kms is set, the operation first takes one of the guest's paused +// slots (see Client.paused), and the token is fetched once, before its +// first step and outside the lock; every step of the operation hands it +// over, so the guest's token_get never waits. The token source is asked +// once per such operation, including one the guest answers from its cache +// without asking for the token (a query term on a loaded keyset, a cached +// keyset lookup): which operations reach ZeroKMS is known only once the +// guest has run. A source that fails is reported only if the guest asks. +// +// The caller's context governs everything the host waits on: the slot, the +// token fetch, the wait for the lock and the requests, which run under it. It +// never reaches the guest, which runs each step under guest.Detach (see +// step). An operation whose caller gives up between steps is aborted, +// which drops it in the guest with everything it held, and the call fails +// with the context's error; one abandoned while it waited on ZeroKMS +// matches ErrTransport too. +func (c *Client) drive(ctx context.Context, kms bool, f stepFunc) ([]byte, error) { + if err := ctx.Err(); err != nil { + return nil, err + } + token, tokenErr := "", error(nil) + if kms { + select { + case c.paused <- struct{}{}: + defer func() { <-c.paused }() + case <-ctx.Done(): + return nil, ctx.Err() + } + } + if kms && c.transport != nil { + token, tokenErr = c.transport.fetchToken(ctx) + // A caller that gave up waiting on its token never starts the + // operation. + if err := ctx.Err(); err != nil { + return nil, err + } + } + step, resumed := f, false + var handle uint64 + var responses []byte + for { + out, io, err := c.step(ctx, token, tokenErr, step) + if resumed { + // The resume step wipes its responses when it runs; when it + // never ran (its caller gave up waiting for the client, or the + // client closed meanwhile) they are wiped here. + wipe(responses) + } + if errors.Is(err, errLockWait) { + // The step never ran: a paused operation is still the + // guest's to drop. + if resumed { + c.abort(handle) + } + return nil, ctx.Err() + } + if io == nil { + return settle(ctx, out, err) + } + // A caller that gave up while the guest ran sends no request. + if err := ctx.Err(); err != nil { + io.wipe() + c.abort(io.handle) + return nil, fmt.Errorf("%w: %w", err, ErrTransport) + } + responses, err = c.transport.performStep(ctx, io) + if err != nil { + c.abort(io.handle) + return nil, err + } + // The requests ran under the caller's context, so one it cancelled + // came back a transport failure: the guest is not resumed with it. + if err := ctx.Err(); err != nil { + wipe(responses) + c.abort(io.handle) + return nil, fmt.Errorf("%w: %w", err, ErrTransport) + } + h, pending := io.handle, responses + handle, resumed = h, true + step = func(ctx context.Context, inst *instance) ([]byte, error) { + defer wipe(pending) + return inst.call(ctx, inst.resume, scalar(h), buf(pending)) + } + } +} + +// settle is how an operation ends for its caller. A call that failed after +// its context ended failed because of it, or as good as: the caller asks +// errors.Is(err, context.Canceled) or DeadlineExceeded, and the cause +// stays matchable too. A call that succeeded after its context ended fails +// as well: work the guest does without the network (a query term, a batch +// under a cached key) runs on through a cancellation, and the caller was +// promised the context's error. The output nobody will read is wiped. +func settle(ctx context.Context, out []byte, err error) ([]byte, error) { + ctxErr := ctx.Err() + if err != nil { + if ctxErr != nil && !errors.Is(err, ctxErr) { + err = fmt.Errorf("%w: %w", ctxErr, err) + } + return nil, err + } + if ctxErr != nil { + wipe(out) + return nil, ctxErr + } + return out, nil +} + +// abort drops a paused operation in the guest, for a caller that gave up +// on it between steps. It waits for the lock however long that takes, and +// runs under no deadline: the operation's plaintext and keys are wiped +// only when it is dropped. +func (c *Client) abort(handle uint64) { c.mu.Lock() defer c.mu.Unlock() + if c.closed || c.inst.module.IsClosed() { + return + } + ctx := context.Background() + _, _ = c.inst.call(ctx, c.inst.abort, scalar(handle)) +} + +// errLockWait marks a step that never ran because its caller's context +// ended while it waited for the client. +var errLockWait = errors.New("encrypt: the caller's context ended waiting for the client") + +// step runs one step of an operation on the instance under the client's +// lock: the operation's output when it finishes, or its next step when it +// pauses, taken from the guest before the lock is released (a host reads a +// step before it runs any other). +// +// The caller's context bounds the wait for the lock, and is refused if it +// has already ended, so a step whose caller timed out in the queue never +// reaches the guest. The guest then runs under guest.Detach, never the +// caller's context: the runtime closes a module whose call context ends, +// and one caller giving up must not close the client for the others. +// +// The client is closed, so later calls are ErrState rather than a runtime +// error, when the guest's state is unknown. A guest that trapped is one: +// it builds with panic-as-abort, so a trap is an abort mid-export, after +// which its keys are better wiped than reused. A guest still running +// c.stuck after its caller's context ended is the other: Detach's context +// ends, the runtime closes the module (WithCloseOnContextDone, see +// newInstance), and its key material goes with its memory. +func (c *Client) step(ctx context.Context, token string, tokenErr error, f stepFunc) ([]byte, *ioStep, error) { + if err := c.mu.Acquire(ctx); err != nil { + return nil, nil, fmt.Errorf("%w: %w", errLockWait, err) + } + defer c.mu.Unlock() if c.closed || c.inst.module.IsClosed() { c.closed = true - return nil, ErrState + return nil, nil, ErrState } growth := c.inst.mem.GrowthRefusal() if c.transport != nil { - c.transport.tokenErr = nil - } - out, err := f(c.inst) + c.transport.held, c.transport.fetchErr, c.transport.tokenErr = token, tokenErr, nil + defer func() { c.transport.held, c.transport.fetchErr = "", nil }() + } + run, done := guest.Detach(ctx, c.stuck) + out, err := f(run, c.inst) + var io *ioStep + if errors.Is(err, guest.ErrNeedsIO) { + // A step that cannot be read cannot be resumed; the guest drops + // the operation at shutdown, and refuses new pauses past its cap. + io, err = c.inst.takeIO(run) + } + done() switch { case c.inst.module.IsClosed(): c.closed = true if err == nil { err = ErrState } - err = fmt.Errorf("%w: interrupted call closed the client", err) + err = fmt.Errorf("%w: the guest ran on after its caller's context ended, and the client is closed", err) case errors.Is(err, errGuestTrap): // No guest code is running (f has returned), so the close is // immediate: the module's memory is wiped and freed here. @@ -439,7 +628,7 @@ func (c *Client) call(ctx context.Context, f func(*instance) ([]byte, error)) ([ } } if err != nil { - return nil, err + return nil, nil, err } - return out, nil + return out, io, nil } diff --git a/languages/golang/encrypt/context_field_test.go b/languages/golang/encrypt/context_field_test.go index 7952df4e7..303d71ae4 100644 --- a/languages/golang/encrypt/context_field_test.go +++ b/languages/golang/encrypt/context_field_test.go @@ -109,19 +109,19 @@ func TestContextFieldQueriesNameTheContext(t *testing.T) { t.Fatal(err) } // A query through a cipher with no context has nothing to derive under. - if _, err := testusers.NoteFields.Text.Equality(ctx, cipher, "hello"); !errors.Is(err, encrypt.ErrEncoding) || !strings.Contains(err.Error(), "Cipher.Context") { + if _, err := testusers.NoteFields.Text.Eq(ctx, cipher, "hello"); !errors.Is(err, encrypt.ErrEncoding) || !strings.Contains(err.Error(), "Cipher.Context") { t.Fatalf("a query with no context: %v, want ErrEncoding naming Cipher.Context", err) } // Under the tenant it singles out that tenant's row. acme := cipher.Context("tenants/acme") - probe, err := testusers.NoteFields.Text.Equality(ctx, acme, "hello") + probe, err := testusers.NoteFields.Text.Eq(ctx, acme, "hello") if err != nil { t.Fatal(err) } if !probe.Equal(encrypted[0].Text.Equality) || probe.Equal(encrypted[1].Text.Equality) || probe.Equal(encrypted[2].Text.Equality) { t.Error("the probe under tenants/acme does not single out acme's hello") } - globex, err := testusers.NoteFields.Text.Equality(ctx, cipher.Context("tenants/globex"), "hello") + globex, err := testusers.NoteFields.Text.Eq(ctx, cipher.Context("tenants/globex"), "hello") if err != nil || !globex.Equal(encrypted[1].Text.Equality) { t.Fatalf("the probe under tenants/globex: %v", err) } @@ -223,7 +223,7 @@ func TestGeneratedCodeOpensTheRustContextFieldFixture(t *testing.T) { t.Fatalf("through the globex cipher: %v, want ErrContextMismatch", err) } // The term Go derives under the tenant is the bytes Rust stored. - eq, err := testusers.NoteFields.Text.Equality(ctx, cipher.Context(want.Tenant), want.Text) + eq, err := testusers.NoteFields.Text.Eq(ctx, cipher.Context(want.Tenant), want.Text) if err != nil || !eq.Equal(stored.Text.Equality) { t.Errorf("text equality: %v, equal=%v", err, eq.Equal(stored.Text.Equality)) } diff --git a/languages/golang/encrypt/diagnostic_test.go b/languages/golang/encrypt/diagnostic_test.go index 811496d44..c632bde94 100644 --- a/languages/golang/encrypt/diagnostic_test.go +++ b/languages/golang/encrypt/diagnostic_test.go @@ -36,7 +36,7 @@ func wantCode(t *testing.T, err error, code string) { func TestGuestRefusalsCarryTheirDiagnostic(t *testing.T) { ctx := context.Background() c := rawInstance(t) - _, err := c.call(ctx, func(inst *instance) ([]byte, error) { + _, err := c.call(ctx, func(ctx context.Context, inst *instance) ([]byte, error) { return inst.call(ctx, inst.planCheck, buf([]byte{0xff})) }) if !errors.Is(err, ErrEncoding) { @@ -48,7 +48,7 @@ func TestGuestRefusalsCarryTheirDiagnostic(t *testing.T) { if err != nil { t.Fatal(err) } - _, err = c.call(ctx, func(inst *instance) ([]byte, error) { + _, err = c.call(ctx, func(ctx context.Context, inst *instance) ([]byte, error) { return inst.call(ctx, inst.keyset, buf(selector)) }) if !errors.Is(err, ErrState) { @@ -65,7 +65,7 @@ func TestAGuestWithoutLastErrorFailsWithTheBareSentinel(t *testing.T) { ctx := context.Background() c := rawInstance(t) c.inst.exports.LastError = nil - _, err := c.call(ctx, func(inst *instance) ([]byte, error) { + _, err := c.call(ctx, func(ctx context.Context, inst *instance) ([]byte, error) { return inst.call(ctx, inst.planCheck, buf([]byte{0xff})) }) if err != ErrEncoding { diff --git a/languages/golang/encrypt/doc.go b/languages/golang/encrypt/doc.go index 7b114f0e3..7cf110511 100644 --- a/languages/golang/encrypt/doc.go +++ b/languages/golang/encrypt/doc.go @@ -15,10 +15,28 @@ // type User struct { // _ struct{} `stash:"context=users"` // ID int64 `stash:"id,passthrough"` -// Email string `stash:"email,encrypt,index=equality;match"` -// Age uint32 `stash:"age,encrypt,index=equality;ore"` +// Email string `stash:"email,encrypt_into=TextEq"` +// Name string `stash:"name,encrypt_into=TextMatch"` +// Age int32 `stash:"age,encrypt_into=Integer"` // } // +// encrypt_into names the EQL type the field is stored as. The Go field type +// must match it: TextEq, TextMatch and Text take a string, Smallint and +// SmallintEq an int16, Integer and IntegerEq an int32, Bigint and BigintEq +// an int64, Boolean a bool, Real and RealEq a float32, Double and DoubleEq a +// float64, Date and DateEq a [Date], Timestamp and TimestampEq a time.Time, +// and Numeric and NumericEq a [Decimal]. An integer EQL type +// also takes any other built-in Go integer type, sealed at the type's width: +// one every value of which fits it (an int16 into Integer) always seals, and +// a wider one (an int64 into Integer) is range checked, a value that does not +// fit refused with [ErrEncoding]. The *Eq types answer Eq; the *Ord and +// *OrdOpe types (IntegerOrd, SmallintOrd, BigintOrd, RealOrd, DoubleOrd, +// TextOrd and their OrdOpe twins) answer Lt, Lte, Gt and Gte, and Eq too on +// text; Smallint, Integer, Bigint, Boolean, Real, Double, Text, Date, +// Timestamp and Numeric are stored and read only. NumericEq compares +// decimals with their scale normalised (1.5 = 1.50), and TimestampEq +// compares instants to the microsecond, truncated, never rounded. +// // 3. Run the generator. It writes user_stash.go beside the struct: // // go generate ./... @@ -35,15 +53,24 @@ // cipher := client.Keyset(encrypt.KeysetName("tenant-42")) // encrypted, err := users.Encrypt(ctx, cipher, people) // []users.EncryptedUser // opened, err := users.Decrypt(ctx, cipher, encrypted) // []users.User -// term, err := users.Fields.Email.Equality(ctx, cipher, "bob@example.com") +// term, err := users.Fields.Email.Eq(ctx, cipher, "bob@example.com") // // Encrypt and Decrypt send one ZeroKMS request for each 500 sealed values in -// the batch, plus one the first time a keyset is used. +// the batch, plus one the first time a keyset is used. A query derives its +// term locally, with no request of its own; only the first use of a keyset, +// by a query or anything else, loads it from ZeroKMS. See Queries below. +// +// 6. Store the encrypted type. Each encrypt_into field is one EQL v4 column +// (an eql.TextEq goes in a public.eql_v4_text_eq column), implementing +// driver.Valuer and sql.Scanner, so a database library binds and scans it +// like any other value. Install EQL v4 into PostgreSQL first, with the +// eql-v4-install.sql attached to the release. A query casts its parameter to +// the column's query type: +// +// SELECT id, email, name, age FROM users WHERE email = $1::eql_v4.query_text_eq // -// 6. Store the encrypted type. Each sealed field is one or more columns of -// bytes ([Ciphertext] and the term types), each implementing driver.Valuer -// and sql.Scanner, so a database library binds and scans each one as bytes; -// map each one to its own column. +// A field tagged encrypt or index= stores its ciphertext ([Ciphertext]) and +// each term as separate byte columns instead; see Terms below. // // 7. Run the generator again after each change to the struct or to a tag. A // change to the fields of the struct stops the build until you do. @@ -89,11 +116,20 @@ // plan the Rust chain and the derive run. A program never builds or names a // plan, and no call takes a context or an index choice of its own. // +// A sealed field outside an opaque struct is one value: a string, []byte, +// bool, an integer of any width (int8 to int64, uint8 to uint64, int, uint, +// or [Int128] and [Uint128]), a float32 or float64, a [Decimal], a [Date] or a +// time.Time (a timestamp), or a type defined over one of the built-in types. +// Each integer seals at its own width. Equality applies to every one but a +// bool; ORE and OPE to the integers, text, bytes and floats, and not yet to a +// decimal, date or timestamp, whose order terms wait for new cllw-ore and +// ore-rs releases (#1236). +// // Passthrough fields never cross the binding: the engine does nothing to a // passthrough value that a program could observe, and the FFI codec cannot -// carry every Go type a program stores beside a ciphertext (a time.Time, a -// driver.Valuer). An opaque struct crosses as one JSON document and is one -// column. +// carry every Go type a program stores beside a ciphertext (a +// driver.Valuer, a sql.NullTime). An opaque struct crosses as one JSON +// document and is one column. // // # Terms // @@ -104,18 +140,89 @@ // [Match], [Ore] and [Ope]; [JSON] is declared and refused until the engine // derives it. Every stored type implements driver.Valuer and sql.Scanner. // -// A match index needs text with at least one token: the engine derives no -// match term for an empty string, separator-only text, or text shorter than -// the n-gram length (3 characters), because an empty term would match every -// row. Encrypt then fails for the whole batch with [ErrTerm], naming the row, -// the field and the index, so an optional or short value does not belong -// under match. +// A match index stores text with no token (an empty string, separator-only +// text, or text shorter than the n-gram length of 3 characters) as the empty +// filter: a valid value that no query matches, so an optional or short value +// can live under match. The empty filter tells anyone who can read the +// column that the value is one of those. A match *query* of such text is +// refused with [ErrTerm], because an empty filter as a query would match every +// row. +// +// # Queries +// +// A generated Fields entry has one method for each operator the engine +// answers on the field, named for it: Eq, Lt, Lte, Gt, Gte, Between and +// Matches. A field has no method for an operator it does not answer, so +// such a query does not compile; the generator asks the engine which +// operators each field answers, and holds no copy of the rules. Each method +// takes the field's own Go type. +// +// Eq returns an [EqualityTerm] (or, for a field with encrypt_into, the EQL +// type's query value), an ordering an [OreTerm] or [OpeTerm], and Between a +// [Range] of two. Their answers are exact. The orderings are answered on +// integers, on floats, which order as PostgreSQL's float8 does (-0.0 ties +// 0.0, NaN sorts last), and on text, which orders by its folded form (case +// and accents folded, under Unicode 16), so Café and cafe tie and alice +// orders before Zoe. Matches returns a [MatchQuery], +// whose answer can hold rows that do not match: size the fetch with +// [MatchQuery.TargetLimit], then decrypt the rows and keep those +// [MatchQuery.Verify] reports true, one call into the engine for the page. +// On a field with encrypt_into=TextMatch, Matches returns an +// [EQLMatchQuery], the type's query value with the same two methods. +// Every query type implements driver.Valuer, so it binds as a parameter +// through database/sql or pgx. With separate byte columns, as the example/ +// program declares its fields (Email `stash:"email,encrypt,index=equality;match"`, +// Age `stash:"age,encrypt,index=equality;ore"`), not the encrypt_into User +// above: +// +// q, err := users.Fields.Email.Matches(ctx, cipher, "alice") +// limit, err := q.TargetLimit(ctx, 10, encrypt.Stats{Rows: rowCount}) +// rows, err := db.QueryContext(ctx, `SELECT id, email, email_eq, email_match, age, age_eq, age_ore +// FROM users WHERE match_positions(email_match) @> match_positions($1) +// ORDER BY id LIMIT $2`, q, limit.FetchOr(50)) +// // scan into []users.EncryptedUser, then +// people, err := users.Decrypt(ctx, cipher, encrypted) +// emails := make([]string, len(people)) +// for i, p := range people { +// emails[i] = p.Email +// } +// verified, err := q.Verify(ctx, emails) // one bool per row +// +// match_positions is a SQL function of your own that reads a match term's +// little-endian uint16 positions into an int[]; the package README has one. +// A MatchQuery keeps the text it was derived from, because Verify cuts its +// tokens again in the engine. Go cannot wipe a string, so the text stays in +// memory until the garbage collector reclaims it; a MatchQuery never prints +// it. +// +// # Cancellation +// +// Every call takes a [context.Context], and a call whose context is +// cancelled or passes its deadline fails with that context's error. Only +// that call fails: one Client is shared by every request in a service, and +// one request giving up never closes it for the others. A call waiting +// for the client, which runs one call at a time, leaves the queue when its +// context ends and never starts. A call waiting on ZeroKMS has that request +// cancelled; its error matches both the context's error and +// [ErrTransport]. A call waiting on its auth strategy for a token returns +// too, with the context's error. If the strategy is refreshing a device +// session, the refresh finishes in the background, for up to 10 seconds: +// the service rotates the refresh token when it answers, and dropping that +// answer would leave the strategy unable to refresh. +// +// A Client closes itself, and every later call returns [ErrState], only +// when the guest's state is unknown: the guest trapped, or a call ran on +// for 30 seconds after its context ended, which means a bug, not a caller +// that gave up. A service that sees ErrState from a client it did not +// close builds a new one. // // # Transport and auth // -// The guest imports exactly two host functions: an HTTP send, served by any -// [net/http.RoundTripper], and a bearer-token fetch, served by the -// credentials' auth strategy. What crosses per ZeroKMS call is what would +// The guest imports exactly one host function, a bearer-token fetch, served +// by the credentials' auth strategy. It never performs a request itself: an +// operation that needs ZeroKMS pauses and hands the request to the client, +// which sends it with any [net/http.RoundTripper] and resumes the operation +// with the response. What crosses per ZeroKMS call is what would // cross TLS anyway; derived key material never leaves the guest. Under // [AutoCredentials] and [OIDCFederation] the same RoundTripper also carries // the authentication requests to CTS, so one scoped to the ZeroKMS host alone @@ -143,7 +250,8 @@ // // The generator and the compiler find a mistake in a declaration, so no call // returns an error for one. A call returns an error for a key, for the -// network, or for stored data: [ErrForeignKeyset] when a *Cipher is given a +// network, or for stored data, or because its context ended (see +// Cancellation): [ErrForeignKeyset] when a *Cipher is given a // record another keyset sealed, [ErrAuthentication] or [ErrForbidden] for a // ciphertext that does not open under its field's context, [ErrEncoding] for // a stored value that does not fit its declaration. Read the kind with diff --git a/languages/golang/encrypt/eql/eql.go b/languages/golang/encrypt/eql/eql.go index 24b3d7c17..d6efdcb1a 100644 --- a/languages/golang/encrypt/eql/eql.go +++ b/languages/golang/encrypt/eql/eql.go @@ -3,7 +3,7 @@ // the type's domain, and the query types that match them. // // A field with `stash:"email,encrypt_into=TextEq"` is an [TextEq] in the -// generated encrypted type, and its Fields entry's Query returns a +// generated encrypted type, and its Fields entry's Eq returns a // [TextEqQuery]. The guest builds every value: generated code stores what // the guest returns and never assembles an EQL value itself (ADR-0007, // amended 2026-10-06). Each type implements driver.Valuer and sql.Scanner @@ -18,9 +18,9 @@ // // The types and the [Types] table are generated from the EQL catalog by // eql-codegen (`mise run types:generate` in packages/eql); eql_gen.go is -// committed and drift-gated. The engine produces [TextEq] today; every -// other type is listed with the reason it cannot be produced yet, and -// stashgen refuses it. +// committed and drift-gated. [Types] says which types the engine produces +// today; every other type is listed with the reason it cannot be produced +// yet, and stashgen refuses it. package eql import ( diff --git a/languages/golang/encrypt/eql/eql_gen.go b/languages/golang/encrypt/eql/eql_gen.go index 911a82c97..8d23c8332 100644 --- a/languages/golang/encrypt/eql/eql_gen.go +++ b/languages/golang/encrypt/eql/eql_gen.go @@ -9,61 +9,61 @@ import "database/sql/driver" // engine produces the type today; stashgen refuses encrypt_into for one // it does not, with the Reason. var Types = []Type{ - {Name: "Integer", GoName: "Integer", Family: "integer", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_integer", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "IntegerEq", GoName: "IntegerEq", Family: "integer", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v3_integer_eq", Indexes: []string{"eq"}, Query: "IntegerEqQuery", QuerySQLDomain: "eql_v3.query_integer_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "IntegerOrdOre", GoName: "IntegerOrdOre", Family: "integer", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v3_integer_ord_ore", Indexes: []string{"ore"}, Query: "IntegerOrdOreQuery", QuerySQLDomain: "eql_v3.query_integer_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "IntegerOrd", GoName: "IntegerOrd", Family: "integer", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v3_integer_ord", Indexes: []string{"ope"}, Query: "IntegerOrdQuery", QuerySQLDomain: "eql_v3.query_integer_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "IntegerOrdOpe", GoName: "IntegerOrdOpe", Family: "integer", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v3_integer_ord_ope", Indexes: []string{"ope"}, Query: "IntegerOrdOpeQuery", QuerySQLDomain: "eql_v3.query_integer_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "Smallint", GoName: "Smallint", Family: "smallint", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_smallint", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "SmallintEq", GoName: "SmallintEq", Family: "smallint", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v3_smallint_eq", Indexes: []string{"eq"}, Query: "SmallintEqQuery", QuerySQLDomain: "eql_v3.query_smallint_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "SmallintOrdOre", GoName: "SmallintOrdOre", Family: "smallint", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v3_smallint_ord_ore", Indexes: []string{"ore"}, Query: "SmallintOrdOreQuery", QuerySQLDomain: "eql_v3.query_smallint_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "SmallintOrd", GoName: "SmallintOrd", Family: "smallint", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v3_smallint_ord", Indexes: []string{"ope"}, Query: "SmallintOrdQuery", QuerySQLDomain: "eql_v3.query_smallint_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "SmallintOrdOpe", GoName: "SmallintOrdOpe", Family: "smallint", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v3_smallint_ord_ope", Indexes: []string{"ope"}, Query: "SmallintOrdOpeQuery", QuerySQLDomain: "eql_v3.query_smallint_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "Bigint", GoName: "Bigint", Family: "bigint", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_bigint", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "BigintEq", GoName: "BigintEq", Family: "bigint", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v3_bigint_eq", Indexes: []string{"eq"}, Query: "BigintEqQuery", QuerySQLDomain: "eql_v3.query_bigint_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "BigintOrdOre", GoName: "BigintOrdOre", Family: "bigint", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v3_bigint_ord_ore", Indexes: []string{"ore"}, Query: "BigintOrdOreQuery", QuerySQLDomain: "eql_v3.query_bigint_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "BigintOrd", GoName: "BigintOrd", Family: "bigint", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v3_bigint_ord", Indexes: []string{"ope"}, Query: "BigintOrdQuery", QuerySQLDomain: "eql_v3.query_bigint_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "BigintOrdOpe", GoName: "BigintOrdOpe", Family: "bigint", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v3_bigint_ord_ope", Indexes: []string{"ope"}, Query: "BigintOrdOpeQuery", QuerySQLDomain: "eql_v3.query_bigint_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "Date", GoName: "Date", Family: "date", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_date", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "DateEq", GoName: "DateEq", Family: "date", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v3_date_eq", Indexes: []string{"eq"}, Query: "DateEqQuery", QuerySQLDomain: "eql_v3.query_date_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "DateOrdOre", GoName: "DateOrdOre", Family: "date", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v3_date_ord_ore", Indexes: []string{"ore"}, Query: "DateOrdOreQuery", QuerySQLDomain: "eql_v3.query_date_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "DateOrd", GoName: "DateOrd", Family: "date", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v3_date_ord", Indexes: []string{"ope"}, Query: "DateOrdQuery", QuerySQLDomain: "eql_v3.query_date_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "DateOrdOpe", GoName: "DateOrdOpe", Family: "date", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v3_date_ord_ope", Indexes: []string{"ope"}, Query: "DateOrdOpeQuery", QuerySQLDomain: "eql_v3.query_date_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "Timestamp", GoName: "Timestamp", Family: "timestamp", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_timestamp", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "TimestampEq", GoName: "TimestampEq", Family: "timestamp", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v3_timestamp_eq", Indexes: []string{"eq"}, Query: "TimestampEqQuery", QuerySQLDomain: "eql_v3.query_timestamp_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "TimestampOrdOre", GoName: "TimestampOrdOre", Family: "timestamp", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v3_timestamp_ord_ore", Indexes: []string{"ore"}, Query: "TimestampOrdOreQuery", QuerySQLDomain: "eql_v3.query_timestamp_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "TimestampOrd", GoName: "TimestampOrd", Family: "timestamp", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v3_timestamp_ord", Indexes: []string{"ope"}, Query: "TimestampOrdQuery", QuerySQLDomain: "eql_v3.query_timestamp_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "TimestampOrdOpe", GoName: "TimestampOrdOpe", Family: "timestamp", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v3_timestamp_ord_ope", Indexes: []string{"ope"}, Query: "TimestampOrdOpeQuery", QuerySQLDomain: "eql_v3.query_timestamp_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "Numeric", GoName: "Numeric", Family: "numeric", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_numeric", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "NumericEq", GoName: "NumericEq", Family: "numeric", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v3_numeric_eq", Indexes: []string{"eq"}, Query: "NumericEqQuery", QuerySQLDomain: "eql_v3.query_numeric_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "NumericOrdOre", GoName: "NumericOrdOre", Family: "numeric", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v3_numeric_ord_ore", Indexes: []string{"ore"}, Query: "NumericOrdOreQuery", QuerySQLDomain: "eql_v3.query_numeric_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "NumericOrd", GoName: "NumericOrd", Family: "numeric", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v3_numeric_ord", Indexes: []string{"ope"}, Query: "NumericOrdQuery", QuerySQLDomain: "eql_v3.query_numeric_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "NumericOrdOpe", GoName: "NumericOrdOpe", Family: "numeric", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v3_numeric_ord_ope", Indexes: []string{"ope"}, Query: "NumericOrdOpeQuery", QuerySQLDomain: "eql_v3.query_numeric_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "Text", GoName: "Text", Family: "text", Suffix: "", Plaintext: "string", SQLDomain: "public.eql_v3_text", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "the storage-only text domain follows once TextEq is proven end to end in PostgreSQL"}, - {Name: "TextEq", GoName: "TextEq", Family: "text", Suffix: "Eq", Plaintext: "string", SQLDomain: "public.eql_v3_text_eq", Indexes: []string{"eq"}, Query: "TextEqQuery", QuerySQLDomain: "eql_v3.query_text_eq", Producible: true, Reason: ""}, - {Name: "TextMatch", GoName: "TextMatch", Family: "text", Suffix: "Match", Plaintext: "string", SQLDomain: "public.eql_v3_text_match", Indexes: []string{"match"}, Query: "TextMatchQuery", QuerySQLDomain: "eql_v3.query_text_match", Producible: false, Reason: "the engine derives match and OPE terms, but no EQL type is built from them yet"}, - {Name: "TextOrdOre", GoName: "TextOrdOre", Family: "text", Suffix: "OrdOre", Plaintext: "string", SQLDomain: "public.eql_v3_text_ord_ore", Indexes: []string{"eq", "ore"}, Query: "TextOrdOreQuery", QuerySQLDomain: "eql_v3.query_text_ord_ore", Producible: false, Reason: "EQL stores a block ORE term and the engine derives a CLLW ORE term; the two are different algorithms"}, - {Name: "TextOrd", GoName: "TextOrd", Family: "text", Suffix: "Ord", Plaintext: "string", SQLDomain: "public.eql_v3_text_ord", Indexes: []string{"eq", "ope"}, Query: "TextOrdQuery", QuerySQLDomain: "eql_v3.query_text_ord", Producible: false, Reason: "the engine derives match and OPE terms, but no EQL type is built from them yet"}, - {Name: "TextOrdOpe", GoName: "TextOrdOpe", Family: "text", Suffix: "OrdOpe", Plaintext: "string", SQLDomain: "public.eql_v3_text_ord_ope", Indexes: []string{"eq", "ope"}, Query: "TextOrdOpeQuery", QuerySQLDomain: "eql_v3.query_text_ord_ope", Producible: false, Reason: "the engine derives match and OPE terms, but no EQL type is built from them yet"}, - {Name: "TextSearchOre", GoName: "TextSearchOre", Family: "text", Suffix: "SearchOre", Plaintext: "string", SQLDomain: "public.eql_v3_text_search_ore", Indexes: []string{"eq", "ore", "match"}, Query: "TextSearchOreQuery", QuerySQLDomain: "eql_v3.query_text_search_ore", Producible: false, Reason: "EQL stores a block ORE term and the engine derives a CLLW ORE term; the two are different algorithms"}, - {Name: "TextSearch", GoName: "TextSearch", Family: "text", Suffix: "Search", Plaintext: "string", SQLDomain: "public.eql_v3_text_search", Indexes: []string{"eq", "ope", "match"}, Query: "TextSearchQuery", QuerySQLDomain: "eql_v3.query_text_search", Producible: false, Reason: "the engine derives match and OPE terms, but no EQL type is built from them yet"}, - {Name: "Boolean", GoName: "Boolean", Family: "boolean", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_boolean", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "Real", GoName: "Real", Family: "real", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_real", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "RealEq", GoName: "RealEq", Family: "real", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v3_real_eq", Indexes: []string{"eq"}, Query: "RealEqQuery", QuerySQLDomain: "eql_v3.query_real_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "RealOrdOre", GoName: "RealOrdOre", Family: "real", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v3_real_ord_ore", Indexes: []string{"ore"}, Query: "RealOrdOreQuery", QuerySQLDomain: "eql_v3.query_real_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "RealOrd", GoName: "RealOrd", Family: "real", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v3_real_ord", Indexes: []string{"ope"}, Query: "RealOrdQuery", QuerySQLDomain: "eql_v3.query_real_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "RealOrdOpe", GoName: "RealOrdOpe", Family: "real", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v3_real_ord_ope", Indexes: []string{"ope"}, Query: "RealOrdOpeQuery", QuerySQLDomain: "eql_v3.query_real_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "Double", GoName: "Double", Family: "double", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_double", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "DoubleEq", GoName: "DoubleEq", Family: "double", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v3_double_eq", Indexes: []string{"eq"}, Query: "DoubleEqQuery", QuerySQLDomain: "eql_v3.query_double_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "DoubleOrdOre", GoName: "DoubleOrdOre", Family: "double", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v3_double_ord_ore", Indexes: []string{"ore"}, Query: "DoubleOrdOreQuery", QuerySQLDomain: "eql_v3.query_double_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "DoubleOrd", GoName: "DoubleOrd", Family: "double", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v3_double_ord", Indexes: []string{"ope"}, Query: "DoubleOrdQuery", QuerySQLDomain: "eql_v3.query_double_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "DoubleOrdOpe", GoName: "DoubleOrdOpe", Family: "double", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v3_double_ord_ope", Indexes: []string{"ope"}, Query: "DoubleOrdOpeQuery", QuerySQLDomain: "eql_v3.query_double_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "SteVecDocument", GoName: "SteVecDocument", Family: "json", Suffix: "Search", Plaintext: "", SQLDomain: "public.eql_v3_json_search", Indexes: []string{"json"}, Query: "SteVecQuery", QuerySQLDomain: "eql_v3.query_json", Producible: false, Reason: "the JSON index is a new operation in the engine"}, - {Name: "Json", GoName: "JSON", Family: "json", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_json", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, -} - -// Integer is the EQL type stored in public.eql_v3_integer: the integer family with no index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. + {Name: "Integer", GoName: "Integer", Family: "integer", Suffix: "", Plaintext: "int32", SQLDomain: "public.eql_v4_integer", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: true, Reason: ""}, + {Name: "IntegerEq", GoName: "IntegerEq", Family: "integer", Suffix: "Eq", Plaintext: "int32", SQLDomain: "public.eql_v4_integer_eq", Indexes: []string{"eq"}, Query: "IntegerEqQuery", QuerySQLDomain: "eql_v4.query_integer_eq", Producible: true, Reason: ""}, + {Name: "IntegerOrdOre", GoName: "IntegerOrdOre", Family: "integer", Suffix: "OrdOre", Plaintext: "int32", SQLDomain: "public.eql_v4_integer_ord_ore", Indexes: []string{"ore"}, Query: "IntegerOrdOreQuery", QuerySQLDomain: "eql_v4.query_integer_ord_ore", Producible: false, Reason: "EQL stores block ORE terms and the engine derives CLLW ORE (#1132)"}, + {Name: "IntegerOrd", GoName: "IntegerOrd", Family: "integer", Suffix: "Ord", Plaintext: "int32", SQLDomain: "public.eql_v4_integer_ord", Indexes: []string{"ope"}, Query: "IntegerOrdQuery", QuerySQLDomain: "eql_v4.query_integer_ord", Producible: true, Reason: ""}, + {Name: "IntegerOrdOpe", GoName: "IntegerOrdOpe", Family: "integer", Suffix: "OrdOpe", Plaintext: "int32", SQLDomain: "public.eql_v4_integer_ord_ope", Indexes: []string{"ope"}, Query: "IntegerOrdOpeQuery", QuerySQLDomain: "eql_v4.query_integer_ord_ope", Producible: true, Reason: ""}, + {Name: "Smallint", GoName: "Smallint", Family: "smallint", Suffix: "", Plaintext: "int16", SQLDomain: "public.eql_v4_smallint", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: true, Reason: ""}, + {Name: "SmallintEq", GoName: "SmallintEq", Family: "smallint", Suffix: "Eq", Plaintext: "int16", SQLDomain: "public.eql_v4_smallint_eq", Indexes: []string{"eq"}, Query: "SmallintEqQuery", QuerySQLDomain: "eql_v4.query_smallint_eq", Producible: true, Reason: ""}, + {Name: "SmallintOrdOre", GoName: "SmallintOrdOre", Family: "smallint", Suffix: "OrdOre", Plaintext: "int16", SQLDomain: "public.eql_v4_smallint_ord_ore", Indexes: []string{"ore"}, Query: "SmallintOrdOreQuery", QuerySQLDomain: "eql_v4.query_smallint_ord_ore", Producible: false, Reason: "EQL stores block ORE terms and the engine derives CLLW ORE (#1132)"}, + {Name: "SmallintOrd", GoName: "SmallintOrd", Family: "smallint", Suffix: "Ord", Plaintext: "int16", SQLDomain: "public.eql_v4_smallint_ord", Indexes: []string{"ope"}, Query: "SmallintOrdQuery", QuerySQLDomain: "eql_v4.query_smallint_ord", Producible: true, Reason: ""}, + {Name: "SmallintOrdOpe", GoName: "SmallintOrdOpe", Family: "smallint", Suffix: "OrdOpe", Plaintext: "int16", SQLDomain: "public.eql_v4_smallint_ord_ope", Indexes: []string{"ope"}, Query: "SmallintOrdOpeQuery", QuerySQLDomain: "eql_v4.query_smallint_ord_ope", Producible: true, Reason: ""}, + {Name: "Bigint", GoName: "Bigint", Family: "bigint", Suffix: "", Plaintext: "int64", SQLDomain: "public.eql_v4_bigint", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: true, Reason: ""}, + {Name: "BigintEq", GoName: "BigintEq", Family: "bigint", Suffix: "Eq", Plaintext: "int64", SQLDomain: "public.eql_v4_bigint_eq", Indexes: []string{"eq"}, Query: "BigintEqQuery", QuerySQLDomain: "eql_v4.query_bigint_eq", Producible: true, Reason: ""}, + {Name: "BigintOrdOre", GoName: "BigintOrdOre", Family: "bigint", Suffix: "OrdOre", Plaintext: "int64", SQLDomain: "public.eql_v4_bigint_ord_ore", Indexes: []string{"ore"}, Query: "BigintOrdOreQuery", QuerySQLDomain: "eql_v4.query_bigint_ord_ore", Producible: false, Reason: "EQL stores block ORE terms and the engine derives CLLW ORE (#1132)"}, + {Name: "BigintOrd", GoName: "BigintOrd", Family: "bigint", Suffix: "Ord", Plaintext: "int64", SQLDomain: "public.eql_v4_bigint_ord", Indexes: []string{"ope"}, Query: "BigintOrdQuery", QuerySQLDomain: "eql_v4.query_bigint_ord", Producible: true, Reason: ""}, + {Name: "BigintOrdOpe", GoName: "BigintOrdOpe", Family: "bigint", Suffix: "OrdOpe", Plaintext: "int64", SQLDomain: "public.eql_v4_bigint_ord_ope", Indexes: []string{"ope"}, Query: "BigintOrdOpeQuery", QuerySQLDomain: "eql_v4.query_bigint_ord_ope", Producible: true, Reason: ""}, + {Name: "Date", GoName: "Date", Family: "date", Suffix: "", Plaintext: "date", SQLDomain: "public.eql_v4_date", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: true, Reason: ""}, + {Name: "DateEq", GoName: "DateEq", Family: "date", Suffix: "Eq", Plaintext: "date", SQLDomain: "public.eql_v4_date_eq", Indexes: []string{"eq"}, Query: "DateEqQuery", QuerySQLDomain: "eql_v4.query_date_eq", Producible: true, Reason: ""}, + {Name: "DateOrdOre", GoName: "DateOrdOre", Family: "date", Suffix: "OrdOre", Plaintext: "date", SQLDomain: "public.eql_v4_date_ord_ore", Indexes: []string{"ore"}, Query: "DateOrdOreQuery", QuerySQLDomain: "eql_v4.query_date_ord_ore", Producible: false, Reason: "the engine derives no order term for a date, timestamp or decimal yet: how they are ordered is not decided (#1236)"}, + {Name: "DateOrd", GoName: "DateOrd", Family: "date", Suffix: "Ord", Plaintext: "date", SQLDomain: "public.eql_v4_date_ord", Indexes: []string{"ope"}, Query: "DateOrdQuery", QuerySQLDomain: "eql_v4.query_date_ord", Producible: false, Reason: "the engine derives no order term for a date, timestamp or decimal yet: how they are ordered is not decided (#1236)"}, + {Name: "DateOrdOpe", GoName: "DateOrdOpe", Family: "date", Suffix: "OrdOpe", Plaintext: "date", SQLDomain: "public.eql_v4_date_ord_ope", Indexes: []string{"ope"}, Query: "DateOrdOpeQuery", QuerySQLDomain: "eql_v4.query_date_ord_ope", Producible: false, Reason: "the engine derives no order term for a date, timestamp or decimal yet: how they are ordered is not decided (#1236)"}, + {Name: "Timestamp", GoName: "Timestamp", Family: "timestamp", Suffix: "", Plaintext: "timestamp", SQLDomain: "public.eql_v4_timestamp", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: true, Reason: ""}, + {Name: "TimestampEq", GoName: "TimestampEq", Family: "timestamp", Suffix: "Eq", Plaintext: "timestamp", SQLDomain: "public.eql_v4_timestamp_eq", Indexes: []string{"eq"}, Query: "TimestampEqQuery", QuerySQLDomain: "eql_v4.query_timestamp_eq", Producible: true, Reason: ""}, + {Name: "TimestampOrdOre", GoName: "TimestampOrdOre", Family: "timestamp", Suffix: "OrdOre", Plaintext: "timestamp", SQLDomain: "public.eql_v4_timestamp_ord_ore", Indexes: []string{"ore"}, Query: "TimestampOrdOreQuery", QuerySQLDomain: "eql_v4.query_timestamp_ord_ore", Producible: false, Reason: "the engine derives no order term for a date, timestamp or decimal yet: how they are ordered is not decided (#1236)"}, + {Name: "TimestampOrd", GoName: "TimestampOrd", Family: "timestamp", Suffix: "Ord", Plaintext: "timestamp", SQLDomain: "public.eql_v4_timestamp_ord", Indexes: []string{"ope"}, Query: "TimestampOrdQuery", QuerySQLDomain: "eql_v4.query_timestamp_ord", Producible: false, Reason: "the engine derives no order term for a date, timestamp or decimal yet: how they are ordered is not decided (#1236)"}, + {Name: "TimestampOrdOpe", GoName: "TimestampOrdOpe", Family: "timestamp", Suffix: "OrdOpe", Plaintext: "timestamp", SQLDomain: "public.eql_v4_timestamp_ord_ope", Indexes: []string{"ope"}, Query: "TimestampOrdOpeQuery", QuerySQLDomain: "eql_v4.query_timestamp_ord_ope", Producible: false, Reason: "the engine derives no order term for a date, timestamp or decimal yet: how they are ordered is not decided (#1236)"}, + {Name: "Numeric", GoName: "Numeric", Family: "numeric", Suffix: "", Plaintext: "decimal", SQLDomain: "public.eql_v4_numeric", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: true, Reason: ""}, + {Name: "NumericEq", GoName: "NumericEq", Family: "numeric", Suffix: "Eq", Plaintext: "decimal", SQLDomain: "public.eql_v4_numeric_eq", Indexes: []string{"eq"}, Query: "NumericEqQuery", QuerySQLDomain: "eql_v4.query_numeric_eq", Producible: true, Reason: ""}, + {Name: "NumericOrdOre", GoName: "NumericOrdOre", Family: "numeric", Suffix: "OrdOre", Plaintext: "decimal", SQLDomain: "public.eql_v4_numeric_ord_ore", Indexes: []string{"ore"}, Query: "NumericOrdOreQuery", QuerySQLDomain: "eql_v4.query_numeric_ord_ore", Producible: false, Reason: "the engine derives no order term for a date, timestamp or decimal yet: how they are ordered is not decided (#1236)"}, + {Name: "NumericOrd", GoName: "NumericOrd", Family: "numeric", Suffix: "Ord", Plaintext: "decimal", SQLDomain: "public.eql_v4_numeric_ord", Indexes: []string{"ope"}, Query: "NumericOrdQuery", QuerySQLDomain: "eql_v4.query_numeric_ord", Producible: false, Reason: "the engine derives no order term for a date, timestamp or decimal yet: how they are ordered is not decided (#1236)"}, + {Name: "NumericOrdOpe", GoName: "NumericOrdOpe", Family: "numeric", Suffix: "OrdOpe", Plaintext: "decimal", SQLDomain: "public.eql_v4_numeric_ord_ope", Indexes: []string{"ope"}, Query: "NumericOrdOpeQuery", QuerySQLDomain: "eql_v4.query_numeric_ord_ope", Producible: false, Reason: "the engine derives no order term for a date, timestamp or decimal yet: how they are ordered is not decided (#1236)"}, + {Name: "Text", GoName: "Text", Family: "text", Suffix: "", Plaintext: "string", SQLDomain: "public.eql_v4_text", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: true, Reason: ""}, + {Name: "TextEq", GoName: "TextEq", Family: "text", Suffix: "Eq", Plaintext: "string", SQLDomain: "public.eql_v4_text_eq", Indexes: []string{"eq"}, Query: "TextEqQuery", QuerySQLDomain: "eql_v4.query_text_eq", Producible: true, Reason: ""}, + {Name: "TextMatch", GoName: "TextMatch", Family: "text", Suffix: "Match", Plaintext: "string", SQLDomain: "public.eql_v4_text_match", Indexes: []string{"match"}, Query: "TextMatchQuery", QuerySQLDomain: "eql_v4.query_text_match", Producible: true, Reason: ""}, + {Name: "TextOrdOre", GoName: "TextOrdOre", Family: "text", Suffix: "OrdOre", Plaintext: "string", SQLDomain: "public.eql_v4_text_ord_ore", Indexes: []string{"eq", "ore"}, Query: "TextOrdOreQuery", QuerySQLDomain: "eql_v4.query_text_ord_ore", Producible: false, Reason: "EQL stores block ORE terms and the engine derives CLLW ORE (#1132)"}, + {Name: "TextOrd", GoName: "TextOrd", Family: "text", Suffix: "Ord", Plaintext: "string", SQLDomain: "public.eql_v4_text_ord", Indexes: []string{"eq", "ope"}, Query: "TextOrdQuery", QuerySQLDomain: "eql_v4.query_text_ord", Producible: true, Reason: ""}, + {Name: "TextOrdOpe", GoName: "TextOrdOpe", Family: "text", Suffix: "OrdOpe", Plaintext: "string", SQLDomain: "public.eql_v4_text_ord_ope", Indexes: []string{"eq", "ope"}, Query: "TextOrdOpeQuery", QuerySQLDomain: "eql_v4.query_text_ord_ope", Producible: true, Reason: ""}, + {Name: "TextSearchOre", GoName: "TextSearchOre", Family: "text", Suffix: "SearchOre", Plaintext: "string", SQLDomain: "public.eql_v4_text_search_ore", Indexes: []string{"eq", "ore", "match"}, Query: "TextSearchOreQuery", QuerySQLDomain: "eql_v4.query_text_search_ore", Producible: false, Reason: "EQL stores block ORE terms and the engine derives CLLW ORE (#1132)"}, + {Name: "TextSearch", GoName: "TextSearch", Family: "text", Suffix: "Search", Plaintext: "string", SQLDomain: "public.eql_v4_text_search", Indexes: []string{"eq", "ope", "match"}, Query: "TextSearchQuery", QuerySQLDomain: "eql_v4.query_text_search", Producible: false, Reason: "every query of this type carries a match term, which text shorter than one 3-gram cannot make, so `=` or `<` on short text would be refused; how a query that is not a match leaves it out is not decided (#1131)"}, + {Name: "Boolean", GoName: "Boolean", Family: "boolean", Suffix: "", Plaintext: "bool", SQLDomain: "public.eql_v4_boolean", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: true, Reason: ""}, + {Name: "Real", GoName: "Real", Family: "real", Suffix: "", Plaintext: "float32", SQLDomain: "public.eql_v4_real", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: true, Reason: ""}, + {Name: "RealEq", GoName: "RealEq", Family: "real", Suffix: "Eq", Plaintext: "float32", SQLDomain: "public.eql_v4_real_eq", Indexes: []string{"eq"}, Query: "RealEqQuery", QuerySQLDomain: "eql_v4.query_real_eq", Producible: true, Reason: ""}, + {Name: "RealOrdOre", GoName: "RealOrdOre", Family: "real", Suffix: "OrdOre", Plaintext: "float32", SQLDomain: "public.eql_v4_real_ord_ore", Indexes: []string{"ore"}, Query: "RealOrdOreQuery", QuerySQLDomain: "eql_v4.query_real_ord_ore", Producible: false, Reason: "EQL stores block ORE terms and the engine derives CLLW ORE (#1132)"}, + {Name: "RealOrd", GoName: "RealOrd", Family: "real", Suffix: "Ord", Plaintext: "float32", SQLDomain: "public.eql_v4_real_ord", Indexes: []string{"ope"}, Query: "RealOrdQuery", QuerySQLDomain: "eql_v4.query_real_ord", Producible: true, Reason: ""}, + {Name: "RealOrdOpe", GoName: "RealOrdOpe", Family: "real", Suffix: "OrdOpe", Plaintext: "float32", SQLDomain: "public.eql_v4_real_ord_ope", Indexes: []string{"ope"}, Query: "RealOrdOpeQuery", QuerySQLDomain: "eql_v4.query_real_ord_ope", Producible: true, Reason: ""}, + {Name: "Double", GoName: "Double", Family: "double", Suffix: "", Plaintext: "float64", SQLDomain: "public.eql_v4_double", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: true, Reason: ""}, + {Name: "DoubleEq", GoName: "DoubleEq", Family: "double", Suffix: "Eq", Plaintext: "float64", SQLDomain: "public.eql_v4_double_eq", Indexes: []string{"eq"}, Query: "DoubleEqQuery", QuerySQLDomain: "eql_v4.query_double_eq", Producible: true, Reason: ""}, + {Name: "DoubleOrdOre", GoName: "DoubleOrdOre", Family: "double", Suffix: "OrdOre", Plaintext: "float64", SQLDomain: "public.eql_v4_double_ord_ore", Indexes: []string{"ore"}, Query: "DoubleOrdOreQuery", QuerySQLDomain: "eql_v4.query_double_ord_ore", Producible: false, Reason: "EQL stores block ORE terms and the engine derives CLLW ORE (#1132)"}, + {Name: "DoubleOrd", GoName: "DoubleOrd", Family: "double", Suffix: "Ord", Plaintext: "float64", SQLDomain: "public.eql_v4_double_ord", Indexes: []string{"ope"}, Query: "DoubleOrdQuery", QuerySQLDomain: "eql_v4.query_double_ord", Producible: true, Reason: ""}, + {Name: "DoubleOrdOpe", GoName: "DoubleOrdOpe", Family: "double", Suffix: "OrdOpe", Plaintext: "float64", SQLDomain: "public.eql_v4_double_ord_ope", Indexes: []string{"ope"}, Query: "DoubleOrdOpeQuery", QuerySQLDomain: "eql_v4.query_double_ord_ope", Producible: true, Reason: ""}, + {Name: "SteVecDocument", GoName: "SteVecDocument", Family: "json", Suffix: "Search", Plaintext: "", SQLDomain: "public.eql_v4_json_search", Indexes: []string{"json"}, Query: "SteVecQuery", QuerySQLDomain: "eql_v4.query_json", Producible: false, Reason: "the JSON index is a new operation in the engine (#1060)"}, + {Name: "Json", GoName: "JSON", Family: "json", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v4_json", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "a JSON value seals as a tree of leaves and EQL's `c` holds one; how a document becomes one sealed leaf is not decided"}, +} + +// Integer is the EQL type stored in public.eql_v4_integer: the integer family with no index. +// The engine produces it from an int32. type Integer []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -71,7 +71,7 @@ func (v Integer) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_integer column. +// Scan reads a public.eql_v4_integer column. func (v *Integer) Scan(src any) error { return scan((*[]byte)(v), src, "Integer") } @@ -86,8 +86,8 @@ func (v *Integer) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// IntegerEq is the EQL type stored in public.eql_v3_integer_eq: the integer family with the eq index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// IntegerEq is the EQL type stored in public.eql_v4_integer_eq: the integer family with the eq index. +// The engine produces it from an int32. type IntegerEq []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -95,7 +95,7 @@ func (v IntegerEq) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_integer_eq column. +// Scan reads a public.eql_v4_integer_eq column. func (v *IntegerEq) Scan(src any) error { return scan((*[]byte)(v), src, "IntegerEq") } @@ -110,7 +110,7 @@ func (v *IntegerEq) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// IntegerEqQuery is the query value for IntegerEq: the operand eql_v3.query_integer_eq takes. +// IntegerEqQuery is the query value for IntegerEq: the operand eql_v4.query_integer_eq takes. type IntegerEqQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -118,7 +118,7 @@ func (v IntegerEqQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_integer_eq column. +// Scan reads a eql_v4.query_integer_eq column. func (v *IntegerEqQuery) Scan(src any) error { return scan((*[]byte)(v), src, "IntegerEqQuery") } @@ -133,8 +133,8 @@ func (v *IntegerEqQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// IntegerOrdOre is the EQL type stored in public.eql_v3_integer_ord_ore: the integer family with the ore index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// IntegerOrdOre is the EQL type stored in public.eql_v4_integer_ord_ore: the integer family with the ore index. +// The engine cannot produce it yet: EQL stores block ORE terms and the engine derives CLLW ORE (#1132). type IntegerOrdOre []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -142,7 +142,7 @@ func (v IntegerOrdOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_integer_ord_ore column. +// Scan reads a public.eql_v4_integer_ord_ore column. func (v *IntegerOrdOre) Scan(src any) error { return scan((*[]byte)(v), src, "IntegerOrdOre") } @@ -157,7 +157,7 @@ func (v *IntegerOrdOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// IntegerOrdOreQuery is the query value for IntegerOrdOre: the operand eql_v3.query_integer_ord_ore takes. +// IntegerOrdOreQuery is the query value for IntegerOrdOre: the operand eql_v4.query_integer_ord_ore takes. type IntegerOrdOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -165,7 +165,7 @@ func (v IntegerOrdOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_integer_ord_ore column. +// Scan reads a eql_v4.query_integer_ord_ore column. func (v *IntegerOrdOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "IntegerOrdOreQuery") } @@ -180,8 +180,8 @@ func (v *IntegerOrdOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// IntegerOrd is the EQL type stored in public.eql_v3_integer_ord: the integer family with the ope index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// IntegerOrd is the EQL type stored in public.eql_v4_integer_ord: the integer family with the ope index. +// The engine produces it from an int32. type IntegerOrd []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -189,7 +189,7 @@ func (v IntegerOrd) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_integer_ord column. +// Scan reads a public.eql_v4_integer_ord column. func (v *IntegerOrd) Scan(src any) error { return scan((*[]byte)(v), src, "IntegerOrd") } @@ -204,7 +204,7 @@ func (v *IntegerOrd) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// IntegerOrdQuery is the query value for IntegerOrd: the operand eql_v3.query_integer_ord takes. +// IntegerOrdQuery is the query value for IntegerOrd: the operand eql_v4.query_integer_ord takes. type IntegerOrdQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -212,7 +212,7 @@ func (v IntegerOrdQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_integer_ord column. +// Scan reads a eql_v4.query_integer_ord column. func (v *IntegerOrdQuery) Scan(src any) error { return scan((*[]byte)(v), src, "IntegerOrdQuery") } @@ -227,8 +227,8 @@ func (v *IntegerOrdQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// IntegerOrdOpe is the EQL type stored in public.eql_v3_integer_ord_ope: the integer family with the ope index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// IntegerOrdOpe is the EQL type stored in public.eql_v4_integer_ord_ope: the integer family with the ope index. +// The engine produces it from an int32. type IntegerOrdOpe []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -236,7 +236,7 @@ func (v IntegerOrdOpe) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_integer_ord_ope column. +// Scan reads a public.eql_v4_integer_ord_ope column. func (v *IntegerOrdOpe) Scan(src any) error { return scan((*[]byte)(v), src, "IntegerOrdOpe") } @@ -251,7 +251,7 @@ func (v *IntegerOrdOpe) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// IntegerOrdOpeQuery is the query value for IntegerOrdOpe: the operand eql_v3.query_integer_ord_ope takes. +// IntegerOrdOpeQuery is the query value for IntegerOrdOpe: the operand eql_v4.query_integer_ord_ope takes. type IntegerOrdOpeQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -259,7 +259,7 @@ func (v IntegerOrdOpeQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_integer_ord_ope column. +// Scan reads a eql_v4.query_integer_ord_ope column. func (v *IntegerOrdOpeQuery) Scan(src any) error { return scan((*[]byte)(v), src, "IntegerOrdOpeQuery") } @@ -274,8 +274,8 @@ func (v *IntegerOrdOpeQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// Smallint is the EQL type stored in public.eql_v3_smallint: the smallint family with no index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// Smallint is the EQL type stored in public.eql_v4_smallint: the smallint family with no index. +// The engine produces it from an int16. type Smallint []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -283,7 +283,7 @@ func (v Smallint) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_smallint column. +// Scan reads a public.eql_v4_smallint column. func (v *Smallint) Scan(src any) error { return scan((*[]byte)(v), src, "Smallint") } @@ -298,8 +298,8 @@ func (v *Smallint) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SmallintEq is the EQL type stored in public.eql_v3_smallint_eq: the smallint family with the eq index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// SmallintEq is the EQL type stored in public.eql_v4_smallint_eq: the smallint family with the eq index. +// The engine produces it from an int16. type SmallintEq []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -307,7 +307,7 @@ func (v SmallintEq) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_smallint_eq column. +// Scan reads a public.eql_v4_smallint_eq column. func (v *SmallintEq) Scan(src any) error { return scan((*[]byte)(v), src, "SmallintEq") } @@ -322,7 +322,7 @@ func (v *SmallintEq) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SmallintEqQuery is the query value for SmallintEq: the operand eql_v3.query_smallint_eq takes. +// SmallintEqQuery is the query value for SmallintEq: the operand eql_v4.query_smallint_eq takes. type SmallintEqQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -330,7 +330,7 @@ func (v SmallintEqQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_smallint_eq column. +// Scan reads a eql_v4.query_smallint_eq column. func (v *SmallintEqQuery) Scan(src any) error { return scan((*[]byte)(v), src, "SmallintEqQuery") } @@ -345,8 +345,8 @@ func (v *SmallintEqQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SmallintOrdOre is the EQL type stored in public.eql_v3_smallint_ord_ore: the smallint family with the ore index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// SmallintOrdOre is the EQL type stored in public.eql_v4_smallint_ord_ore: the smallint family with the ore index. +// The engine cannot produce it yet: EQL stores block ORE terms and the engine derives CLLW ORE (#1132). type SmallintOrdOre []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -354,7 +354,7 @@ func (v SmallintOrdOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_smallint_ord_ore column. +// Scan reads a public.eql_v4_smallint_ord_ore column. func (v *SmallintOrdOre) Scan(src any) error { return scan((*[]byte)(v), src, "SmallintOrdOre") } @@ -369,7 +369,7 @@ func (v *SmallintOrdOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SmallintOrdOreQuery is the query value for SmallintOrdOre: the operand eql_v3.query_smallint_ord_ore takes. +// SmallintOrdOreQuery is the query value for SmallintOrdOre: the operand eql_v4.query_smallint_ord_ore takes. type SmallintOrdOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -377,7 +377,7 @@ func (v SmallintOrdOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_smallint_ord_ore column. +// Scan reads a eql_v4.query_smallint_ord_ore column. func (v *SmallintOrdOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "SmallintOrdOreQuery") } @@ -392,8 +392,8 @@ func (v *SmallintOrdOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SmallintOrd is the EQL type stored in public.eql_v3_smallint_ord: the smallint family with the ope index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// SmallintOrd is the EQL type stored in public.eql_v4_smallint_ord: the smallint family with the ope index. +// The engine produces it from an int16. type SmallintOrd []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -401,7 +401,7 @@ func (v SmallintOrd) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_smallint_ord column. +// Scan reads a public.eql_v4_smallint_ord column. func (v *SmallintOrd) Scan(src any) error { return scan((*[]byte)(v), src, "SmallintOrd") } @@ -416,7 +416,7 @@ func (v *SmallintOrd) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SmallintOrdQuery is the query value for SmallintOrd: the operand eql_v3.query_smallint_ord takes. +// SmallintOrdQuery is the query value for SmallintOrd: the operand eql_v4.query_smallint_ord takes. type SmallintOrdQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -424,7 +424,7 @@ func (v SmallintOrdQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_smallint_ord column. +// Scan reads a eql_v4.query_smallint_ord column. func (v *SmallintOrdQuery) Scan(src any) error { return scan((*[]byte)(v), src, "SmallintOrdQuery") } @@ -439,8 +439,8 @@ func (v *SmallintOrdQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SmallintOrdOpe is the EQL type stored in public.eql_v3_smallint_ord_ope: the smallint family with the ope index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// SmallintOrdOpe is the EQL type stored in public.eql_v4_smallint_ord_ope: the smallint family with the ope index. +// The engine produces it from an int16. type SmallintOrdOpe []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -448,7 +448,7 @@ func (v SmallintOrdOpe) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_smallint_ord_ope column. +// Scan reads a public.eql_v4_smallint_ord_ope column. func (v *SmallintOrdOpe) Scan(src any) error { return scan((*[]byte)(v), src, "SmallintOrdOpe") } @@ -463,7 +463,7 @@ func (v *SmallintOrdOpe) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SmallintOrdOpeQuery is the query value for SmallintOrdOpe: the operand eql_v3.query_smallint_ord_ope takes. +// SmallintOrdOpeQuery is the query value for SmallintOrdOpe: the operand eql_v4.query_smallint_ord_ope takes. type SmallintOrdOpeQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -471,7 +471,7 @@ func (v SmallintOrdOpeQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_smallint_ord_ope column. +// Scan reads a eql_v4.query_smallint_ord_ope column. func (v *SmallintOrdOpeQuery) Scan(src any) error { return scan((*[]byte)(v), src, "SmallintOrdOpeQuery") } @@ -486,8 +486,8 @@ func (v *SmallintOrdOpeQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// Bigint is the EQL type stored in public.eql_v3_bigint: the bigint family with no index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// Bigint is the EQL type stored in public.eql_v4_bigint: the bigint family with no index. +// The engine produces it from an int64. type Bigint []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -495,7 +495,7 @@ func (v Bigint) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_bigint column. +// Scan reads a public.eql_v4_bigint column. func (v *Bigint) Scan(src any) error { return scan((*[]byte)(v), src, "Bigint") } @@ -510,8 +510,8 @@ func (v *Bigint) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// BigintEq is the EQL type stored in public.eql_v3_bigint_eq: the bigint family with the eq index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// BigintEq is the EQL type stored in public.eql_v4_bigint_eq: the bigint family with the eq index. +// The engine produces it from an int64. type BigintEq []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -519,7 +519,7 @@ func (v BigintEq) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_bigint_eq column. +// Scan reads a public.eql_v4_bigint_eq column. func (v *BigintEq) Scan(src any) error { return scan((*[]byte)(v), src, "BigintEq") } @@ -534,7 +534,7 @@ func (v *BigintEq) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// BigintEqQuery is the query value for BigintEq: the operand eql_v3.query_bigint_eq takes. +// BigintEqQuery is the query value for BigintEq: the operand eql_v4.query_bigint_eq takes. type BigintEqQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -542,7 +542,7 @@ func (v BigintEqQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_bigint_eq column. +// Scan reads a eql_v4.query_bigint_eq column. func (v *BigintEqQuery) Scan(src any) error { return scan((*[]byte)(v), src, "BigintEqQuery") } @@ -557,8 +557,8 @@ func (v *BigintEqQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// BigintOrdOre is the EQL type stored in public.eql_v3_bigint_ord_ore: the bigint family with the ore index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// BigintOrdOre is the EQL type stored in public.eql_v4_bigint_ord_ore: the bigint family with the ore index. +// The engine cannot produce it yet: EQL stores block ORE terms and the engine derives CLLW ORE (#1132). type BigintOrdOre []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -566,7 +566,7 @@ func (v BigintOrdOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_bigint_ord_ore column. +// Scan reads a public.eql_v4_bigint_ord_ore column. func (v *BigintOrdOre) Scan(src any) error { return scan((*[]byte)(v), src, "BigintOrdOre") } @@ -581,7 +581,7 @@ func (v *BigintOrdOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// BigintOrdOreQuery is the query value for BigintOrdOre: the operand eql_v3.query_bigint_ord_ore takes. +// BigintOrdOreQuery is the query value for BigintOrdOre: the operand eql_v4.query_bigint_ord_ore takes. type BigintOrdOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -589,7 +589,7 @@ func (v BigintOrdOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_bigint_ord_ore column. +// Scan reads a eql_v4.query_bigint_ord_ore column. func (v *BigintOrdOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "BigintOrdOreQuery") } @@ -604,8 +604,8 @@ func (v *BigintOrdOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// BigintOrd is the EQL type stored in public.eql_v3_bigint_ord: the bigint family with the ope index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// BigintOrd is the EQL type stored in public.eql_v4_bigint_ord: the bigint family with the ope index. +// The engine produces it from an int64. type BigintOrd []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -613,7 +613,7 @@ func (v BigintOrd) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_bigint_ord column. +// Scan reads a public.eql_v4_bigint_ord column. func (v *BigintOrd) Scan(src any) error { return scan((*[]byte)(v), src, "BigintOrd") } @@ -628,7 +628,7 @@ func (v *BigintOrd) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// BigintOrdQuery is the query value for BigintOrd: the operand eql_v3.query_bigint_ord takes. +// BigintOrdQuery is the query value for BigintOrd: the operand eql_v4.query_bigint_ord takes. type BigintOrdQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -636,7 +636,7 @@ func (v BigintOrdQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_bigint_ord column. +// Scan reads a eql_v4.query_bigint_ord column. func (v *BigintOrdQuery) Scan(src any) error { return scan((*[]byte)(v), src, "BigintOrdQuery") } @@ -651,8 +651,8 @@ func (v *BigintOrdQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// BigintOrdOpe is the EQL type stored in public.eql_v3_bigint_ord_ope: the bigint family with the ope index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// BigintOrdOpe is the EQL type stored in public.eql_v4_bigint_ord_ope: the bigint family with the ope index. +// The engine produces it from an int64. type BigintOrdOpe []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -660,7 +660,7 @@ func (v BigintOrdOpe) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_bigint_ord_ope column. +// Scan reads a public.eql_v4_bigint_ord_ope column. func (v *BigintOrdOpe) Scan(src any) error { return scan((*[]byte)(v), src, "BigintOrdOpe") } @@ -675,7 +675,7 @@ func (v *BigintOrdOpe) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// BigintOrdOpeQuery is the query value for BigintOrdOpe: the operand eql_v3.query_bigint_ord_ope takes. +// BigintOrdOpeQuery is the query value for BigintOrdOpe: the operand eql_v4.query_bigint_ord_ope takes. type BigintOrdOpeQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -683,7 +683,7 @@ func (v BigintOrdOpeQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_bigint_ord_ope column. +// Scan reads a eql_v4.query_bigint_ord_ope column. func (v *BigintOrdOpeQuery) Scan(src any) error { return scan((*[]byte)(v), src, "BigintOrdOpeQuery") } @@ -698,8 +698,8 @@ func (v *BigintOrdOpeQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// Date is the EQL type stored in public.eql_v3_date: the date family with no index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// Date is the EQL type stored in public.eql_v4_date: the date family with no index. +// The engine produces it from a date. type Date []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -707,7 +707,7 @@ func (v Date) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_date column. +// Scan reads a public.eql_v4_date column. func (v *Date) Scan(src any) error { return scan((*[]byte)(v), src, "Date") } @@ -722,8 +722,8 @@ func (v *Date) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DateEq is the EQL type stored in public.eql_v3_date_eq: the date family with the eq index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// DateEq is the EQL type stored in public.eql_v4_date_eq: the date family with the eq index. +// The engine produces it from a date. type DateEq []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -731,7 +731,7 @@ func (v DateEq) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_date_eq column. +// Scan reads a public.eql_v4_date_eq column. func (v *DateEq) Scan(src any) error { return scan((*[]byte)(v), src, "DateEq") } @@ -746,7 +746,7 @@ func (v *DateEq) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DateEqQuery is the query value for DateEq: the operand eql_v3.query_date_eq takes. +// DateEqQuery is the query value for DateEq: the operand eql_v4.query_date_eq takes. type DateEqQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -754,7 +754,7 @@ func (v DateEqQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_date_eq column. +// Scan reads a eql_v4.query_date_eq column. func (v *DateEqQuery) Scan(src any) error { return scan((*[]byte)(v), src, "DateEqQuery") } @@ -769,8 +769,8 @@ func (v *DateEqQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DateOrdOre is the EQL type stored in public.eql_v3_date_ord_ore: the date family with the ore index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// DateOrdOre is the EQL type stored in public.eql_v4_date_ord_ore: the date family with the ore index. +// The engine cannot produce it yet: the engine derives no order term for a date, timestamp or decimal yet: how they are ordered is not decided (#1236). type DateOrdOre []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -778,7 +778,7 @@ func (v DateOrdOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_date_ord_ore column. +// Scan reads a public.eql_v4_date_ord_ore column. func (v *DateOrdOre) Scan(src any) error { return scan((*[]byte)(v), src, "DateOrdOre") } @@ -793,7 +793,7 @@ func (v *DateOrdOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DateOrdOreQuery is the query value for DateOrdOre: the operand eql_v3.query_date_ord_ore takes. +// DateOrdOreQuery is the query value for DateOrdOre: the operand eql_v4.query_date_ord_ore takes. type DateOrdOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -801,7 +801,7 @@ func (v DateOrdOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_date_ord_ore column. +// Scan reads a eql_v4.query_date_ord_ore column. func (v *DateOrdOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "DateOrdOreQuery") } @@ -816,8 +816,8 @@ func (v *DateOrdOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DateOrd is the EQL type stored in public.eql_v3_date_ord: the date family with the ope index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// DateOrd is the EQL type stored in public.eql_v4_date_ord: the date family with the ope index. +// The engine cannot produce it yet: the engine derives no order term for a date, timestamp or decimal yet: how they are ordered is not decided (#1236). type DateOrd []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -825,7 +825,7 @@ func (v DateOrd) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_date_ord column. +// Scan reads a public.eql_v4_date_ord column. func (v *DateOrd) Scan(src any) error { return scan((*[]byte)(v), src, "DateOrd") } @@ -840,7 +840,7 @@ func (v *DateOrd) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DateOrdQuery is the query value for DateOrd: the operand eql_v3.query_date_ord takes. +// DateOrdQuery is the query value for DateOrd: the operand eql_v4.query_date_ord takes. type DateOrdQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -848,7 +848,7 @@ func (v DateOrdQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_date_ord column. +// Scan reads a eql_v4.query_date_ord column. func (v *DateOrdQuery) Scan(src any) error { return scan((*[]byte)(v), src, "DateOrdQuery") } @@ -863,8 +863,8 @@ func (v *DateOrdQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DateOrdOpe is the EQL type stored in public.eql_v3_date_ord_ope: the date family with the ope index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// DateOrdOpe is the EQL type stored in public.eql_v4_date_ord_ope: the date family with the ope index. +// The engine cannot produce it yet: the engine derives no order term for a date, timestamp or decimal yet: how they are ordered is not decided (#1236). type DateOrdOpe []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -872,7 +872,7 @@ func (v DateOrdOpe) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_date_ord_ope column. +// Scan reads a public.eql_v4_date_ord_ope column. func (v *DateOrdOpe) Scan(src any) error { return scan((*[]byte)(v), src, "DateOrdOpe") } @@ -887,7 +887,7 @@ func (v *DateOrdOpe) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DateOrdOpeQuery is the query value for DateOrdOpe: the operand eql_v3.query_date_ord_ope takes. +// DateOrdOpeQuery is the query value for DateOrdOpe: the operand eql_v4.query_date_ord_ope takes. type DateOrdOpeQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -895,7 +895,7 @@ func (v DateOrdOpeQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_date_ord_ope column. +// Scan reads a eql_v4.query_date_ord_ope column. func (v *DateOrdOpeQuery) Scan(src any) error { return scan((*[]byte)(v), src, "DateOrdOpeQuery") } @@ -910,8 +910,8 @@ func (v *DateOrdOpeQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// Timestamp is the EQL type stored in public.eql_v3_timestamp: the timestamp family with no index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// Timestamp is the EQL type stored in public.eql_v4_timestamp: the timestamp family with no index. +// The engine produces it from a timestamp. type Timestamp []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -919,7 +919,7 @@ func (v Timestamp) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_timestamp column. +// Scan reads a public.eql_v4_timestamp column. func (v *Timestamp) Scan(src any) error { return scan((*[]byte)(v), src, "Timestamp") } @@ -934,8 +934,8 @@ func (v *Timestamp) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TimestampEq is the EQL type stored in public.eql_v3_timestamp_eq: the timestamp family with the eq index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// TimestampEq is the EQL type stored in public.eql_v4_timestamp_eq: the timestamp family with the eq index. +// The engine produces it from a timestamp. type TimestampEq []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -943,7 +943,7 @@ func (v TimestampEq) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_timestamp_eq column. +// Scan reads a public.eql_v4_timestamp_eq column. func (v *TimestampEq) Scan(src any) error { return scan((*[]byte)(v), src, "TimestampEq") } @@ -958,7 +958,7 @@ func (v *TimestampEq) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TimestampEqQuery is the query value for TimestampEq: the operand eql_v3.query_timestamp_eq takes. +// TimestampEqQuery is the query value for TimestampEq: the operand eql_v4.query_timestamp_eq takes. type TimestampEqQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -966,7 +966,7 @@ func (v TimestampEqQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_timestamp_eq column. +// Scan reads a eql_v4.query_timestamp_eq column. func (v *TimestampEqQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TimestampEqQuery") } @@ -981,8 +981,8 @@ func (v *TimestampEqQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TimestampOrdOre is the EQL type stored in public.eql_v3_timestamp_ord_ore: the timestamp family with the ore index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// TimestampOrdOre is the EQL type stored in public.eql_v4_timestamp_ord_ore: the timestamp family with the ore index. +// The engine cannot produce it yet: the engine derives no order term for a date, timestamp or decimal yet: how they are ordered is not decided (#1236). type TimestampOrdOre []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -990,7 +990,7 @@ func (v TimestampOrdOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_timestamp_ord_ore column. +// Scan reads a public.eql_v4_timestamp_ord_ore column. func (v *TimestampOrdOre) Scan(src any) error { return scan((*[]byte)(v), src, "TimestampOrdOre") } @@ -1005,7 +1005,7 @@ func (v *TimestampOrdOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TimestampOrdOreQuery is the query value for TimestampOrdOre: the operand eql_v3.query_timestamp_ord_ore takes. +// TimestampOrdOreQuery is the query value for TimestampOrdOre: the operand eql_v4.query_timestamp_ord_ore takes. type TimestampOrdOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1013,7 +1013,7 @@ func (v TimestampOrdOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_timestamp_ord_ore column. +// Scan reads a eql_v4.query_timestamp_ord_ore column. func (v *TimestampOrdOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TimestampOrdOreQuery") } @@ -1028,8 +1028,8 @@ func (v *TimestampOrdOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TimestampOrd is the EQL type stored in public.eql_v3_timestamp_ord: the timestamp family with the ope index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// TimestampOrd is the EQL type stored in public.eql_v4_timestamp_ord: the timestamp family with the ope index. +// The engine cannot produce it yet: the engine derives no order term for a date, timestamp or decimal yet: how they are ordered is not decided (#1236). type TimestampOrd []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1037,7 +1037,7 @@ func (v TimestampOrd) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_timestamp_ord column. +// Scan reads a public.eql_v4_timestamp_ord column. func (v *TimestampOrd) Scan(src any) error { return scan((*[]byte)(v), src, "TimestampOrd") } @@ -1052,7 +1052,7 @@ func (v *TimestampOrd) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TimestampOrdQuery is the query value for TimestampOrd: the operand eql_v3.query_timestamp_ord takes. +// TimestampOrdQuery is the query value for TimestampOrd: the operand eql_v4.query_timestamp_ord takes. type TimestampOrdQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1060,7 +1060,7 @@ func (v TimestampOrdQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_timestamp_ord column. +// Scan reads a eql_v4.query_timestamp_ord column. func (v *TimestampOrdQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TimestampOrdQuery") } @@ -1075,8 +1075,8 @@ func (v *TimestampOrdQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TimestampOrdOpe is the EQL type stored in public.eql_v3_timestamp_ord_ope: the timestamp family with the ope index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// TimestampOrdOpe is the EQL type stored in public.eql_v4_timestamp_ord_ope: the timestamp family with the ope index. +// The engine cannot produce it yet: the engine derives no order term for a date, timestamp or decimal yet: how they are ordered is not decided (#1236). type TimestampOrdOpe []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1084,7 +1084,7 @@ func (v TimestampOrdOpe) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_timestamp_ord_ope column. +// Scan reads a public.eql_v4_timestamp_ord_ope column. func (v *TimestampOrdOpe) Scan(src any) error { return scan((*[]byte)(v), src, "TimestampOrdOpe") } @@ -1099,7 +1099,7 @@ func (v *TimestampOrdOpe) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TimestampOrdOpeQuery is the query value for TimestampOrdOpe: the operand eql_v3.query_timestamp_ord_ope takes. +// TimestampOrdOpeQuery is the query value for TimestampOrdOpe: the operand eql_v4.query_timestamp_ord_ope takes. type TimestampOrdOpeQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1107,7 +1107,7 @@ func (v TimestampOrdOpeQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_timestamp_ord_ope column. +// Scan reads a eql_v4.query_timestamp_ord_ope column. func (v *TimestampOrdOpeQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TimestampOrdOpeQuery") } @@ -1122,8 +1122,8 @@ func (v *TimestampOrdOpeQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// Numeric is the EQL type stored in public.eql_v3_numeric: the numeric family with no index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// Numeric is the EQL type stored in public.eql_v4_numeric: the numeric family with no index. +// The engine produces it from a decimal. type Numeric []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1131,7 +1131,7 @@ func (v Numeric) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_numeric column. +// Scan reads a public.eql_v4_numeric column. func (v *Numeric) Scan(src any) error { return scan((*[]byte)(v), src, "Numeric") } @@ -1146,8 +1146,8 @@ func (v *Numeric) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// NumericEq is the EQL type stored in public.eql_v3_numeric_eq: the numeric family with the eq index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// NumericEq is the EQL type stored in public.eql_v4_numeric_eq: the numeric family with the eq index. +// The engine produces it from a decimal. type NumericEq []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1155,7 +1155,7 @@ func (v NumericEq) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_numeric_eq column. +// Scan reads a public.eql_v4_numeric_eq column. func (v *NumericEq) Scan(src any) error { return scan((*[]byte)(v), src, "NumericEq") } @@ -1170,7 +1170,7 @@ func (v *NumericEq) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// NumericEqQuery is the query value for NumericEq: the operand eql_v3.query_numeric_eq takes. +// NumericEqQuery is the query value for NumericEq: the operand eql_v4.query_numeric_eq takes. type NumericEqQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1178,7 +1178,7 @@ func (v NumericEqQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_numeric_eq column. +// Scan reads a eql_v4.query_numeric_eq column. func (v *NumericEqQuery) Scan(src any) error { return scan((*[]byte)(v), src, "NumericEqQuery") } @@ -1193,8 +1193,8 @@ func (v *NumericEqQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// NumericOrdOre is the EQL type stored in public.eql_v3_numeric_ord_ore: the numeric family with the ore index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// NumericOrdOre is the EQL type stored in public.eql_v4_numeric_ord_ore: the numeric family with the ore index. +// The engine cannot produce it yet: the engine derives no order term for a date, timestamp or decimal yet: how they are ordered is not decided (#1236). type NumericOrdOre []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1202,7 +1202,7 @@ func (v NumericOrdOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_numeric_ord_ore column. +// Scan reads a public.eql_v4_numeric_ord_ore column. func (v *NumericOrdOre) Scan(src any) error { return scan((*[]byte)(v), src, "NumericOrdOre") } @@ -1217,7 +1217,7 @@ func (v *NumericOrdOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// NumericOrdOreQuery is the query value for NumericOrdOre: the operand eql_v3.query_numeric_ord_ore takes. +// NumericOrdOreQuery is the query value for NumericOrdOre: the operand eql_v4.query_numeric_ord_ore takes. type NumericOrdOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1225,7 +1225,7 @@ func (v NumericOrdOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_numeric_ord_ore column. +// Scan reads a eql_v4.query_numeric_ord_ore column. func (v *NumericOrdOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "NumericOrdOreQuery") } @@ -1240,8 +1240,8 @@ func (v *NumericOrdOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// NumericOrd is the EQL type stored in public.eql_v3_numeric_ord: the numeric family with the ope index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// NumericOrd is the EQL type stored in public.eql_v4_numeric_ord: the numeric family with the ope index. +// The engine cannot produce it yet: the engine derives no order term for a date, timestamp or decimal yet: how they are ordered is not decided (#1236). type NumericOrd []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1249,7 +1249,7 @@ func (v NumericOrd) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_numeric_ord column. +// Scan reads a public.eql_v4_numeric_ord column. func (v *NumericOrd) Scan(src any) error { return scan((*[]byte)(v), src, "NumericOrd") } @@ -1264,7 +1264,7 @@ func (v *NumericOrd) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// NumericOrdQuery is the query value for NumericOrd: the operand eql_v3.query_numeric_ord takes. +// NumericOrdQuery is the query value for NumericOrd: the operand eql_v4.query_numeric_ord takes. type NumericOrdQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1272,7 +1272,7 @@ func (v NumericOrdQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_numeric_ord column. +// Scan reads a eql_v4.query_numeric_ord column. func (v *NumericOrdQuery) Scan(src any) error { return scan((*[]byte)(v), src, "NumericOrdQuery") } @@ -1287,8 +1287,8 @@ func (v *NumericOrdQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// NumericOrdOpe is the EQL type stored in public.eql_v3_numeric_ord_ope: the numeric family with the ope index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// NumericOrdOpe is the EQL type stored in public.eql_v4_numeric_ord_ope: the numeric family with the ope index. +// The engine cannot produce it yet: the engine derives no order term for a date, timestamp or decimal yet: how they are ordered is not decided (#1236). type NumericOrdOpe []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1296,7 +1296,7 @@ func (v NumericOrdOpe) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_numeric_ord_ope column. +// Scan reads a public.eql_v4_numeric_ord_ope column. func (v *NumericOrdOpe) Scan(src any) error { return scan((*[]byte)(v), src, "NumericOrdOpe") } @@ -1311,7 +1311,7 @@ func (v *NumericOrdOpe) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// NumericOrdOpeQuery is the query value for NumericOrdOpe: the operand eql_v3.query_numeric_ord_ope takes. +// NumericOrdOpeQuery is the query value for NumericOrdOpe: the operand eql_v4.query_numeric_ord_ope takes. type NumericOrdOpeQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1319,7 +1319,7 @@ func (v NumericOrdOpeQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_numeric_ord_ope column. +// Scan reads a eql_v4.query_numeric_ord_ope column. func (v *NumericOrdOpeQuery) Scan(src any) error { return scan((*[]byte)(v), src, "NumericOrdOpeQuery") } @@ -1334,8 +1334,8 @@ func (v *NumericOrdOpeQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// Text is the EQL type stored in public.eql_v3_text: the text family with no index. -// The engine cannot produce it yet: the storage-only text domain follows once TextEq is proven end to end in PostgreSQL. +// Text is the EQL type stored in public.eql_v4_text: the text family with no index. +// The engine produces it from a string. type Text []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1343,7 +1343,7 @@ func (v Text) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_text column. +// Scan reads a public.eql_v4_text column. func (v *Text) Scan(src any) error { return scan((*[]byte)(v), src, "Text") } @@ -1358,7 +1358,7 @@ func (v *Text) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextEq is the EQL type stored in public.eql_v3_text_eq: the text family with the eq index. +// TextEq is the EQL type stored in public.eql_v4_text_eq: the text family with the eq index. // The engine produces it from a string. type TextEq []byte @@ -1367,7 +1367,7 @@ func (v TextEq) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_text_eq column. +// Scan reads a public.eql_v4_text_eq column. func (v *TextEq) Scan(src any) error { return scan((*[]byte)(v), src, "TextEq") } @@ -1382,7 +1382,7 @@ func (v *TextEq) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextEqQuery is the query value for TextEq: the operand eql_v3.query_text_eq takes. +// TextEqQuery is the query value for TextEq: the operand eql_v4.query_text_eq takes. type TextEqQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1390,7 +1390,7 @@ func (v TextEqQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_text_eq column. +// Scan reads a eql_v4.query_text_eq column. func (v *TextEqQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TextEqQuery") } @@ -1405,8 +1405,8 @@ func (v *TextEqQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextMatch is the EQL type stored in public.eql_v3_text_match: the text family with the match index. -// The engine cannot produce it yet: the engine derives match and OPE terms, but no EQL type is built from them yet. +// TextMatch is the EQL type stored in public.eql_v4_text_match: the text family with the match index. +// The engine produces it from a string. type TextMatch []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1414,7 +1414,7 @@ func (v TextMatch) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_text_match column. +// Scan reads a public.eql_v4_text_match column. func (v *TextMatch) Scan(src any) error { return scan((*[]byte)(v), src, "TextMatch") } @@ -1429,7 +1429,7 @@ func (v *TextMatch) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextMatchQuery is the query value for TextMatch: the operand eql_v3.query_text_match takes. +// TextMatchQuery is the query value for TextMatch: the operand eql_v4.query_text_match takes. type TextMatchQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1437,7 +1437,7 @@ func (v TextMatchQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_text_match column. +// Scan reads a eql_v4.query_text_match column. func (v *TextMatchQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TextMatchQuery") } @@ -1452,8 +1452,8 @@ func (v *TextMatchQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextOrdOre is the EQL type stored in public.eql_v3_text_ord_ore: the text family with the eq and ore indexes. -// The engine cannot produce it yet: EQL stores a block ORE term and the engine derives a CLLW ORE term; the two are different algorithms. +// TextOrdOre is the EQL type stored in public.eql_v4_text_ord_ore: the text family with the eq and ore indexes. +// The engine cannot produce it yet: EQL stores block ORE terms and the engine derives CLLW ORE (#1132). type TextOrdOre []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1461,7 +1461,7 @@ func (v TextOrdOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_text_ord_ore column. +// Scan reads a public.eql_v4_text_ord_ore column. func (v *TextOrdOre) Scan(src any) error { return scan((*[]byte)(v), src, "TextOrdOre") } @@ -1476,7 +1476,7 @@ func (v *TextOrdOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextOrdOreQuery is the query value for TextOrdOre: the operand eql_v3.query_text_ord_ore takes. +// TextOrdOreQuery is the query value for TextOrdOre: the operand eql_v4.query_text_ord_ore takes. type TextOrdOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1484,7 +1484,7 @@ func (v TextOrdOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_text_ord_ore column. +// Scan reads a eql_v4.query_text_ord_ore column. func (v *TextOrdOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TextOrdOreQuery") } @@ -1499,8 +1499,8 @@ func (v *TextOrdOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextOrd is the EQL type stored in public.eql_v3_text_ord: the text family with the eq and ope indexes. -// The engine cannot produce it yet: the engine derives match and OPE terms, but no EQL type is built from them yet. +// TextOrd is the EQL type stored in public.eql_v4_text_ord: the text family with the eq and ope indexes. +// The engine produces it from a string. type TextOrd []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1508,7 +1508,7 @@ func (v TextOrd) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_text_ord column. +// Scan reads a public.eql_v4_text_ord column. func (v *TextOrd) Scan(src any) error { return scan((*[]byte)(v), src, "TextOrd") } @@ -1523,7 +1523,7 @@ func (v *TextOrd) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextOrdQuery is the query value for TextOrd: the operand eql_v3.query_text_ord takes. +// TextOrdQuery is the query value for TextOrd: the operand eql_v4.query_text_ord takes. type TextOrdQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1531,7 +1531,7 @@ func (v TextOrdQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_text_ord column. +// Scan reads a eql_v4.query_text_ord column. func (v *TextOrdQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TextOrdQuery") } @@ -1546,8 +1546,8 @@ func (v *TextOrdQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextOrdOpe is the EQL type stored in public.eql_v3_text_ord_ope: the text family with the eq and ope indexes. -// The engine cannot produce it yet: the engine derives match and OPE terms, but no EQL type is built from them yet. +// TextOrdOpe is the EQL type stored in public.eql_v4_text_ord_ope: the text family with the eq and ope indexes. +// The engine produces it from a string. type TextOrdOpe []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1555,7 +1555,7 @@ func (v TextOrdOpe) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_text_ord_ope column. +// Scan reads a public.eql_v4_text_ord_ope column. func (v *TextOrdOpe) Scan(src any) error { return scan((*[]byte)(v), src, "TextOrdOpe") } @@ -1570,7 +1570,7 @@ func (v *TextOrdOpe) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextOrdOpeQuery is the query value for TextOrdOpe: the operand eql_v3.query_text_ord_ope takes. +// TextOrdOpeQuery is the query value for TextOrdOpe: the operand eql_v4.query_text_ord_ope takes. type TextOrdOpeQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1578,7 +1578,7 @@ func (v TextOrdOpeQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_text_ord_ope column. +// Scan reads a eql_v4.query_text_ord_ope column. func (v *TextOrdOpeQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TextOrdOpeQuery") } @@ -1593,8 +1593,8 @@ func (v *TextOrdOpeQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextSearchOre is the EQL type stored in public.eql_v3_text_search_ore: the text family with the eq and ore and match indexes. -// The engine cannot produce it yet: EQL stores a block ORE term and the engine derives a CLLW ORE term; the two are different algorithms. +// TextSearchOre is the EQL type stored in public.eql_v4_text_search_ore: the text family with the eq and ore and match indexes. +// The engine cannot produce it yet: EQL stores block ORE terms and the engine derives CLLW ORE (#1132). type TextSearchOre []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1602,7 +1602,7 @@ func (v TextSearchOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_text_search_ore column. +// Scan reads a public.eql_v4_text_search_ore column. func (v *TextSearchOre) Scan(src any) error { return scan((*[]byte)(v), src, "TextSearchOre") } @@ -1617,7 +1617,7 @@ func (v *TextSearchOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextSearchOreQuery is the query value for TextSearchOre: the operand eql_v3.query_text_search_ore takes. +// TextSearchOreQuery is the query value for TextSearchOre: the operand eql_v4.query_text_search_ore takes. type TextSearchOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1625,7 +1625,7 @@ func (v TextSearchOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_text_search_ore column. +// Scan reads a eql_v4.query_text_search_ore column. func (v *TextSearchOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TextSearchOreQuery") } @@ -1640,8 +1640,8 @@ func (v *TextSearchOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextSearch is the EQL type stored in public.eql_v3_text_search: the text family with the eq and ope and match indexes. -// The engine cannot produce it yet: the engine derives match and OPE terms, but no EQL type is built from them yet. +// TextSearch is the EQL type stored in public.eql_v4_text_search: the text family with the eq and ope and match indexes. +// The engine cannot produce it yet: every query of this type carries a match term, which text shorter than one 3-gram cannot make, so `=` or `<` on short text would be refused; how a query that is not a match leaves it out is not decided (#1131). type TextSearch []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1649,7 +1649,7 @@ func (v TextSearch) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_text_search column. +// Scan reads a public.eql_v4_text_search column. func (v *TextSearch) Scan(src any) error { return scan((*[]byte)(v), src, "TextSearch") } @@ -1664,7 +1664,7 @@ func (v *TextSearch) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextSearchQuery is the query value for TextSearch: the operand eql_v3.query_text_search takes. +// TextSearchQuery is the query value for TextSearch: the operand eql_v4.query_text_search takes. type TextSearchQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1672,7 +1672,7 @@ func (v TextSearchQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_text_search column. +// Scan reads a eql_v4.query_text_search column. func (v *TextSearchQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TextSearchQuery") } @@ -1687,8 +1687,8 @@ func (v *TextSearchQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// Boolean is the EQL type stored in public.eql_v3_boolean: the boolean family with no index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// Boolean is the EQL type stored in public.eql_v4_boolean: the boolean family with no index. +// The engine produces it from a bool. type Boolean []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1696,7 +1696,7 @@ func (v Boolean) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_boolean column. +// Scan reads a public.eql_v4_boolean column. func (v *Boolean) Scan(src any) error { return scan((*[]byte)(v), src, "Boolean") } @@ -1711,8 +1711,8 @@ func (v *Boolean) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// Real is the EQL type stored in public.eql_v3_real: the real family with no index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// Real is the EQL type stored in public.eql_v4_real: the real family with no index. +// The engine produces it from a float32. type Real []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1720,7 +1720,7 @@ func (v Real) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_real column. +// Scan reads a public.eql_v4_real column. func (v *Real) Scan(src any) error { return scan((*[]byte)(v), src, "Real") } @@ -1735,8 +1735,8 @@ func (v *Real) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// RealEq is the EQL type stored in public.eql_v3_real_eq: the real family with the eq index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// RealEq is the EQL type stored in public.eql_v4_real_eq: the real family with the eq index. +// The engine produces it from a float32. type RealEq []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1744,7 +1744,7 @@ func (v RealEq) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_real_eq column. +// Scan reads a public.eql_v4_real_eq column. func (v *RealEq) Scan(src any) error { return scan((*[]byte)(v), src, "RealEq") } @@ -1759,7 +1759,7 @@ func (v *RealEq) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// RealEqQuery is the query value for RealEq: the operand eql_v3.query_real_eq takes. +// RealEqQuery is the query value for RealEq: the operand eql_v4.query_real_eq takes. type RealEqQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1767,7 +1767,7 @@ func (v RealEqQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_real_eq column. +// Scan reads a eql_v4.query_real_eq column. func (v *RealEqQuery) Scan(src any) error { return scan((*[]byte)(v), src, "RealEqQuery") } @@ -1782,8 +1782,8 @@ func (v *RealEqQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// RealOrdOre is the EQL type stored in public.eql_v3_real_ord_ore: the real family with the ore index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// RealOrdOre is the EQL type stored in public.eql_v4_real_ord_ore: the real family with the ore index. +// The engine cannot produce it yet: EQL stores block ORE terms and the engine derives CLLW ORE (#1132). type RealOrdOre []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1791,7 +1791,7 @@ func (v RealOrdOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_real_ord_ore column. +// Scan reads a public.eql_v4_real_ord_ore column. func (v *RealOrdOre) Scan(src any) error { return scan((*[]byte)(v), src, "RealOrdOre") } @@ -1806,7 +1806,7 @@ func (v *RealOrdOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// RealOrdOreQuery is the query value for RealOrdOre: the operand eql_v3.query_real_ord_ore takes. +// RealOrdOreQuery is the query value for RealOrdOre: the operand eql_v4.query_real_ord_ore takes. type RealOrdOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1814,7 +1814,7 @@ func (v RealOrdOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_real_ord_ore column. +// Scan reads a eql_v4.query_real_ord_ore column. func (v *RealOrdOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "RealOrdOreQuery") } @@ -1829,8 +1829,8 @@ func (v *RealOrdOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// RealOrd is the EQL type stored in public.eql_v3_real_ord: the real family with the ope index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// RealOrd is the EQL type stored in public.eql_v4_real_ord: the real family with the ope index. +// The engine produces it from a float32. type RealOrd []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1838,7 +1838,7 @@ func (v RealOrd) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_real_ord column. +// Scan reads a public.eql_v4_real_ord column. func (v *RealOrd) Scan(src any) error { return scan((*[]byte)(v), src, "RealOrd") } @@ -1853,7 +1853,7 @@ func (v *RealOrd) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// RealOrdQuery is the query value for RealOrd: the operand eql_v3.query_real_ord takes. +// RealOrdQuery is the query value for RealOrd: the operand eql_v4.query_real_ord takes. type RealOrdQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1861,7 +1861,7 @@ func (v RealOrdQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_real_ord column. +// Scan reads a eql_v4.query_real_ord column. func (v *RealOrdQuery) Scan(src any) error { return scan((*[]byte)(v), src, "RealOrdQuery") } @@ -1876,8 +1876,8 @@ func (v *RealOrdQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// RealOrdOpe is the EQL type stored in public.eql_v3_real_ord_ope: the real family with the ope index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// RealOrdOpe is the EQL type stored in public.eql_v4_real_ord_ope: the real family with the ope index. +// The engine produces it from a float32. type RealOrdOpe []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1885,7 +1885,7 @@ func (v RealOrdOpe) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_real_ord_ope column. +// Scan reads a public.eql_v4_real_ord_ope column. func (v *RealOrdOpe) Scan(src any) error { return scan((*[]byte)(v), src, "RealOrdOpe") } @@ -1900,7 +1900,7 @@ func (v *RealOrdOpe) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// RealOrdOpeQuery is the query value for RealOrdOpe: the operand eql_v3.query_real_ord_ope takes. +// RealOrdOpeQuery is the query value for RealOrdOpe: the operand eql_v4.query_real_ord_ope takes. type RealOrdOpeQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1908,7 +1908,7 @@ func (v RealOrdOpeQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_real_ord_ope column. +// Scan reads a eql_v4.query_real_ord_ope column. func (v *RealOrdOpeQuery) Scan(src any) error { return scan((*[]byte)(v), src, "RealOrdOpeQuery") } @@ -1923,8 +1923,8 @@ func (v *RealOrdOpeQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// Double is the EQL type stored in public.eql_v3_double: the double family with no index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// Double is the EQL type stored in public.eql_v4_double: the double family with no index. +// The engine produces it from a float64. type Double []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1932,7 +1932,7 @@ func (v Double) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_double column. +// Scan reads a public.eql_v4_double column. func (v *Double) Scan(src any) error { return scan((*[]byte)(v), src, "Double") } @@ -1947,8 +1947,8 @@ func (v *Double) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DoubleEq is the EQL type stored in public.eql_v3_double_eq: the double family with the eq index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// DoubleEq is the EQL type stored in public.eql_v4_double_eq: the double family with the eq index. +// The engine produces it from a float64. type DoubleEq []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1956,7 +1956,7 @@ func (v DoubleEq) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_double_eq column. +// Scan reads a public.eql_v4_double_eq column. func (v *DoubleEq) Scan(src any) error { return scan((*[]byte)(v), src, "DoubleEq") } @@ -1971,7 +1971,7 @@ func (v *DoubleEq) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DoubleEqQuery is the query value for DoubleEq: the operand eql_v3.query_double_eq takes. +// DoubleEqQuery is the query value for DoubleEq: the operand eql_v4.query_double_eq takes. type DoubleEqQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1979,7 +1979,7 @@ func (v DoubleEqQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_double_eq column. +// Scan reads a eql_v4.query_double_eq column. func (v *DoubleEqQuery) Scan(src any) error { return scan((*[]byte)(v), src, "DoubleEqQuery") } @@ -1994,8 +1994,8 @@ func (v *DoubleEqQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DoubleOrdOre is the EQL type stored in public.eql_v3_double_ord_ore: the double family with the ore index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// DoubleOrdOre is the EQL type stored in public.eql_v4_double_ord_ore: the double family with the ore index. +// The engine cannot produce it yet: EQL stores block ORE terms and the engine derives CLLW ORE (#1132). type DoubleOrdOre []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -2003,7 +2003,7 @@ func (v DoubleOrdOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_double_ord_ore column. +// Scan reads a public.eql_v4_double_ord_ore column. func (v *DoubleOrdOre) Scan(src any) error { return scan((*[]byte)(v), src, "DoubleOrdOre") } @@ -2018,7 +2018,7 @@ func (v *DoubleOrdOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DoubleOrdOreQuery is the query value for DoubleOrdOre: the operand eql_v3.query_double_ord_ore takes. +// DoubleOrdOreQuery is the query value for DoubleOrdOre: the operand eql_v4.query_double_ord_ore takes. type DoubleOrdOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -2026,7 +2026,7 @@ func (v DoubleOrdOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_double_ord_ore column. +// Scan reads a eql_v4.query_double_ord_ore column. func (v *DoubleOrdOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "DoubleOrdOreQuery") } @@ -2041,8 +2041,8 @@ func (v *DoubleOrdOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DoubleOrd is the EQL type stored in public.eql_v3_double_ord: the double family with the ope index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// DoubleOrd is the EQL type stored in public.eql_v4_double_ord: the double family with the ope index. +// The engine produces it from a float64. type DoubleOrd []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -2050,7 +2050,7 @@ func (v DoubleOrd) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_double_ord column. +// Scan reads a public.eql_v4_double_ord column. func (v *DoubleOrd) Scan(src any) error { return scan((*[]byte)(v), src, "DoubleOrd") } @@ -2065,7 +2065,7 @@ func (v *DoubleOrd) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DoubleOrdQuery is the query value for DoubleOrd: the operand eql_v3.query_double_ord takes. +// DoubleOrdQuery is the query value for DoubleOrd: the operand eql_v4.query_double_ord takes. type DoubleOrdQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -2073,7 +2073,7 @@ func (v DoubleOrdQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_double_ord column. +// Scan reads a eql_v4.query_double_ord column. func (v *DoubleOrdQuery) Scan(src any) error { return scan((*[]byte)(v), src, "DoubleOrdQuery") } @@ -2088,8 +2088,8 @@ func (v *DoubleOrdQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DoubleOrdOpe is the EQL type stored in public.eql_v3_double_ord_ope: the double family with the ope index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// DoubleOrdOpe is the EQL type stored in public.eql_v4_double_ord_ope: the double family with the ope index. +// The engine produces it from a float64. type DoubleOrdOpe []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -2097,7 +2097,7 @@ func (v DoubleOrdOpe) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_double_ord_ope column. +// Scan reads a public.eql_v4_double_ord_ope column. func (v *DoubleOrdOpe) Scan(src any) error { return scan((*[]byte)(v), src, "DoubleOrdOpe") } @@ -2112,7 +2112,7 @@ func (v *DoubleOrdOpe) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DoubleOrdOpeQuery is the query value for DoubleOrdOpe: the operand eql_v3.query_double_ord_ope takes. +// DoubleOrdOpeQuery is the query value for DoubleOrdOpe: the operand eql_v4.query_double_ord_ope takes. type DoubleOrdOpeQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -2120,7 +2120,7 @@ func (v DoubleOrdOpeQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_double_ord_ope column. +// Scan reads a eql_v4.query_double_ord_ope column. func (v *DoubleOrdOpeQuery) Scan(src any) error { return scan((*[]byte)(v), src, "DoubleOrdOpeQuery") } @@ -2135,8 +2135,8 @@ func (v *DoubleOrdOpeQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SteVecDocument is the EQL type stored in public.eql_v3_json_search: the json family with the json index. -// The engine cannot produce it yet: the JSON index is a new operation in the engine. +// SteVecDocument is the EQL type stored in public.eql_v4_json_search: the json family with the json index. +// The engine cannot produce it yet: the JSON index is a new operation in the engine (#1060). type SteVecDocument []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -2144,7 +2144,7 @@ func (v SteVecDocument) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_json_search column. +// Scan reads a public.eql_v4_json_search column. func (v *SteVecDocument) Scan(src any) error { return scan((*[]byte)(v), src, "SteVecDocument") } @@ -2159,7 +2159,7 @@ func (v *SteVecDocument) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SteVecQuery is the query value for SteVecDocument: the operand eql_v3.query_json takes. +// SteVecQuery is the query value for SteVecDocument: the operand eql_v4.query_json takes. type SteVecQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -2167,7 +2167,7 @@ func (v SteVecQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_json column. +// Scan reads a eql_v4.query_json column. func (v *SteVecQuery) Scan(src any) error { return scan((*[]byte)(v), src, "SteVecQuery") } @@ -2182,8 +2182,8 @@ func (v *SteVecQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// JSON is the EQL type stored in public.eql_v3_json: the json family with no index. -// The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. +// JSON is the EQL type stored in public.eql_v4_json: the json family with no index. +// The engine cannot produce it yet: a JSON value seals as a tree of leaves and EQL's `c` holds one; how a document becomes one sealed leaf is not decided. type JSON []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -2191,7 +2191,7 @@ func (v JSON) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_json column. +// Scan reads a public.eql_v4_json column. func (v *JSON) Scan(src any) error { return scan((*[]byte)(v), src, "JSON") } @@ -2205,3 +2205,435 @@ func (v JSON) MarshalJSON() ([]byte, error) { func (v *JSON) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } + +// IntegerRangeOreQuery is a range query value over the ore index of the integer family: both bounds of one BETWEEN, +// included, as the one operand eql_v4.query_integer_range_ore takes in eql_v4.between. It ranges over IntegerOrdOre. +type IntegerRangeOreQuery []byte + +// Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. +func (v IntegerRangeOreQuery) Value() (driver.Value, error) { + return value(v) +} + +// Scan reads a eql_v4.query_integer_range_ore column. +func (v *IntegerRangeOreQuery) Scan(src any) error { + return scan((*[]byte)(v), src, "IntegerRangeOreQuery") +} + +// MarshalJSON is the EQL value as the JSON it is, or null when empty. +func (v IntegerRangeOreQuery) MarshalJSON() ([]byte, error) { + return marshal(v, "IntegerRangeOreQuery") +} + +// UnmarshalJSON reads the EQL value from JSON, as it is. +func (v *IntegerRangeOreQuery) UnmarshalJSON(b []byte) error { + return unmarshal((*[]byte)(v), b) +} + +// IntegerRangeOpeQuery is a range query value over the ope index of the integer family: both bounds of one BETWEEN, +// included, as the one operand eql_v4.query_integer_range_ope takes in eql_v4.between. It ranges over IntegerOrd, IntegerOrdOpe. +type IntegerRangeOpeQuery []byte + +// Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. +func (v IntegerRangeOpeQuery) Value() (driver.Value, error) { + return value(v) +} + +// Scan reads a eql_v4.query_integer_range_ope column. +func (v *IntegerRangeOpeQuery) Scan(src any) error { + return scan((*[]byte)(v), src, "IntegerRangeOpeQuery") +} + +// MarshalJSON is the EQL value as the JSON it is, or null when empty. +func (v IntegerRangeOpeQuery) MarshalJSON() ([]byte, error) { + return marshal(v, "IntegerRangeOpeQuery") +} + +// UnmarshalJSON reads the EQL value from JSON, as it is. +func (v *IntegerRangeOpeQuery) UnmarshalJSON(b []byte) error { + return unmarshal((*[]byte)(v), b) +} + +// SmallintRangeOreQuery is a range query value over the ore index of the smallint family: both bounds of one BETWEEN, +// included, as the one operand eql_v4.query_smallint_range_ore takes in eql_v4.between. It ranges over SmallintOrdOre. +type SmallintRangeOreQuery []byte + +// Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. +func (v SmallintRangeOreQuery) Value() (driver.Value, error) { + return value(v) +} + +// Scan reads a eql_v4.query_smallint_range_ore column. +func (v *SmallintRangeOreQuery) Scan(src any) error { + return scan((*[]byte)(v), src, "SmallintRangeOreQuery") +} + +// MarshalJSON is the EQL value as the JSON it is, or null when empty. +func (v SmallintRangeOreQuery) MarshalJSON() ([]byte, error) { + return marshal(v, "SmallintRangeOreQuery") +} + +// UnmarshalJSON reads the EQL value from JSON, as it is. +func (v *SmallintRangeOreQuery) UnmarshalJSON(b []byte) error { + return unmarshal((*[]byte)(v), b) +} + +// SmallintRangeOpeQuery is a range query value over the ope index of the smallint family: both bounds of one BETWEEN, +// included, as the one operand eql_v4.query_smallint_range_ope takes in eql_v4.between. It ranges over SmallintOrd, SmallintOrdOpe. +type SmallintRangeOpeQuery []byte + +// Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. +func (v SmallintRangeOpeQuery) Value() (driver.Value, error) { + return value(v) +} + +// Scan reads a eql_v4.query_smallint_range_ope column. +func (v *SmallintRangeOpeQuery) Scan(src any) error { + return scan((*[]byte)(v), src, "SmallintRangeOpeQuery") +} + +// MarshalJSON is the EQL value as the JSON it is, or null when empty. +func (v SmallintRangeOpeQuery) MarshalJSON() ([]byte, error) { + return marshal(v, "SmallintRangeOpeQuery") +} + +// UnmarshalJSON reads the EQL value from JSON, as it is. +func (v *SmallintRangeOpeQuery) UnmarshalJSON(b []byte) error { + return unmarshal((*[]byte)(v), b) +} + +// BigintRangeOreQuery is a range query value over the ore index of the bigint family: both bounds of one BETWEEN, +// included, as the one operand eql_v4.query_bigint_range_ore takes in eql_v4.between. It ranges over BigintOrdOre. +type BigintRangeOreQuery []byte + +// Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. +func (v BigintRangeOreQuery) Value() (driver.Value, error) { + return value(v) +} + +// Scan reads a eql_v4.query_bigint_range_ore column. +func (v *BigintRangeOreQuery) Scan(src any) error { + return scan((*[]byte)(v), src, "BigintRangeOreQuery") +} + +// MarshalJSON is the EQL value as the JSON it is, or null when empty. +func (v BigintRangeOreQuery) MarshalJSON() ([]byte, error) { + return marshal(v, "BigintRangeOreQuery") +} + +// UnmarshalJSON reads the EQL value from JSON, as it is. +func (v *BigintRangeOreQuery) UnmarshalJSON(b []byte) error { + return unmarshal((*[]byte)(v), b) +} + +// BigintRangeOpeQuery is a range query value over the ope index of the bigint family: both bounds of one BETWEEN, +// included, as the one operand eql_v4.query_bigint_range_ope takes in eql_v4.between. It ranges over BigintOrd, BigintOrdOpe. +type BigintRangeOpeQuery []byte + +// Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. +func (v BigintRangeOpeQuery) Value() (driver.Value, error) { + return value(v) +} + +// Scan reads a eql_v4.query_bigint_range_ope column. +func (v *BigintRangeOpeQuery) Scan(src any) error { + return scan((*[]byte)(v), src, "BigintRangeOpeQuery") +} + +// MarshalJSON is the EQL value as the JSON it is, or null when empty. +func (v BigintRangeOpeQuery) MarshalJSON() ([]byte, error) { + return marshal(v, "BigintRangeOpeQuery") +} + +// UnmarshalJSON reads the EQL value from JSON, as it is. +func (v *BigintRangeOpeQuery) UnmarshalJSON(b []byte) error { + return unmarshal((*[]byte)(v), b) +} + +// DateRangeOreQuery is a range query value over the ore index of the date family: both bounds of one BETWEEN, +// included, as the one operand eql_v4.query_date_range_ore takes in eql_v4.between. It ranges over DateOrdOre. +type DateRangeOreQuery []byte + +// Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. +func (v DateRangeOreQuery) Value() (driver.Value, error) { + return value(v) +} + +// Scan reads a eql_v4.query_date_range_ore column. +func (v *DateRangeOreQuery) Scan(src any) error { + return scan((*[]byte)(v), src, "DateRangeOreQuery") +} + +// MarshalJSON is the EQL value as the JSON it is, or null when empty. +func (v DateRangeOreQuery) MarshalJSON() ([]byte, error) { + return marshal(v, "DateRangeOreQuery") +} + +// UnmarshalJSON reads the EQL value from JSON, as it is. +func (v *DateRangeOreQuery) UnmarshalJSON(b []byte) error { + return unmarshal((*[]byte)(v), b) +} + +// DateRangeOpeQuery is a range query value over the ope index of the date family: both bounds of one BETWEEN, +// included, as the one operand eql_v4.query_date_range_ope takes in eql_v4.between. It ranges over DateOrd, DateOrdOpe. +type DateRangeOpeQuery []byte + +// Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. +func (v DateRangeOpeQuery) Value() (driver.Value, error) { + return value(v) +} + +// Scan reads a eql_v4.query_date_range_ope column. +func (v *DateRangeOpeQuery) Scan(src any) error { + return scan((*[]byte)(v), src, "DateRangeOpeQuery") +} + +// MarshalJSON is the EQL value as the JSON it is, or null when empty. +func (v DateRangeOpeQuery) MarshalJSON() ([]byte, error) { + return marshal(v, "DateRangeOpeQuery") +} + +// UnmarshalJSON reads the EQL value from JSON, as it is. +func (v *DateRangeOpeQuery) UnmarshalJSON(b []byte) error { + return unmarshal((*[]byte)(v), b) +} + +// TimestampRangeOreQuery is a range query value over the ore index of the timestamp family: both bounds of one BETWEEN, +// included, as the one operand eql_v4.query_timestamp_range_ore takes in eql_v4.between. It ranges over TimestampOrdOre. +type TimestampRangeOreQuery []byte + +// Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. +func (v TimestampRangeOreQuery) Value() (driver.Value, error) { + return value(v) +} + +// Scan reads a eql_v4.query_timestamp_range_ore column. +func (v *TimestampRangeOreQuery) Scan(src any) error { + return scan((*[]byte)(v), src, "TimestampRangeOreQuery") +} + +// MarshalJSON is the EQL value as the JSON it is, or null when empty. +func (v TimestampRangeOreQuery) MarshalJSON() ([]byte, error) { + return marshal(v, "TimestampRangeOreQuery") +} + +// UnmarshalJSON reads the EQL value from JSON, as it is. +func (v *TimestampRangeOreQuery) UnmarshalJSON(b []byte) error { + return unmarshal((*[]byte)(v), b) +} + +// TimestampRangeOpeQuery is a range query value over the ope index of the timestamp family: both bounds of one BETWEEN, +// included, as the one operand eql_v4.query_timestamp_range_ope takes in eql_v4.between. It ranges over TimestampOrd, TimestampOrdOpe. +type TimestampRangeOpeQuery []byte + +// Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. +func (v TimestampRangeOpeQuery) Value() (driver.Value, error) { + return value(v) +} + +// Scan reads a eql_v4.query_timestamp_range_ope column. +func (v *TimestampRangeOpeQuery) Scan(src any) error { + return scan((*[]byte)(v), src, "TimestampRangeOpeQuery") +} + +// MarshalJSON is the EQL value as the JSON it is, or null when empty. +func (v TimestampRangeOpeQuery) MarshalJSON() ([]byte, error) { + return marshal(v, "TimestampRangeOpeQuery") +} + +// UnmarshalJSON reads the EQL value from JSON, as it is. +func (v *TimestampRangeOpeQuery) UnmarshalJSON(b []byte) error { + return unmarshal((*[]byte)(v), b) +} + +// NumericRangeOreQuery is a range query value over the ore index of the numeric family: both bounds of one BETWEEN, +// included, as the one operand eql_v4.query_numeric_range_ore takes in eql_v4.between. It ranges over NumericOrdOre. +type NumericRangeOreQuery []byte + +// Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. +func (v NumericRangeOreQuery) Value() (driver.Value, error) { + return value(v) +} + +// Scan reads a eql_v4.query_numeric_range_ore column. +func (v *NumericRangeOreQuery) Scan(src any) error { + return scan((*[]byte)(v), src, "NumericRangeOreQuery") +} + +// MarshalJSON is the EQL value as the JSON it is, or null when empty. +func (v NumericRangeOreQuery) MarshalJSON() ([]byte, error) { + return marshal(v, "NumericRangeOreQuery") +} + +// UnmarshalJSON reads the EQL value from JSON, as it is. +func (v *NumericRangeOreQuery) UnmarshalJSON(b []byte) error { + return unmarshal((*[]byte)(v), b) +} + +// NumericRangeOpeQuery is a range query value over the ope index of the numeric family: both bounds of one BETWEEN, +// included, as the one operand eql_v4.query_numeric_range_ope takes in eql_v4.between. It ranges over NumericOrd, NumericOrdOpe. +type NumericRangeOpeQuery []byte + +// Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. +func (v NumericRangeOpeQuery) Value() (driver.Value, error) { + return value(v) +} + +// Scan reads a eql_v4.query_numeric_range_ope column. +func (v *NumericRangeOpeQuery) Scan(src any) error { + return scan((*[]byte)(v), src, "NumericRangeOpeQuery") +} + +// MarshalJSON is the EQL value as the JSON it is, or null when empty. +func (v NumericRangeOpeQuery) MarshalJSON() ([]byte, error) { + return marshal(v, "NumericRangeOpeQuery") +} + +// UnmarshalJSON reads the EQL value from JSON, as it is. +func (v *NumericRangeOpeQuery) UnmarshalJSON(b []byte) error { + return unmarshal((*[]byte)(v), b) +} + +// TextRangeOreQuery is a range query value over the ore index of the text family: both bounds of one BETWEEN, +// included, as the one operand eql_v4.query_text_range_ore takes in eql_v4.between. It ranges over TextOrdOre, TextSearchOre. +type TextRangeOreQuery []byte + +// Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. +func (v TextRangeOreQuery) Value() (driver.Value, error) { + return value(v) +} + +// Scan reads a eql_v4.query_text_range_ore column. +func (v *TextRangeOreQuery) Scan(src any) error { + return scan((*[]byte)(v), src, "TextRangeOreQuery") +} + +// MarshalJSON is the EQL value as the JSON it is, or null when empty. +func (v TextRangeOreQuery) MarshalJSON() ([]byte, error) { + return marshal(v, "TextRangeOreQuery") +} + +// UnmarshalJSON reads the EQL value from JSON, as it is. +func (v *TextRangeOreQuery) UnmarshalJSON(b []byte) error { + return unmarshal((*[]byte)(v), b) +} + +// TextRangeOpeQuery is a range query value over the ope index of the text family: both bounds of one BETWEEN, +// included, as the one operand eql_v4.query_text_range_ope takes in eql_v4.between. It ranges over TextOrd, TextOrdOpe, TextSearch. +type TextRangeOpeQuery []byte + +// Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. +func (v TextRangeOpeQuery) Value() (driver.Value, error) { + return value(v) +} + +// Scan reads a eql_v4.query_text_range_ope column. +func (v *TextRangeOpeQuery) Scan(src any) error { + return scan((*[]byte)(v), src, "TextRangeOpeQuery") +} + +// MarshalJSON is the EQL value as the JSON it is, or null when empty. +func (v TextRangeOpeQuery) MarshalJSON() ([]byte, error) { + return marshal(v, "TextRangeOpeQuery") +} + +// UnmarshalJSON reads the EQL value from JSON, as it is. +func (v *TextRangeOpeQuery) UnmarshalJSON(b []byte) error { + return unmarshal((*[]byte)(v), b) +} + +// RealRangeOreQuery is a range query value over the ore index of the real family: both bounds of one BETWEEN, +// included, as the one operand eql_v4.query_real_range_ore takes in eql_v4.between. It ranges over RealOrdOre. +type RealRangeOreQuery []byte + +// Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. +func (v RealRangeOreQuery) Value() (driver.Value, error) { + return value(v) +} + +// Scan reads a eql_v4.query_real_range_ore column. +func (v *RealRangeOreQuery) Scan(src any) error { + return scan((*[]byte)(v), src, "RealRangeOreQuery") +} + +// MarshalJSON is the EQL value as the JSON it is, or null when empty. +func (v RealRangeOreQuery) MarshalJSON() ([]byte, error) { + return marshal(v, "RealRangeOreQuery") +} + +// UnmarshalJSON reads the EQL value from JSON, as it is. +func (v *RealRangeOreQuery) UnmarshalJSON(b []byte) error { + return unmarshal((*[]byte)(v), b) +} + +// RealRangeOpeQuery is a range query value over the ope index of the real family: both bounds of one BETWEEN, +// included, as the one operand eql_v4.query_real_range_ope takes in eql_v4.between. It ranges over RealOrd, RealOrdOpe. +type RealRangeOpeQuery []byte + +// Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. +func (v RealRangeOpeQuery) Value() (driver.Value, error) { + return value(v) +} + +// Scan reads a eql_v4.query_real_range_ope column. +func (v *RealRangeOpeQuery) Scan(src any) error { + return scan((*[]byte)(v), src, "RealRangeOpeQuery") +} + +// MarshalJSON is the EQL value as the JSON it is, or null when empty. +func (v RealRangeOpeQuery) MarshalJSON() ([]byte, error) { + return marshal(v, "RealRangeOpeQuery") +} + +// UnmarshalJSON reads the EQL value from JSON, as it is. +func (v *RealRangeOpeQuery) UnmarshalJSON(b []byte) error { + return unmarshal((*[]byte)(v), b) +} + +// DoubleRangeOreQuery is a range query value over the ore index of the double family: both bounds of one BETWEEN, +// included, as the one operand eql_v4.query_double_range_ore takes in eql_v4.between. It ranges over DoubleOrdOre. +type DoubleRangeOreQuery []byte + +// Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. +func (v DoubleRangeOreQuery) Value() (driver.Value, error) { + return value(v) +} + +// Scan reads a eql_v4.query_double_range_ore column. +func (v *DoubleRangeOreQuery) Scan(src any) error { + return scan((*[]byte)(v), src, "DoubleRangeOreQuery") +} + +// MarshalJSON is the EQL value as the JSON it is, or null when empty. +func (v DoubleRangeOreQuery) MarshalJSON() ([]byte, error) { + return marshal(v, "DoubleRangeOreQuery") +} + +// UnmarshalJSON reads the EQL value from JSON, as it is. +func (v *DoubleRangeOreQuery) UnmarshalJSON(b []byte) error { + return unmarshal((*[]byte)(v), b) +} + +// DoubleRangeOpeQuery is a range query value over the ope index of the double family: both bounds of one BETWEEN, +// included, as the one operand eql_v4.query_double_range_ope takes in eql_v4.between. It ranges over DoubleOrd, DoubleOrdOpe. +type DoubleRangeOpeQuery []byte + +// Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. +func (v DoubleRangeOpeQuery) Value() (driver.Value, error) { + return value(v) +} + +// Scan reads a eql_v4.query_double_range_ope column. +func (v *DoubleRangeOpeQuery) Scan(src any) error { + return scan((*[]byte)(v), src, "DoubleRangeOpeQuery") +} + +// MarshalJSON is the EQL value as the JSON it is, or null when empty. +func (v DoubleRangeOpeQuery) MarshalJSON() ([]byte, error) { + return marshal(v, "DoubleRangeOpeQuery") +} + +// UnmarshalJSON reads the EQL value from JSON, as it is. +func (v *DoubleRangeOpeQuery) UnmarshalJSON(b []byte) error { + return unmarshal((*[]byte)(v), b) +} diff --git a/languages/golang/encrypt/eql/eql_test.go b/languages/golang/encrypt/eql/eql_test.go index d951dc36f..3758e261f 100644 --- a/languages/golang/encrypt/eql/eql_test.go +++ b/languages/golang/encrypt/eql/eql_test.go @@ -7,7 +7,7 @@ import ( "github.com/cipherstash/stack/languages/golang/encrypt/eql" ) -func TestTypesTableNamesTextEqAsTheOneProducibleType(t *testing.T) { +func TestTypesTableNamesTheProducibleTypes(t *testing.T) { var producible []string for _, typ := range eql.Types { if typ.Producible { @@ -19,11 +19,31 @@ func TestTypesTableNamesTextEqAsTheOneProducibleType(t *testing.T) { t.Errorf("%s: an unproducible type has a reason", typ.Name) } } - if len(producible) != 1 || producible[0] != "TextEq" { - t.Fatalf("producible = %v, want [TextEq]", producible) + want := []string{ + "Integer", "IntegerEq", "IntegerOrd", "IntegerOrdOpe", + "Smallint", "SmallintEq", "SmallintOrd", "SmallintOrdOpe", + "Bigint", "BigintEq", "BigintOrd", "BigintOrdOpe", + "Date", "DateEq", "Timestamp", "TimestampEq", "Numeric", "NumericEq", + "Text", "TextEq", "TextMatch", "TextOrd", "TextOrdOpe", + "Boolean", + "Real", "RealEq", "RealOrd", "RealOrdOpe", + "Double", "DoubleEq", "DoubleOrd", "DoubleOrdOpe", + } + if len(producible) != len(want) { + t.Fatalf("producible = %v, want %v", producible, want) + } + for i := range want { + if producible[i] != want[i] { + t.Fatalf("producible = %v, want %v", producible, want) + } + } + for name, plaintext := range map[string]string{"Integer": "int32", "IntegerEq": "int32", "IntegerOrd": "int32", "Smallint": "int16", "SmallintEq": "int16", "SmallintOrdOpe": "int16", "Bigint": "int64", "BigintEq": "int64", "BigintOrdOpe": "int64", "Boolean": "bool", "Real": "float32", "RealEq": "float32", "RealOrd": "float32", "Double": "float64", "DoubleEq": "float64", "DoubleOrdOpe": "float64", "TextOrd": "string", "Date": "date", "DateEq": "date", "Timestamp": "timestamp", "TimestampEq": "timestamp", "Numeric": "decimal", "NumericEq": "decimal"} { + if typ, ok := eql.Lookup(name); !ok || typ.Plaintext != plaintext { + t.Errorf("%s: Plaintext = %q, want %q", name, typ.Plaintext, plaintext) + } } textEq, ok := eql.Lookup("TextEq") - if !ok || textEq.GoName != "TextEq" || textEq.Plaintext != "string" || textEq.Query != "TextEqQuery" || textEq.SQLDomain != "public.eql_v3_text_eq" || len(textEq.Indexes) != 1 || textEq.Indexes[0] != "eq" { + if !ok || textEq.GoName != "TextEq" || textEq.Plaintext != "string" || textEq.Query != "TextEqQuery" || textEq.SQLDomain != "public.eql_v4_text_eq" || len(textEq.Indexes) != 1 || textEq.Indexes[0] != "eq" { t.Fatalf("TextEq = %+v", textEq) } if j, ok := eql.Lookup("Json"); !ok || j.GoName != "JSON" { @@ -35,7 +55,7 @@ func TestTypesTableNamesTextEqAsTheOneProducibleType(t *testing.T) { } func TestValuesRoundTripThroughTheDriverAndJSON(t *testing.T) { - doc := []byte(`{"v":3,"i":{"t":"users","c":"email"},"c":"stack-encrypt:1:AA==","hm":"00"}`) + doc := []byte(`{"v":4,"i":{"t":"users","c":"email"},"c":"stack-encrypt:1:AA==","hm":"00"}`) v := eql.TextEq(doc) value, err := v.Value() if err != nil || value != string(doc) { diff --git a/languages/golang/encrypt/eql_test.go b/languages/golang/encrypt/eql_test.go index 833724c85..a1cd3fb19 100644 --- a/languages/golang/encrypt/eql_test.go +++ b/languages/golang/encrypt/eql_test.go @@ -41,8 +41,8 @@ var contacts = []testusers.Contact{ {ID: 3, Email: "bob@example.com"}, } -// eqlEnvelope is the EQL v3 envelope of a TextEq value, as PostgreSQL's -// public.eql_v3_text_eq domain checks it. +// eqlEnvelope is the EQL v4 envelope of a TextEq value, as PostgreSQL's +// public.eql_v4_text_eq domain checks it. type eqlEnvelope struct { V int `json:"v"` I struct{ T, C string } @@ -91,8 +91,8 @@ func TestTextEqFieldSealsToTheEQLEnvelope(t *testing.T) { t.Errorf("row %d: passthrough id %d, want %d", i, e.ID, contacts[i].ID) } env := decodeEnvelope(t, e.Email) - if env.V != 3 { - t.Errorf("row %d: v = %d, want 3", i, env.V) + if env.V != 4 { + t.Errorf("row %d: v = %d, want 4", i, env.V) } if env.I.T != "users" || env.I.C != "email" { t.Errorf("row %d: i = %+v, want users/email", i, env.I) @@ -162,7 +162,7 @@ func TestTextEqQueryMatchesTheStoredValueAndTheRustFixture(t *testing.T) { t.Fatalf("the fixture's column changed: %+v", fixture) } - query, err := testusers.ContactFields.Email.Query(ctx, cipher, fixture.Plaintext) + query, err := testusers.ContactFields.Email.Eq(ctx, cipher, fixture.Plaintext) if err != nil { t.Fatal(err) } @@ -184,7 +184,7 @@ func TestTextEqQueryMatchesTheStoredValueAndTheRustFixture(t *testing.T) { if env := decodeEnvelope(t, stored); env.HM != probe.HM { t.Fatalf("the query's hm %s does not match the stored %s", probe.HM, env.HM) } - if other, _ := testusers.ContactFields.Email.Query(ctx, cipher, "Bob@example.com"); string(other) == fixture.Query { + if other, _ := testusers.ContactFields.Email.Eq(ctx, cipher, "Bob@example.com"); string(other) == fixture.Query { t.Fatal("no case folding: a different plaintext has a different term") } } @@ -217,7 +217,7 @@ func TestATamperedEQLValueDoesNotOpen(t *testing.T) { for name, value := range map[string]eql.TextEq{ "an empty object": eql.TextEq(`{}`), "not JSON": eql.TextEq(`not json`), - "a query value": eql.TextEq(`{"v":3,"i":{"t":"users","c":"email"},"hm":"00"}`), + "a query value": eql.TextEq(`{"v":4,"i":{"t":"users","c":"email"},"hm":"00"}`), } { junk[0].Email = value if _, err := testusers.DecryptContact(ctx, cipher, junk); !errors.Is(err, encrypt.ErrEncoding) { diff --git a/languages/golang/encrypt/eql_v4_ledger_test.go b/languages/golang/encrypt/eql_v4_ledger_test.go new file mode 100644 index 000000000..8e63c31a2 --- /dev/null +++ b/languages/golang/encrypt/eql_v4_ledger_test.go @@ -0,0 +1,358 @@ +package encrypt_test + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "os" + "testing" + "time" + + "github.com/cipherstash/stack/languages/golang/encrypt" + "github.com/cipherstash/stack/languages/golang/encrypt/internal/testusers" +) + +func mustDecimal(t *testing.T, s string) encrypt.Decimal { + t.Helper() + d, err := encrypt.ParseDecimal(s) + if err != nil { + t.Fatal(err) + } + return d +} + +func mustInstant(t *testing.T, s string) time.Time { + t.Helper() + v, err := time.Parse(time.RFC3339Nano, s) + if err != nil { + t.Fatal(err) + } + return v +} + +func storedLedger(e testusers.EncryptedLedger) map[string][]byte { + return map[string][]byte{"opened": e.Opened, "due": e.Due, "created": e.Created, "posted": e.Posted, "total": e.Total, "amount": e.Amount} +} + +// sameLedger compares two ledgers as values: instants with Equal, since an +// opened time.Time is in UTC and the original may not be. +func sameLedger(a, b testusers.Ledger) bool { + return a.ID == b.ID && a.Opened == b.Opened && a.Due == b.Due && + a.Created.Equal(b.Created) && a.Posted.Equal(b.Posted) && + a.Total == b.Total && a.Amount == b.Amount +} + +// The date, timestamp and numeric EQL v4 types, sealed through generated +// code over the deterministic guest build with the EQL types: an +// encrypt.Date, a time.Time and an encrypt.Decimal reach each family's +// storage and equality types, open back, and their Eq queries are the ones +// eql-bindings' own dispatch derives (v4_ledger_queries.json). +func TestV4DateTimestampNumericFieldsSealAndOpenBack(t *testing.T) { + c := deterministicEQLClient(t) + ctx := context.Background() + cipher := c.DefaultKeyset() + + east := time.FixedZone("UTC+10", 10*60*60) + ledgers := []testusers.Ledger{ + { + ID: 1, Opened: encrypt.Date{Year: 2024, Month: time.February, Day: 29}, Due: encrypt.Date{Year: 1, Month: time.January, Day: 1}, + Created: mustInstant(t, "1969-12-31T23:59:59.999999999Z"), Posted: time.Date(2024, time.March, 1, 9, 0, 0, 1, east), + Total: mustDecimal(t, "-79228162514264337593543950335"), Amount: mustDecimal(t, "1.50"), + }, + { + ID: 2, Opened: encrypt.Date{Year: -262143, Month: time.January, Day: 1}, Due: encrypt.Date{Year: 262142, Month: time.December, Day: 31}, + Created: mustInstant(t, "2024-02-29T12:34:56.123456789Z"), Posted: time.Unix(0, 0), + Total: mustDecimal(t, "0.0000000000000000000000000001"), Amount: mustDecimal(t, "-0.00"), + }, + } + encrypted, err := testusers.EncryptLedger(ctx, cipher, ledgers) + if err != nil { + t.Fatal(err) + } + for i, e := range encrypted { + for column, value := range storedLedger(e) { + want := "c,hm,i,v" + if column == "opened" || column == "created" || column == "total" { + want = "c,i,v" + } + if got := keysOf(t, column, value); got != want { + t.Errorf("row %d %s: keys %s, want %s", i, column, got, want) + } + } + } + decrypted, err := testusers.DecryptLedger(ctx, cipher, encrypted) + if err != nil { + t.Fatal(err) + } + for i := range ledgers { + if !sameLedger(decrypted[i], ledgers[i]) { + t.Errorf("row %d: %+v, want %+v", i, decrypted[i], ledgers[i]) + } + // An instant opens in UTC, with its nanoseconds. + if decrypted[i].Posted.Location() != time.UTC || decrypted[i].Posted.Nanosecond() != ledgers[i].Posted.Nanosecond() { + t.Errorf("row %d: posted opens as %v", i, decrypted[i].Posted) + } + } + // A decimal keeps its scale; a negative zero opens as zero. + if got := decrypted[0].Amount.String(); got != "1.50" { + t.Errorf("amount opens as %s, want 1.50", got) + } + if got := decrypted[1].Amount.String(); got != "0.00" { + t.Errorf("amount opens as %s, want 0.00", got) + } + + // Equality follows the baseline: a decimal's scale is normalised, and + // an instant keeps the microsecond. + amount := func(s string) []byte { + q, err := testusers.LedgerFields.Amount.Eq(ctx, cipher, mustDecimal(t, s)) + if err != nil { + t.Fatal(err) + } + return q + } + posted := func(v time.Time) []byte { + q, err := testusers.LedgerFields.Posted.Eq(ctx, cipher, v) + if err != nil { + t.Fatal(err) + } + return q + } + if !bytes.Equal(amount("1.5"), amount("1.50")) || bytes.Equal(amount("1.5"), amount("1.51")) { + t.Error("Amount.Eq does not normalise the scale") + } + early := posted(mustInstant(t, "2024-02-29T12:00:00.123456001Z")) + if !bytes.Equal(early, posted(mustInstant(t, "2024-02-29T12:00:00.123456999Z"))) || bytes.Equal(early, posted(mustInstant(t, "2024-02-29T12:00:00.123457Z"))) { + t.Error("Posted.Eq does not compare to the microsecond") + } + // The instant is compared, not the wall clock: the same instant in two + // locations is one term. + if !bytes.Equal(early, posted(time.Date(2024, time.February, 29, 22, 0, 0, 123456001, east))) { + t.Error("Posted.Eq differs for the same instant in another location") + } + + // What the engine cannot store is refused on every path, naming the + // field: a zero Date, a date past the range, an instant past it, and + // a decimal scale past 28. + refusals := map[string]error{} + _, refusals["EncryptLedger zero date"] = testusers.EncryptLedger(ctx, cipher, []testusers.Ledger{{ID: 3, Opened: ledgers[0].Opened, Created: ledgers[0].Created, Posted: ledgers[0].Posted}}) + _, refusals["Due.Encrypt zero"] = testusers.LedgerFields.Due.Encrypt(ctx, cipher, encrypt.Date{}) + _, refusals["Due.Eq past the range"] = testusers.LedgerFields.Due.Eq(ctx, cipher, encrypt.Date{Year: 262143, Month: time.January, Day: 1}) + _, refusals["Posted.Eq past the range"] = testusers.LedgerFields.Posted.Eq(ctx, cipher, time.Date(262143, time.January, 1, 0, 0, 0, 0, time.UTC)) + _, refusals["Amount.Eq scale 29"] = testusers.LedgerFields.Amount.Eq(ctx, cipher, encrypt.Decimal{Scale: 29}) + for path, err := range refusals { + if !errors.Is(err, encrypt.ErrEncoding) { + t.Errorf("%s: %v, want ErrEncoding", path, err) + } + } + + raw, err := os.ReadFile(fixturePath("v4_ledger_queries.json")) + if err != nil { + t.Fatal(err) + } + var fixture struct { + Due, Posted, Amount struct { + Plaintext string + Query string + } + } + if err := json.Unmarshal(raw, &fixture); err != nil { + t.Fatal(err) + } + queries := map[string]func(string) ([]byte, error){ + "due": func(s string) ([]byte, error) { + v, err := time.Parse(time.DateOnly, s) + if err != nil { + return nil, err + } + return testusers.LedgerFields.Due.Eq(ctx, cipher, encrypt.DateOf(v)) + }, + "posted": func(s string) ([]byte, error) { + return testusers.LedgerFields.Posted.Eq(ctx, cipher, mustInstant(t, s)) + }, + "amount": func(s string) ([]byte, error) { + return testusers.LedgerFields.Amount.Eq(ctx, cipher, mustDecimal(t, s)) + }, + } + wants := map[string]struct { + Plaintext string + Query string + }{"due": fixture.Due, "posted": fixture.Posted, "amount": fixture.Amount} + for column, derive := range queries { + want := wants[column] + got, err := derive(want.Plaintext) + if err != nil { + t.Fatal(err) + } + if want.Query == "" || string(got) != want.Query { + t.Errorf("%s.Eq = %s\nwant %s", column, got, want.Query) + } + } +} + +// ledgerRows are the rows v4_ledger_rows.json holds: the range's edges, a +// day, instant and number each of the fixture's queries finds, a value in +// the same microsecond and an amount at another scale, which the queries +// find too, and rows they do not. +func ledgerRows(t *testing.T) []testusers.Ledger { + return []testusers.Ledger{ + { + ID: 1, Opened: encrypt.Date{Year: -262143, Month: time.January, Day: 1}, Due: encrypt.Date{Year: 2024, Month: time.February, Day: 29}, + Created: mustInstant(t, "1969-12-31T23:59:59.999999999Z"), Posted: mustInstant(t, "2024-02-29T12:34:56.123456Z"), + Total: mustDecimal(t, "-79228162514264337593543950335"), Amount: mustDecimal(t, "1.50"), + }, + { + ID: 2, Opened: encrypt.Date{Year: 262142, Month: time.December, Day: 31}, Due: encrypt.Date{Year: 2024, Month: time.March, Day: 1}, + Created: mustInstant(t, "2024-02-29T12:34:56.123456789Z"), Posted: mustInstant(t, "2024-02-29T12:34:56.123456999Z"), + Total: mustDecimal(t, "0.0000000000000000000000000001"), Amount: mustDecimal(t, "1.5"), + }, + { + ID: 3, Opened: encrypt.Date{Year: 1970, Month: time.January, Day: 1}, Due: encrypt.Date{Year: 2024, Month: time.February, Day: 29}, + Created: mustInstant(t, "1970-01-01T00:00:00Z"), Posted: mustInstant(t, "2024-02-29T12:34:56.123457Z"), + Total: mustDecimal(t, "1234.5600"), Amount: mustDecimal(t, "1.51"), + }, + } +} + +type ledgerRowsFixture struct { + Comment string `json:"_comment"` + Seed string `json:"seed"` + Table string `json:"table"` + Rows []ledgerRow `json:"rows"` +} + +type ledgerRow struct { + ID int64 `json:"id"` + Plaintext ledgerPlain `json:"plaintext"` + Stored map[string]json.RawMessage `json:"stored"` +} + +// ledgerPlain is a row's plaintext as text: dates in ISO 8601, instants in +// RFC 3339 with nanoseconds, decimals as fixed-point text with their scale. +type ledgerPlain struct { + Opened string `json:"opened"` + Due string `json:"due"` + Created string `json:"created"` + Posted string `json:"posted"` + Total string `json:"total"` + Amount string `json:"amount"` +} + +// isoDate is a Date as ISO 8601, with the signed year chrono reads for +// years outside 0000 to 9999. +func isoDate(d encrypt.Date) string { + switch { + case d.Year < 0: + return fmt.Sprintf("-%04d-%02d-%02d", -d.Year, d.Month, d.Day) + case d.Year > 9999: + return fmt.Sprintf("+%04d-%02d-%02d", d.Year, d.Month, d.Day) + } + return fmt.Sprintf("%04d-%02d-%02d", d.Year, d.Month, d.Day) +} + +func plainLedger(l testusers.Ledger) ledgerPlain { + return ledgerPlain{ + Opened: isoDate(l.Opened), Due: isoDate(l.Due), + Created: l.Created.UTC().Format(time.RFC3339Nano), Posted: l.Posted.UTC().Format(time.RFC3339Nano), + Total: l.Total.String(), Amount: l.Amount.String(), + } +} + +// TestV4LedgerRowsMatchTheCommittedFixture checks the committed +// v4_ledger_rows.json against what the generated code seals today, as +// TestV4RowsMatchTheCommittedFixture does for v4_rows.json: everything but +// each `c` must match, and the committed `c` values must open. The Rust +// suite opens the same rows and stores them in PostgreSQL. EQL_UPDATE_FIXTURES +// rewrites the file when something other than the ciphertexts moved. +func TestV4LedgerRowsMatchTheCommittedFixture(t *testing.T) { + c := deterministicEQLClient(t) + ctx := context.Background() + rows := ledgerRows(t) + encrypted, err := testusers.EncryptLedger(ctx, c.DefaultKeyset(), rows) + if err != nil { + t.Fatal(err) + } + fixture := ledgerRowsFixture{ + Comment: "Ledger rows sealed by the Go SDK's generated code over the deterministic EQL guest with the seed below; the Rust suite opens and queries them. Regenerate with EQL_UPDATE_FIXTURES=1 go test ./encrypt -run TestV4LedgerRows, do not edit.", + Seed: string(testSeed[:]), + Table: "profiles", + } + for i, e := range encrypted { + row := ledgerRow{ID: rows[i].ID, Plaintext: plainLedger(rows[i]), Stored: map[string]json.RawMessage{}} + for column, value := range storedLedger(e) { + row.Stored[column] = json.RawMessage(value) + } + fixture.Rows = append(fixture.Rows, row) + } + rendered, err := json.MarshalIndent(fixture, "", " ") + if err != nil { + t.Fatal(err) + } + rendered = append(rendered, '\n') + path := fixturePath("v4_ledger_rows.json") + var committed ledgerRowsFixture + committedBytes, err := os.ReadFile(path) + if err == nil { + err = json.Unmarshal(committedBytes, &committed) + } + same := err == nil && bytes.Equal(ledgerWithoutCiphertexts(t, committed), ledgerWithoutCiphertexts(t, fixture)) + if os.Getenv("EQL_UPDATE_FIXTURES") != "" && !same { + if err := os.WriteFile(path, rendered, 0o644); err != nil { + t.Fatal(err) + } + t.Logf("%s: rewritten", path) + committed, same, err = fixture, true, nil + } + if err != nil { + t.Fatalf("%v: run with EQL_UPDATE_FIXTURES=1 to write it", err) + } + if !same { + t.Errorf("%s differs from what the generated code seals today beyond the ciphertexts; regenerate it with EQL_UPDATE_FIXTURES=1", path) + } + + sealed := make([]testusers.EncryptedLedger, len(committed.Rows)) + for i, row := range committed.Rows { + s := row.Stored + sealed[i] = testusers.EncryptedLedger{ + ID: row.ID, Opened: []byte(s["opened"]), Due: []byte(s["due"]), Created: []byte(s["created"]), + Posted: []byte(s["posted"]), Total: []byte(s["total"]), Amount: []byte(s["amount"]), + } + } + opened, err := testusers.DecryptLedger(ctx, c.DefaultKeyset(), sealed) + if err != nil { + t.Fatal(err) + } + for i, row := range committed.Rows { + if got := plainLedger(opened[i]); got != row.Plaintext { + t.Errorf("row %d opens to %+v, want %+v", row.ID, got, row.Plaintext) + } + } +} + +func ledgerWithoutCiphertexts(t *testing.T, f ledgerRowsFixture) []byte { + t.Helper() + out := f + out.Rows = nil + for _, row := range f.Rows { + stripped := ledgerRow{ID: row.ID, Plaintext: row.Plaintext, Stored: map[string]json.RawMessage{}} + for column, value := range row.Stored { + var fields map[string]json.RawMessage + if err := json.Unmarshal(value, &fields); err != nil { + t.Fatal(err) + } + delete(fields, "c") + b, err := json.Marshal(fields) + if err != nil { + t.Fatal(err) + } + stripped.Stored[column] = b + } + out.Rows = append(out.Rows, stripped) + } + b, err := json.Marshal(out) + if err != nil { + t.Fatal(err) + } + return b +} diff --git a/languages/golang/encrypt/eql_v4_order_test.go b/languages/golang/encrypt/eql_v4_order_test.go new file mode 100644 index 000000000..2a4619997 --- /dev/null +++ b/languages/golang/encrypt/eql_v4_order_test.go @@ -0,0 +1,386 @@ +package encrypt_test + +import ( + "bytes" + "context" + "encoding/json" + "math" + "os" + "sort" + "strings" + "testing" + + "github.com/cipherstash/stack/languages/golang/encrypt/internal/testusers" +) + +// The OPE-ordered EQL v4 types (IntegerOrd, BigintOrd, RealOrd, DoubleOrd, +// TextOrd and their OrdOpe twins), sealed through generated code over the +// deterministic guest build with the EQL types. PostgreSQL sees these +// values through the Rust suite: TestV4OrderedRowsMatchTheCommittedFixture +// commits them to v4_ordered_rows.json, and +// packages/eql/tests/encryption/tests/v4_order.rs inserts that file into +// eql_v4 columns and compares it. + +// rankings are ordered by every field's order key: each row's value is +// below the next row's in every column, except the pairs rankingTies +// records. +var rankings = []testusers.Ranking{ + {ID: 1, Level: -5, Floor: -5, Points: math.MinInt64, Total: -1 << 40, Speed: float32(math.Inf(-1)), Pace: -2.5, Score: -1.5, Mean: math.Inf(-1), Title: "alice", Handle: "al"}, + {ID: 2, Level: 0, Floor: 0, Points: 0, Total: 0, Speed: 0, Pace: 0, Score: 0, Mean: 0, Title: "Cafe", Handle: "bob"}, + {ID: 3, Level: 0, Floor: 0, Points: 0, Total: 0, Speed: float32(math.Copysign(0, -1)), Pace: float32(math.Copysign(0, -1)), Score: math.Copysign(0, -1), Mean: math.Copysign(0, -1), Title: "café", Handle: "BOB"}, + {ID: 4, Level: 7, Floor: 70000, Points: 5_000_000_001, Total: 1 << 40, Speed: 2.5, Pace: 1.5, Score: 9.75, Mean: 1e300, Title: "Mango", Handle: "carol"}, + {ID: 5, Level: math.MaxInt32, Floor: math.MaxInt32, Points: math.MaxInt64, Total: math.MaxInt64, Speed: float32(math.Inf(1)), Pace: float32(math.Inf(1)), Score: math.Inf(1), Mean: math.Inf(1), Title: "Zoe", Handle: "zed"}, +} + +// rankingTies are the adjacent pairs of rankings, by ID, that tie in every +// order key: equal integers, -0.0 against 0.0, and text that differs only +// in case and accents. They are written down rather than derived because +// the text ties need Unicode case folding, which the engine does and this +// module has no dependency for. +var rankingTies = map[[2]int64]bool{{2, 3}: true} + +// storedRanking is each sealed field of an encrypted ranking by column. +func storedRanking(e testusers.EncryptedRanking) map[string][]byte { + return map[string][]byte{ + "level": e.Level, + "floor": e.Floor, + "points": e.Points, + "total": e.Total, + "speed": e.Speed, + "pace": e.Pace, + "score": e.Score, + "mean": e.Mean, + "title": e.Title, + "handle": e.Handle, + } +} + +// orderTerm is a stored value's or query's `op`, as its hex. Lower-case +// hex sorts as the bytes it encodes, which is how EQL compares `op`. +func orderTerm(t *testing.T, value []byte) string { + t.Helper() + var v struct { + OP string `json:"op"` + } + if err := json.Unmarshal(value, &v); err != nil || v.OP == "" { + t.Fatalf("no op in %s: %v", value, err) + } + return v.OP +} + +func TestV4OrderedFieldsSealToTheirEQLTypesAndOpenBack(t *testing.T) { + c := deterministicEQLClient(t) + ctx := context.Background() + cipher := c.DefaultKeyset() + + encrypted, err := testusers.EncryptRanking(ctx, cipher, rankings) + if err != nil { + t.Fatal(err) + } + for i, e := range encrypted { + for column, value := range storedRanking(e) { + want := "c,i,op,v" + if column == "title" || column == "handle" { + want = "c,hm,i,op,v" + } + if got := rankingKeys(t, column, value); got != want { + t.Errorf("row %d %s: keys %s, want %s", i, column, got, want) + } + } + } + + // The stored order terms sort as the rows do: each row below the next, + // except the pairs rankingTies records. A recorded tie that is not an + // adjacent pair of rankings would be checked as nothing, so each one + // must be found, its numbers must be equal in Go too, and there must be + // at least one. + if len(rankingTies) == 0 { + t.Fatal("rankingTies records no tie: the equal-order-key case is untested") + } + found := map[[2]int64]bool{} + for i := 0; i+1 < len(rankings); i++ { + a, b := rankings[i], rankings[i+1] + pair := [2]int64{a.ID, b.ID} + if !rankingTies[pair] { + continue + } + found[pair] = true + if a.Level != b.Level || a.Floor != b.Floor || a.Points != b.Points || a.Total != b.Total || + a.Speed != b.Speed || a.Pace != b.Pace || a.Score != b.Score || a.Mean != b.Mean { + t.Errorf("rows %d and %d are recorded as a tie but their numbers differ", a.ID, b.ID) + } + } + for pair := range rankingTies { + if !found[pair] { + t.Errorf("rankingTies records rows %d and %d, which are not adjacent in rankings", pair[0], pair[1]) + } + } + for column := range storedRanking(encrypted[0]) { + for i := 0; i+1 < len(encrypted); i++ { + a := orderTerm(t, storedRanking(encrypted[i])[column]) + b := orderTerm(t, storedRanking(encrypted[i+1])[column]) + tie := rankingTies[[2]int64{rankings[i].ID, rankings[i+1].ID}] + switch { + case tie && a != b: + t.Errorf("%s: rows %d and %d tie in the order key but store different terms", column, rankings[i].ID, rankings[i+1].ID) + case !tie && a >= b: + t.Errorf("%s: row %d's term does not sort below row %d's", column, rankings[i].ID, rankings[i+1].ID) + } + } + } + + decrypted, err := testusers.DecryptRanking(ctx, cipher, encrypted) + if err != nil { + t.Fatal(err) + } + for i := range rankings { + got, want := decrypted[i], rankings[i] + // The ciphertext keeps -0.0's sign; == would not tell. + if math.Signbit(float64(got.Speed)) != math.Signbit(float64(want.Speed)) || math.Signbit(got.Mean) != math.Signbit(want.Mean) { + t.Errorf("row %d: a zero lost its sign", want.ID) + } + if got != want { + t.Errorf("row %d: %+v, want %+v", i, got, want) + } + } +} + +// rankingKeys is the sorted top-level keys of an EQL value stored under +// rankings, checking its envelope as keysOf does for profiles. +func rankingKeys(t *testing.T, column string, value []byte) string { + t.Helper() + var raw map[string]json.RawMessage + if err := json.Unmarshal(value, &raw); err != nil { + t.Fatalf("the EQL value is not JSON: %v: %s", err, value) + } + var i struct{ T, C string } + if err := json.Unmarshal(raw["i"], &i); err != nil || i.T != "rankings" || i.C != column { + t.Errorf("i = %s, want {\"t\":\"rankings\",\"c\":%q}", raw["i"], column) + } + if string(raw["v"]) != "4" { + t.Errorf("v = %s, want 4", raw["v"]) + } + keys := make([]string, 0, len(raw)) + for k := range raw { + keys = append(keys, k) + } + sort.Strings(keys) + return strings.Join(keys, ",") +} + +func TestV4OrderedQueriesMatchTheRustFixture(t *testing.T) { + c := deterministicEQLClient(t) + ctx := context.Background() + cipher := c.DefaultKeyset() + + raw, err := os.ReadFile(fixturePath("v4_ordered_queries.json")) + if err != nil { + t.Fatal(err) + } + type entry[T any] struct { + Plaintext T + Query string + } + var fixture struct { + Table string + Level entry[int32] + Floor entry[int32] + Points entry[int64] + Total entry[int64] + Speed entry[float32] + Pace entry[float32] + Score entry[float64] + Mean entry[float64] + Title entry[string] + Handle entry[string] + } + if err := json.Unmarshal(raw, &fixture); err != nil { + t.Fatal(err) + } + if fixture.Table != "rankings" { + t.Fatalf("the fixture's table changed: %q", fixture.Table) + } + f := testusers.RankingFields + // Byte for byte what eql-bindings' own dispatch derived under the same + // index key. Every ordering method of a field returns one operand: the + // operator is SQL's. + cases := []struct { + field string + lt func() ([]byte, error) + gte func() ([]byte, error) + want string + }{ + {"Level", func() ([]byte, error) { return f.Level.Lt(ctx, cipher, fixture.Level.Plaintext) }, func() ([]byte, error) { return f.Level.Gte(ctx, cipher, fixture.Level.Plaintext) }, fixture.Level.Query}, + {"Floor", func() ([]byte, error) { return f.Floor.Lt(ctx, cipher, fixture.Floor.Plaintext) }, func() ([]byte, error) { return f.Floor.Gte(ctx, cipher, fixture.Floor.Plaintext) }, fixture.Floor.Query}, + {"Points", func() ([]byte, error) { return f.Points.Lt(ctx, cipher, fixture.Points.Plaintext) }, func() ([]byte, error) { return f.Points.Gte(ctx, cipher, fixture.Points.Plaintext) }, fixture.Points.Query}, + {"Total", func() ([]byte, error) { return f.Total.Lt(ctx, cipher, fixture.Total.Plaintext) }, func() ([]byte, error) { return f.Total.Gte(ctx, cipher, fixture.Total.Plaintext) }, fixture.Total.Query}, + {"Speed", func() ([]byte, error) { return f.Speed.Lt(ctx, cipher, fixture.Speed.Plaintext) }, func() ([]byte, error) { return f.Speed.Gte(ctx, cipher, fixture.Speed.Plaintext) }, fixture.Speed.Query}, + {"Pace", func() ([]byte, error) { return f.Pace.Lt(ctx, cipher, fixture.Pace.Plaintext) }, func() ([]byte, error) { return f.Pace.Gte(ctx, cipher, fixture.Pace.Plaintext) }, fixture.Pace.Query}, + {"Score", func() ([]byte, error) { return f.Score.Lt(ctx, cipher, fixture.Score.Plaintext) }, func() ([]byte, error) { return f.Score.Gte(ctx, cipher, fixture.Score.Plaintext) }, fixture.Score.Query}, + {"Mean", func() ([]byte, error) { return f.Mean.Lt(ctx, cipher, fixture.Mean.Plaintext) }, func() ([]byte, error) { return f.Mean.Gte(ctx, cipher, fixture.Mean.Plaintext) }, fixture.Mean.Query}, + {"Title", func() ([]byte, error) { return f.Title.Lt(ctx, cipher, fixture.Title.Plaintext) }, func() ([]byte, error) { return f.Title.Eq(ctx, cipher, fixture.Title.Plaintext) }, fixture.Title.Query}, + {"Handle", func() ([]byte, error) { return f.Handle.Lt(ctx, cipher, fixture.Handle.Plaintext) }, func() ([]byte, error) { return f.Handle.Eq(ctx, cipher, fixture.Handle.Plaintext) }, fixture.Handle.Query}, + } + for _, tc := range cases { + for _, method := range []func() ([]byte, error){tc.lt, tc.gte} { + got, err := method() + if err != nil { + t.Fatal(err) + } + if tc.want == "" || string(got) != tc.want { + t.Errorf("%s = %s\nwant %s", tc.field, got, tc.want) + } + } + } + + // Text with a code point Unicode 16 does not assign has no fold, so no + // order term. + if q, err := f.Title.Lt(ctx, cipher, "a͸b"); err == nil { + t.Errorf("Title.Lt over unassigned text = %s, want a refusal", q) + } +} + +// orderedRowsFixture is v4_ordered_rows.json: the rankings above as the +// generated code seals them under the deterministic guest and testSeed. +type orderedRowsFixture struct { + Comment string `json:"_comment"` + Seed string `json:"seed"` + Table string `json:"table"` + Rows []orderedRow `json:"rows"` +} + +type orderedRow struct { + ID int64 `json:"id"` + Plaintext orderedPlain `json:"plaintext"` + Stored map[string]json.RawMessage `json:"stored"` +} + +// orderedPlain is a ranking's plaintext as the fixture records it. JSON has +// no infinity, so the fixture's rows hold finite values only; the infinite +// and -0.0 cases are covered by TestV4OrderedFieldsSealToTheirEQLTypesAndOpenBack +// and the Rust suite. +type orderedPlain struct { + Level int32 `json:"level"` + Floor int32 `json:"floor"` + Points int64 `json:"points"` + Total int64 `json:"total"` + Speed float32 `json:"speed"` + Pace float32 `json:"pace"` + Score float64 `json:"score"` + Mean float64 `json:"mean"` + Title string `json:"title"` + Handle string `json:"handle"` +} + +func orderedPlainOf(r testusers.Ranking) orderedPlain { + return orderedPlain{r.Level, r.Floor, r.Points, r.Total, r.Speed, r.Pace, r.Score, r.Mean, r.Title, r.Handle} +} + +// fixtureRankings are the rows v4_ordered_rows.json holds: finite values +// on both sides of the fixture's query plaintexts in every column. +var fixtureRankings = []testusers.Ranking{ + {ID: 1, Level: -20, Floor: -30, Points: -5, Total: -9, Speed: -1.25, Pace: -3.5, Score: -2.5, Mean: -0.25, Title: "apple", Handle: "Alice"}, + {ID: 2, Level: 10, Floor: -3, Points: 5_000_000_000, Total: -1, Speed: 2.5, Pace: -0.5, Score: 9.75, Mean: 0, Title: "mango", Handle: "Carol"}, + {ID: 3, Level: 99, Floor: 4, Points: 6_000_000_000, Total: 12, Speed: 8, Pace: 0.75, Score: 100, Mean: 3.5, Title: "Zucchini", Handle: "dave"}, +} + +// TestV4OrderedRowsMatchTheCommittedFixture checks the committed +// v4_ordered_rows.json against what the generated code seals today, as +// TestV4RowsMatchTheCommittedFixture does for v4_rows.json: everything but +// each `c` must match, and the committed `c` values must open. +// EQL_UPDATE_FIXTURES rewrites the file when something other than the +// ciphertexts moved. +func TestV4OrderedRowsMatchTheCommittedFixture(t *testing.T) { + c := deterministicEQLClient(t) + ctx := context.Background() + encrypted, err := testusers.EncryptRanking(ctx, c.DefaultKeyset(), fixtureRankings) + if err != nil { + t.Fatal(err) + } + fixture := orderedRowsFixture{ + Comment: "Ranking rows sealed by the Go SDK's generated code over the deterministic EQL guest with the seed below; the Rust suite opens and compares them. Regenerate with EQL_UPDATE_FIXTURES=1 go test ./encrypt -run TestV4OrderedRows, do not edit.", + Seed: string(testSeed[:]), + Table: "rankings", + } + for i, e := range encrypted { + row := orderedRow{ID: fixtureRankings[i].ID, Plaintext: orderedPlainOf(fixtureRankings[i]), Stored: map[string]json.RawMessage{}} + for column, value := range storedRanking(e) { + row.Stored[column] = json.RawMessage(value) + } + fixture.Rows = append(fixture.Rows, row) + } + rendered, err := json.MarshalIndent(fixture, "", " ") + if err != nil { + t.Fatal(err) + } + rendered = append(rendered, '\n') + path := fixturePath("v4_ordered_rows.json") + var committed orderedRowsFixture + committedBytes, err := os.ReadFile(path) + if err == nil { + err = json.Unmarshal(committedBytes, &committed) + } + same := err == nil && bytes.Equal(orderedWithoutCiphertexts(t, committed), orderedWithoutCiphertexts(t, fixture)) + if os.Getenv("EQL_UPDATE_FIXTURES") != "" && !same { + if err := os.WriteFile(path, rendered, 0o644); err != nil { + t.Fatal(err) + } + t.Logf("%s: rewritten", path) + committed, same, err = fixture, true, nil + } + if err != nil { + t.Fatalf("%v: run with EQL_UPDATE_FIXTURES=1 to write it", err) + } + if !same { + t.Errorf("%s differs from what the generated code seals today beyond the ciphertexts; regenerate it with EQL_UPDATE_FIXTURES=1", path) + } + + // The committed ciphertexts still open, to the committed plaintexts. + sealed := make([]testusers.EncryptedRanking, len(committed.Rows)) + for i, row := range committed.Rows { + s := row.Stored + sealed[i] = testusers.EncryptedRanking{ + ID: row.ID, Level: []byte(s["level"]), Floor: []byte(s["floor"]), Points: []byte(s["points"]), Total: []byte(s["total"]), + Speed: []byte(s["speed"]), Pace: []byte(s["pace"]), Score: []byte(s["score"]), Mean: []byte(s["mean"]), + Title: []byte(s["title"]), Handle: []byte(s["handle"]), + } + } + opened, err := testusers.DecryptRanking(ctx, c.DefaultKeyset(), sealed) + if err != nil { + t.Fatal(err) + } + for i, row := range committed.Rows { + if got := orderedPlainOf(opened[i]); got != row.Plaintext { + t.Errorf("row %d opens to %+v, want %+v", row.ID, got, row.Plaintext) + } + } +} + +// orderedWithoutCiphertexts renders a fixture with every stored value's `c` +// removed: the part of the file that is the same on every run. +func orderedWithoutCiphertexts(t *testing.T, f orderedRowsFixture) []byte { + t.Helper() + out := f + out.Rows = nil + for _, row := range f.Rows { + stripped := orderedRow{ID: row.ID, Plaintext: row.Plaintext, Stored: map[string]json.RawMessage{}} + for column, value := range row.Stored { + var fields map[string]json.RawMessage + if err := json.Unmarshal(value, &fields); err != nil { + t.Fatal(err) + } + delete(fields, "c") + b, err := json.Marshal(fields) + if err != nil { + t.Fatal(err) + } + stripped.Stored[column] = b + } + out.Rows = append(out.Rows, stripped) + } + b, err := json.Marshal(out) + if err != nil { + t.Fatal(err) + } + return b +} diff --git a/languages/golang/encrypt/eql_v4_smallint_test.go b/languages/golang/encrypt/eql_v4_smallint_test.go new file mode 100644 index 000000000..59dff0686 --- /dev/null +++ b/languages/golang/encrypt/eql_v4_smallint_test.go @@ -0,0 +1,232 @@ +package encrypt_test + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "math" + "os" + "strings" + "testing" + + "github.com/cipherstash/stack/languages/golang/encrypt" + "github.com/cipherstash/stack/languages/golang/encrypt/internal/testusers" +) + +// The smallint EQL v4 types, sealed through generated code over the +// deterministic guest build with the EQL types: an int16 field reaches +// Smallint and SmallintEq, opens back, and its Eq query is the one +// eql-bindings' own dispatch derives (v4_queries.json, key tally). +func TestV4SmallintFieldsSealAndOpenBack(t *testing.T) { + c := deterministicEQLClient(t) + ctx := context.Background() + cipher := c.DefaultKeyset() + + tallies := []testusers.Tally{ + {ID: 1, Small: math.MinInt16, Count: -12, Wide: 7}, + {ID: 2, Small: math.MaxInt16, Count: 0, Wide: math.MinInt16}, + } + encrypted, err := testusers.EncryptTally(ctx, cipher, tallies) + if err != nil { + t.Fatal(err) + } + for i, e := range encrypted { + for column, value := range map[string][]byte{"small": e.Small, "tally": e.Count, "wide": e.Wide} { + want := "c,hm,i,v" + if column == "small" { + want = "c,i,v" + } + if got := keysOf(t, column, value); got != want { + t.Errorf("row %d %s: keys %s, want %s", i, column, got, want) + } + } + } + decrypted, err := testusers.DecryptTally(ctx, cipher, encrypted) + if err != nil { + t.Fatal(err) + } + for i := range tallies { + if decrypted[i] != tallies[i] { + t.Errorf("row %d: %+v, want %+v", i, decrypted[i], tallies[i]) + } + } + + // An int32 field in a smallint type seals at 16 bits: a value that does + // not fit is refused, not truncated, on every path, and the error names + // the field. Both bounds, as widened_test.go pins them for IntegerEq. + for _, v := range []int32{math.MaxInt16 + 1, math.MinInt16 - 1} { + refusals := map[string]error{} + _, refusals["EncryptTally"] = testusers.EncryptTally(ctx, cipher, []testusers.Tally{{ID: 3, Wide: v}}) + _, refusals["Wide.Encrypt"] = testusers.TallyFields.Wide.Encrypt(ctx, cipher, v) + _, refusals["Wide.Eq"] = testusers.TallyFields.Wide.Eq(ctx, cipher, v) + for path, err := range refusals { + if !errors.Is(err, encrypt.ErrEncoding) { + t.Errorf("%s(%d): %v, want ErrEncoding", path, v, err) + } else if !strings.Contains(err.Error(), "wide") { + t.Errorf("%s(%d): %v, want the field named", path, v, err) + } + } + } + // The bounds themselves fit. + for _, v := range []int32{math.MaxInt16, math.MinInt16} { + if _, err := testusers.TallyFields.Wide.Eq(ctx, cipher, v); err != nil { + t.Errorf("Wide.Eq(%d): %v", v, err) + } + } + + raw, err := os.ReadFile(fixturePath("v4_queries.json")) + if err != nil { + t.Fatal(err) + } + var fixture struct { + Tally struct { + Plaintext int16 + Query string + } + } + if err := json.Unmarshal(raw, &fixture); err != nil { + t.Fatal(err) + } + q, err := testusers.TallyFields.Count.Eq(ctx, cipher, fixture.Tally.Plaintext) + if err != nil { + t.Fatal(err) + } + if fixture.Tally.Query == "" || string(q) != fixture.Tally.Query { + t.Errorf("Count.Eq = %s\nwant %s", q, fixture.Tally.Query) + } +} + +// tallyRows are the rows v4_smallint_rows.json holds: both extremes of the +// width, and an int32 field at the extremes too. +var tallyRows = []testusers.Tally{ + {ID: 1, Small: math.MinInt16, Count: -12, Wide: math.MinInt16}, + {ID: 2, Small: math.MaxInt16, Count: 7, Wide: math.MaxInt16}, + {ID: 3, Small: 0, Count: -12, Wide: -1}, +} + +type smallintRowsFixture struct { + Comment string `json:"_comment"` + Seed string `json:"seed"` + Table string `json:"table"` + Rows []smallintRow `json:"rows"` +} + +type smallintRow struct { + ID int64 `json:"id"` + Plaintext smallintPlain `json:"plaintext"` + Stored map[string]json.RawMessage `json:"stored"` +} + +type smallintPlain struct { + Small int16 `json:"small"` + Tally int16 `json:"tally"` + Wide int32 `json:"wide"` +} + +func storedTally(e testusers.EncryptedTally) map[string][]byte { + return map[string][]byte{"small": e.Small, "tally": e.Count, "wide": e.Wide} +} + +// TestV4SmallintRowsMatchTheCommittedFixture checks the committed +// v4_smallint_rows.json against what the generated code seals today, as +// TestV4RowsMatchTheCommittedFixture does for v4_rows.json: everything but +// each `c` must match, and the committed `c` values must open. +// EQL_UPDATE_FIXTURES rewrites the file when something other than the +// ciphertexts moved, so a change that moves only `c` leaves the committed +// file as it was. EQL_V4_SMALLINT_ROWS_OUT names a file to write today's +// rows to, ciphertexts and all: CI hands it to the Rust suite +// (EQL_V4_SMALLINT_ROWS), so Rust opens the smallint ciphertexts the Go SDK +// seals now, not only the committed ones. +func TestV4SmallintRowsMatchTheCommittedFixture(t *testing.T) { + c := deterministicEQLClient(t) + ctx := context.Background() + encrypted, err := testusers.EncryptTally(ctx, c.DefaultKeyset(), tallyRows) + if err != nil { + t.Fatal(err) + } + fixture := smallintRowsFixture{ + Comment: "Tally rows sealed by the Go SDK's generated code over the deterministic EQL guest with the seed below; the Rust suite opens and queries them. Regenerate with EQL_UPDATE_FIXTURES=1 go test ./encrypt -run TestV4SmallintRows, do not edit.", + Seed: string(testSeed[:]), + Table: "profiles", + } + for i, e := range encrypted { + r := tallyRows[i] + row := smallintRow{ID: r.ID, Plaintext: smallintPlain{r.Small, r.Count, r.Wide}, Stored: map[string]json.RawMessage{}} + for column, value := range storedTally(e) { + row.Stored[column] = json.RawMessage(value) + } + fixture.Rows = append(fixture.Rows, row) + } + rendered, err := json.MarshalIndent(fixture, "", " ") + if err != nil { + t.Fatal(err) + } + rendered = append(rendered, '\n') + if out := os.Getenv("EQL_V4_SMALLINT_ROWS_OUT"); out != "" { + if err := os.WriteFile(out, rendered, 0o644); err != nil { + t.Fatal(err) + } + } + path := fixturePath("v4_smallint_rows.json") + var committed smallintRowsFixture + committedBytes, err := os.ReadFile(path) + if err == nil { + err = json.Unmarshal(committedBytes, &committed) + } + same := err == nil && bytes.Equal(smallintWithoutCiphertexts(t, committed), smallintWithoutCiphertexts(t, fixture)) + if os.Getenv("EQL_UPDATE_FIXTURES") != "" && !same { + if err := os.WriteFile(path, rendered, 0o644); err != nil { + t.Fatal(err) + } + t.Logf("%s: rewritten", path) + committed, same, err = fixture, true, nil + } + if err != nil { + t.Fatalf("%v: run with EQL_UPDATE_FIXTURES=1 to write it", err) + } + if !same { + t.Errorf("%s differs from what the generated code seals today beyond the ciphertexts; regenerate it with EQL_UPDATE_FIXTURES=1", path) + } + + sealed := make([]testusers.EncryptedTally, len(committed.Rows)) + for i, row := range committed.Rows { + sealed[i] = testusers.EncryptedTally{ID: row.ID, Small: []byte(row.Stored["small"]), Count: []byte(row.Stored["tally"]), Wide: []byte(row.Stored["wide"])} + } + opened, err := testusers.DecryptTally(ctx, c.DefaultKeyset(), sealed) + if err != nil { + t.Fatal(err) + } + for i, row := range committed.Rows { + if got := (smallintPlain{opened[i].Small, opened[i].Count, opened[i].Wide}); got != row.Plaintext { + t.Errorf("row %d opens to %+v, want %+v", row.ID, got, row.Plaintext) + } + } +} + +func smallintWithoutCiphertexts(t *testing.T, f smallintRowsFixture) []byte { + t.Helper() + out := f + out.Rows = nil + for _, row := range f.Rows { + stripped := smallintRow{ID: row.ID, Plaintext: row.Plaintext, Stored: map[string]json.RawMessage{}} + for column, value := range row.Stored { + var fields map[string]json.RawMessage + if err := json.Unmarshal(value, &fields); err != nil { + t.Fatal(err) + } + delete(fields, "c") + b, err := json.Marshal(fields) + if err != nil { + t.Fatal(err) + } + stripped.Stored[column] = b + } + out.Rows = append(out.Rows, stripped) + } + b, err := json.Marshal(out) + if err != nil { + t.Fatal(err) + } + return b +} diff --git a/languages/golang/encrypt/eql_v4_test.go b/languages/golang/encrypt/eql_v4_test.go new file mode 100644 index 000000000..c6c457a23 --- /dev/null +++ b/languages/golang/encrypt/eql_v4_test.go @@ -0,0 +1,546 @@ +package encrypt_test + +import ( + "bytes" + "context" + "encoding/json" + "os" + "path/filepath" + "slices" + "sort" + "strings" + "testing" + + "github.com/cipherstash/stack/languages/golang/encrypt" + "github.com/cipherstash/stack/languages/golang/encrypt/internal/testusers" +) + +// The EQL v4 types the engine produces besides TextEq, sealed through +// generated code over the deterministic guest build with the EQL types: +// each Go field type reaches its v4 type's own plan, and the values open +// back to what went in. PostgreSQL sees these values through the Rust +// suite: TestV4RowsMatchTheCommittedFixture commits them to +// v4_rows.json, and packages/eql/tests/encryption inserts that file into +// eql_v4 columns and queries it. + +var profiles = []testusers.Profile{ + {ID: 1, Visits: 3, Balance: 1234567890123, Active: true, Ratio: 0.5, Score: 2.25, Note: "a private note", Name: "alice", Age: 42, Rank: 7, Weight: 1.5, Price: 9.75, Email: "alice@example.com"}, + {ID: 2, Visits: 0, Balance: -1, Active: false, Ratio: -1.5, Score: 0, Note: "", Name: "bob smith", Age: 42, Rank: -7, Weight: -1.5, Price: 0, Email: "bob@example.com"}, +} + +func fixturePath(name string) string { + return filepath.Join("..", "..", "..", "packages", "eql", "tests", "encryption", "fixtures", name) +} + +// keysOf is the sorted top-level keys of an EQL value. It also checks the +// envelope: version 4, and the table and column the value was stored under. +func keysOf(t *testing.T, column string, value []byte) string { + t.Helper() + var raw map[string]json.RawMessage + if err := json.Unmarshal(value, &raw); err != nil { + t.Fatalf("the EQL value is not JSON: %v: %s", err, value) + } + if string(raw["v"]) != "4" { + t.Errorf("v = %s, want 4: %s", raw["v"], value) + } + var i struct{ T, C string } + if err := json.Unmarshal(raw["i"], &i); err != nil || i.T != "profiles" || i.C != column { + t.Errorf("i = %s, want {\"t\":\"profiles\",\"c\":%q}", raw["i"], column) + } + keys := make([]string, 0, len(raw)) + for k := range raw { + keys = append(keys, k) + } + sort.Strings(keys) + return strings.Join(keys, ",") +} + +// stored is each sealed field of an encrypted profile by column. +func stored(e testusers.EncryptedProfile) map[string][]byte { + return map[string][]byte{ + "visits": e.Visits, + "balance": e.Balance, + "active": e.Active, + "ratio": e.Ratio, + "score": e.Score, + "note": e.Note, + "name": e.Name, + "age": e.Age, + "rank": e.Rank, + "weight": e.Weight, + "price": e.Price, + "email": e.Email, + } +} + +func TestV4FieldsSealToTheirEQLTypesAndOpenBack(t *testing.T) { + c := deterministicEQLClient(t) + ctx := context.Background() + cipher := c.DefaultKeyset() + + encrypted, err := testusers.EncryptProfile(ctx, cipher, profiles) + if err != nil { + t.Fatal(err) + } + want := map[string]string{ + "visits": "c,i,v", + "balance": "c,i,v", + "active": "c,i,v", + "ratio": "c,i,v", + "score": "c,i,v", + "note": "c,i,v", + "name": "bf,c,i,v", + "age": "c,hm,i,v", + "rank": "c,hm,i,v", + "weight": "c,hm,i,v", + "price": "c,hm,i,v", + "email": "c,hm,i,v", + } + for i, e := range encrypted { + for column, value := range stored(e) { + if got := keysOf(t, column, value); got != want[column] { + t.Errorf("row %d %s: keys %s, want %s", i, column, got, want[column]) + } + } + } + + decrypted, err := testusers.DecryptProfile(ctx, cipher, encrypted) + if err != nil { + t.Fatal(err) + } + for i := range profiles { + if decrypted[i] != profiles[i] { + t.Errorf("row %d: %+v, want %+v", i, decrypted[i], profiles[i]) + } + } +} + +// bloom is the set of filter positions in a TextMatch value or query. +func bloom(t *testing.T, value []byte) map[int]bool { + t.Helper() + var v struct { + BF []int `json:"bf"` + } + if err := json.Unmarshal(value, &v); err != nil { + t.Fatal(err) + } + set := make(map[int]bool, len(v.BF)) + for _, p := range v.BF { + set[p] = true + } + return set +} + +func subset(a, b map[int]bool) bool { + for p := range a { + if !b[p] { + return false + } + } + return true +} + +func TestV4QueriesMatchTheRustFixture(t *testing.T) { + c := deterministicEQLClient(t) + ctx := context.Background() + cipher := c.DefaultKeyset() + + raw, err := os.ReadFile(fixturePath("v4_queries.json")) + if err != nil { + t.Fatal(err) + } + var fixture struct { + Table string + Name struct { + Plaintext string + Query string + } + Age struct { + Plaintext int32 + Query string + } + Rank struct { + Plaintext int64 + Query string + } + Weight struct { + Plaintext float32 + Query string + } + Price struct { + Plaintext float64 + Query string + } + Email struct { + Plaintext string + Query string + } + } + if err := json.Unmarshal(raw, &fixture); err != nil { + t.Fatal(err) + } + if fixture.Table != "profiles" { + t.Fatalf("the fixture's table changed: %q", fixture.Table) + } + + // Byte for byte what eql-bindings' own dispatch derived under the same + // index key: the Go field runs its v4 type's plan and no other. + name, err := testusers.ProfileFields.Name.Matches(ctx, cipher, fixture.Name.Plaintext) + if err != nil { + t.Fatal(err) + } + if string(name.Query()) != fixture.Name.Query { + t.Errorf("Name.Matches = %s\nwant %s", name.Query(), fixture.Name.Query) + } + equality := []struct { + field string + query func() ([]byte, error) + want string + }{ + {"Age", func() ([]byte, error) { + return testusers.ProfileFields.Age.Eq(ctx, cipher, fixture.Age.Plaintext) + }, fixture.Age.Query}, + {"Rank", func() ([]byte, error) { + return testusers.ProfileFields.Rank.Eq(ctx, cipher, fixture.Rank.Plaintext) + }, fixture.Rank.Query}, + {"Weight", func() ([]byte, error) { + return testusers.ProfileFields.Weight.Eq(ctx, cipher, fixture.Weight.Plaintext) + }, fixture.Weight.Query}, + {"Price", func() ([]byte, error) { + return testusers.ProfileFields.Price.Eq(ctx, cipher, fixture.Price.Plaintext) + }, fixture.Price.Query}, + {"Email", func() ([]byte, error) { + return testusers.ProfileFields.Email.Eq(ctx, cipher, fixture.Email.Plaintext) + }, fixture.Email.Query}, + } + for _, eq := range equality { + got, err := eq.query() + if err != nil { + t.Fatal(err) + } + if eq.want == "" || string(got) != eq.want { + t.Errorf("%s.Eq = %s\nwant %s", eq.field, got, eq.want) + } + } + + // And a stored value holds every filter bit of a query for text it + // contains, which is what `@@` tests, and not those of text it lacks. + // The first is a property of the filter. The second is not: a Bloom + // filter can cover an absent needle's bits by chance, and "zzz" and + // "bob" are clear of it under testSeed and the pinned configuration + // only, so a change to either can flip them with no bug behind it. + encrypted, err := testusers.EncryptProfile(ctx, cipher, profiles[:1]) + if err != nil { + t.Fatal(err) + } + all := bloom(t, encrypted[0].Name) + for needle, contained := range map[string]bool{"alice": true, "LIC": true, "zzz": false, "bob": false} { + q, err := testusers.ProfileFields.Name.Matches(ctx, cipher, needle) + if err != nil { + t.Fatal(err) + } + if got := subset(bloom(t, q.Query()), all); got != contained { + t.Errorf("%q in %q: %v, want %v", needle, profiles[0].Name, got, contained) + } + // Verify decides on the decrypted text, under TextMatch's own + // tokenizer, whatever the filter says. Verify takes any decrypted + // values, so the page also holds the case the tokenizer folds and + // text holding every 3-gram of the needle out of order. + names := []string{profiles[0].Name, profiles[1].Name, strings.ToUpper(needle), scrambled(needle)} + verified, err := q.Verify(ctx, names) + if err != nil { + t.Fatal(err) + } + for i, name := range names { + if want := holdsTrigrams(name, needle); verified[i] != want { + t.Errorf("Verify(%q) over %q = %v, want %v", needle, name, verified[i], want) + } + } + } + + // The fetch is sized from the twin's bits: with no measured histogram a + // data plan states no prior, so no finite fetch is promised. + q, err := testusers.ProfileFields.Name.Matches(ctx, cipher, "alice") + if err != nil { + t.Fatal(err) + } + limit, err := q.TargetLimit(ctx, 10, encrypt.Stats{Rows: 1000}) + if err != nil { + t.Fatal(err) + } + if rows, bounded := limit.Rows(); bounded { + t.Errorf("TargetLimit with no histogram = %d, want unbounded", rows) + } + limit, err = q.TargetLimit(ctx, 10, encrypt.Stats{Rows: 1000, Histogram: []encrypt.Bucket{{Bits: 60, Rows: 1000}}}) + if err != nil { + t.Fatal(err) + } + if rows, bounded := limit.Rows(); !bounded || rows < 10 { + t.Errorf("TargetLimit with a histogram = %d (bounded %v), want at least 10", rows, bounded) + } + + // A needle too short for a 3-gram has no filter bits, and an empty + // filter would be a subset of every row's: the engine refuses it. + for _, short := range []string{"", "al"} { + if q, err := testusers.ProfileFields.Name.Matches(ctx, cipher, short); err == nil { + t.Errorf("Name.Matches(%q) = %s, want a refusal", short, q) + } + } +} + +// rowsFixture is v4_rows.json: the profiles above as the generated code seals +// them under the deterministic guest and testSeed. The Rust suite opens them +// with stack-kms's DeterministicSource over the same seed, and inserts and +// queries them in PostgreSQL. +type rowsFixture struct { + Comment string `json:"_comment"` + Seed string `json:"seed"` + Table string `json:"table"` + Rows []fixtureRow `json:"rows"` +} + +type fixtureRow struct { + ID int64 `json:"id"` + Plaintext fixturePlain `json:"plaintext"` + Stored map[string]json.RawMessage `json:"stored"` +} + +type fixturePlain struct { + Visits int32 `json:"visits"` + Balance int64 `json:"balance"` + Active bool `json:"active"` + Ratio float32 `json:"ratio"` + Score float64 `json:"score"` + Note string `json:"note"` + Name string `json:"name"` + Age int32 `json:"age"` + Rank int64 `json:"rank"` + Weight float32 `json:"weight"` + Price float64 `json:"price"` + Email string `json:"email"` +} + +// TestV4RowsMatchTheCommittedFixture checks the committed v4_rows.json +// against what the generated code seals today. The deterministic guest +// derives every data key from the seed, so the envelopes and the terms +// (`bf`) are the same every run; the AEAD nonce inside each `c` is random, +// so `c` is not. The test therefore compares everything but `c`, and opens +// the committed `c` values with today's code. +// +// EQL_UPDATE_FIXTURES rewrites the file only when something other than the +// ciphertexts moved, so a regeneration that changes nothing leaves no diff. +// EQL_V4_ROWS_OUT names a file to write today's rows to, ciphertexts and +// all: CI hands it to the Rust suite (EQL_V4_ROWS), so the ciphertexts the +// Go SDK seals now are opened by Rust, not only the committed ones. +func TestV4RowsMatchTheCommittedFixture(t *testing.T) { + c := deterministicEQLClient(t) + encrypted, err := testusers.EncryptProfile(context.Background(), c.DefaultKeyset(), profiles) + if err != nil { + t.Fatal(err) + } + fixture := rowsFixture{ + Comment: "Profile rows sealed by the Go SDK's generated code over the deterministic EQL guest with the seed below; the Rust suite opens and queries them. Regenerate with EQL_UPDATE_FIXTURES=1 go test ./encrypt -run TestV4Rows, do not edit.", + Seed: string(testSeed[:]), + Table: "profiles", + } + for i, e := range encrypted { + p := profiles[i] + row := fixtureRow{ + ID: p.ID, + Plaintext: plainOf(p), + Stored: map[string]json.RawMessage{}, + } + for column, value := range stored(e) { + row.Stored[column] = json.RawMessage(value) + } + fixture.Rows = append(fixture.Rows, row) + } + rendered, err := json.MarshalIndent(fixture, "", " ") + if err != nil { + t.Fatal(err) + } + rendered = append(rendered, '\n') + if out := os.Getenv("EQL_V4_ROWS_OUT"); out != "" { + if err := os.WriteFile(out, rendered, 0o644); err != nil { + t.Fatal(err) + } + } + path := fixturePath("v4_rows.json") + var committed rowsFixture + committedBytes, err := os.ReadFile(path) + if err == nil { + err = json.Unmarshal(committedBytes, &committed) + } + same := err == nil && bytes.Equal(withoutCiphertexts(t, committed), withoutCiphertexts(t, fixture)) + if os.Getenv("EQL_UPDATE_FIXTURES") != "" { + if same { + t.Logf("%s: unchanged beyond the ciphertexts; left as it is", path) + } else { + if err := os.WriteFile(path, rendered, 0o644); err != nil { + t.Fatal(err) + } + t.Logf("%s: rewritten", path) + committed, same = fixture, true + } + } + if err != nil && !same { + t.Fatalf("%v: run with EQL_UPDATE_FIXTURES=1 to write it", err) + } + if !same { + t.Errorf("%s differs from what the generated code seals today beyond the ciphertexts; regenerate it with EQL_UPDATE_FIXTURES=1", path) + } + + // The committed ciphertexts still open, to the committed plaintexts. + opensToItsPlaintexts(t, c, committed.Rows) +} + +// TestFrozenV4RowsStillOpen holds stored_v4_rows_v1.json, rows the Go SDK +// stored with the next build. Unlike v4_rows.json it is never regenerated: +// nothing writes it. Sealing its plaintexts today must give the same rows +// apart from each `c` (the envelopes and the terms), and its committed `c` +// values must still open to its plaintexts. A failure here means a change +// broke rows already stored; see the README in that directory before +// touching the file. +func TestFrozenV4RowsStillOpen(t *testing.T) { + raw, err := os.ReadFile(fixturePath("stored_v4_rows_v1.json")) + if err != nil { + t.Fatal(err) + } + var frozen rowsFixture + if err := json.Unmarshal(raw, &frozen); err != nil { + t.Fatal(err) + } + if frozen.Seed != string(testSeed[:]) || frozen.Table != "profiles" || len(frozen.Rows) == 0 { + t.Fatalf("the frozen fixture changed shape: seed %q, table %q, %d rows", frozen.Seed, frozen.Table, len(frozen.Rows)) + } + c := deterministicEQLClient(t) + in := make([]testusers.Profile, len(frozen.Rows)) + for i, row := range frozen.Rows { + in[i] = profileOf(row.ID, row.Plaintext) + } + encrypted, err := testusers.EncryptProfile(context.Background(), c.DefaultKeyset(), in) + if err != nil { + t.Fatal(err) + } + today := rowsFixture{Comment: frozen.Comment, Seed: frozen.Seed, Table: frozen.Table} + for i, e := range encrypted { + row := fixtureRow{ID: frozen.Rows[i].ID, Plaintext: frozen.Rows[i].Plaintext, Stored: map[string]json.RawMessage{}} + for column, value := range stored(e) { + row.Stored[column] = json.RawMessage(value) + } + today.Rows = append(today.Rows, row) + } + if !bytes.Equal(withoutCiphertexts(t, frozen), withoutCiphertexts(t, today)) { + t.Errorf("sealing the frozen rows' plaintexts today stores different envelopes or terms: a change broke stored rows. Do not regenerate stored_v4_rows_v1.json") + } + opensToItsPlaintexts(t, c, frozen.Rows) +} + +// opensToItsPlaintexts opens each row's committed `c` values with today's +// code and checks them against the row's plaintext. +func opensToItsPlaintexts(t *testing.T, c *encrypt.Client, rows []fixtureRow) { + t.Helper() + sealed := make([]testusers.EncryptedProfile, len(rows)) + for i, row := range rows { + sealed[i] = testusers.EncryptedProfile{ + ID: row.ID, + Visits: []byte(row.Stored["visits"]), + Balance: []byte(row.Stored["balance"]), + Active: []byte(row.Stored["active"]), + Ratio: []byte(row.Stored["ratio"]), + Score: []byte(row.Stored["score"]), + Note: []byte(row.Stored["note"]), + Name: []byte(row.Stored["name"]), + Age: []byte(row.Stored["age"]), + Rank: []byte(row.Stored["rank"]), + Weight: []byte(row.Stored["weight"]), + Price: []byte(row.Stored["price"]), + Email: []byte(row.Stored["email"]), + } + } + opened, err := testusers.DecryptProfile(context.Background(), c.DefaultKeyset(), sealed) + if err != nil { + t.Fatal(err) + } + for i, row := range rows { + if got := plainOf(opened[i]); got != row.Plaintext { + t.Errorf("row %d opens to %+v, want %+v", row.ID, got, row.Plaintext) + } + } +} + +// profileOf is the profile a fixture row records. +func profileOf(id int64, p fixturePlain) testusers.Profile { + return testusers.Profile{ + ID: id, Visits: p.Visits, Balance: p.Balance, Active: p.Active, Ratio: p.Ratio, Score: p.Score, + Note: p.Note, Name: p.Name, Age: p.Age, Rank: p.Rank, Weight: p.Weight, Price: p.Price, Email: p.Email, + } +} + +// plainOf is a profile's plaintext as the fixture records it. +func plainOf(p testusers.Profile) fixturePlain { + return fixturePlain{p.Visits, p.Balance, p.Active, p.Ratio, p.Score, p.Note, p.Name, p.Age, p.Rank, p.Weight, p.Price, p.Email} +} + +// withoutCiphertexts renders a fixture with every stored value's `c` +// removed: the part of the file that is the same on every run. +func withoutCiphertexts(t *testing.T, f rowsFixture) []byte { + t.Helper() + out := f + out.Rows = nil + for _, row := range f.Rows { + stripped := fixtureRow{ID: row.ID, Plaintext: row.Plaintext, Stored: map[string]json.RawMessage{}} + for column, value := range row.Stored { + var fields map[string]json.RawMessage + if err := json.Unmarshal(value, &fields); err != nil { + t.Fatal(err) + } + delete(fields, "c") + b, err := json.Marshal(fields) + if err != nil { + t.Fatal(err) + } + stripped.Stored[column] = b + } + out.Rows = append(out.Rows, stripped) + } + b, err := json.Marshal(out) + if err != nil { + t.Fatal(err) + } + return b +} + +// holdsTrigrams is TextMatch's verify as a test oracle: the value holds +// every 3-gram of the query, both lower-cased (EqlMatch's options are 3-grams +// with downcasing), and the query cuts at least one. +func holdsTrigrams(value, query string) bool { + have := map[string]bool{} + for _, g := range trigrams(strings.ToLower(value)) { + have[g] = true + } + want := trigrams(strings.ToLower(query)) + for _, g := range want { + if !have[g] { + return false + } + } + return len(want) > 0 +} + +func trigrams(s string) []string { + r := []rune(s) + var out []string + for i := 0; i+3 <= len(r); i++ { + out = append(out, string(r[i:i+3])) + } + return out +} + +// scrambled holds every 3-gram of s, last first, with a space between them: +// no substring of it is s, and a token test still passes it. +func scrambled(s string) string { + g := trigrams(s) + slices.Reverse(g) + return strings.Join(g, " ") +} diff --git a/languages/golang/encrypt/errors_test.go b/languages/golang/encrypt/errors_test.go index e7253d348..2ba3f1566 100644 --- a/languages/golang/encrypt/errors_test.go +++ b/languages/golang/encrypt/errors_test.go @@ -46,7 +46,7 @@ func TestEachKindCarriesItsDiagnostic(t *testing.T) { return err }, encrypt.ErrAuthentication, "stack_encrypt::aead"}, {"match text with no token", func() error { - _, err := testusers.Fields.Email.Match(ctx, cipher, "") + _, err := testusers.Fields.Email.Matches(ctx, cipher, "") return err }, encrypt.ErrTerm, "stack_encrypt::empty_term_text"}, {"a ciphertext that is not a sealed value", func() error { diff --git a/languages/golang/encrypt/example/README.md b/languages/golang/encrypt/example/README.md index 0a995caca..1e1e3c2c1 100644 --- a/languages/golang/encrypt/example/README.md +++ b/languages/golang/encrypt/example/README.md @@ -2,7 +2,7 @@ A runnable tour of the Go SDK against real ZeroKMS: declare a struct with `stash` tags, generate its encrypted type, seal a batch in one request, derive -a query term, and open the batch again. +a query term, open the batch again, and verify a matches query over it. ## Running it @@ -28,5 +28,5 @@ until they are built. - `model.go`: the struct and its `go:generate` line. - `user_stash.go`: what `stashgen` wrote from the tags. Regenerate it with `go generate ./...`; CI fails when that changes a committed file. -- `main.go`: `Encrypt`, `Fields.Email.Equality` and `Decrypt`, the only three - calls a program makes. +- `main.go`: `Encrypt`, `Fields.Email.Eq`, `Decrypt`, and `Fields.Email.Matches` + with `Verify` on the decrypted rows. diff --git a/languages/golang/encrypt/example/main.go b/languages/golang/encrypt/example/main.go index 2157699d7..ef451565f 100644 --- a/languages/golang/encrypt/example/main.go +++ b/languages/golang/encrypt/example/main.go @@ -47,7 +47,7 @@ func run(ctx context.Context) error { } // A query term for one field compares against the stored terms. - term, err := Fields.Email.Equality(ctx, cipher, "bob@example.com") + term, err := Fields.Email.Eq(ctx, cipher, "bob@example.com") if err != nil { return fmt.Errorf("query term: %w", err) } @@ -66,5 +66,23 @@ func run(ctx context.Context) error { for _, u := range back { fmt.Printf("decrypted id %d\n", u.ID) } + + // A matches query's answer can hold rows that do not match, so the + // rows it finds are decrypted and verified: one call for the page. + q, err := Fields.Email.Matches(ctx, cipher, "bob") + if err != nil { + return fmt.Errorf("matches: %w", err) + } + emails := make([]string, len(back)) + for i, u := range back { + emails[i] = u.Email + } + verified, err := q.Verify(ctx, emails) + if err != nil { + return fmt.Errorf("verify: %w", err) + } + for i, u := range back { + fmt.Printf("id %d holds bob: %v\n", u.ID, verified[i]) + } return nil } diff --git a/languages/golang/encrypt/example/user_stash.go b/languages/golang/encrypt/example/user_stash.go index 13cf2b6ef..4dc7ec03a 100644 --- a/languages/golang/encrypt/example/user_stash.go +++ b/languages/golang/encrypt/example/user_stash.go @@ -142,12 +142,15 @@ func (f EmailField) Encrypt(ctx context.Context, c *encrypt.Cipher, v string) (E return EncryptedUserEmail{Ciphertext: out.Ciphertext, Equality: out.Equality, Match: out.Match}, nil } -func (f EmailField) Equality(ctx context.Context, c *encrypt.Cipher, v string) (encrypt.EqualityTerm, error) { - return f.field.Equality(ctx, c, v) +func (f EmailField) Eq(ctx context.Context, c *encrypt.Cipher, v string) (encrypt.EqualityTerm, error) { + term, err := f.field.Term(ctx, c, "eq", v) + return encrypt.EqualityTerm(term), err } -func (f EmailField) Match(ctx context.Context, c *encrypt.Cipher, v string) (encrypt.MatchTerm, error) { - return f.field.Match(ctx, c, v) +// Matches derives the matches query for v. Its answer can hold rows that do not +// match: decrypt the rows it fetches and keep those Verify reports true. +func (f EmailField) Matches(ctx context.Context, c *encrypt.Cipher, v string) (encrypt.MatchQuery[string], error) { + return gensupport.Matches(ctx, f.field, c, v) } type AgeField struct { @@ -162,10 +165,32 @@ func (f AgeField) Encrypt(ctx context.Context, c *encrypt.Cipher, v uint32) (Enc return EncryptedUserAge{Ciphertext: out.Ciphertext, Equality: out.Equality, Ore: out.Ore}, nil } -func (f AgeField) Equality(ctx context.Context, c *encrypt.Cipher, v uint32) (encrypt.EqualityTerm, error) { - return f.field.Equality(ctx, c, v) +func (f AgeField) Eq(ctx context.Context, c *encrypt.Cipher, v uint32) (encrypt.EqualityTerm, error) { + term, err := f.field.Term(ctx, c, "eq", v) + return encrypt.EqualityTerm(term), err } -func (f AgeField) Ore(ctx context.Context, c *encrypt.Cipher, v uint32) (encrypt.OreTerm, error) { - return f.field.Ore(ctx, c, v) +func (f AgeField) Lt(ctx context.Context, c *encrypt.Cipher, v uint32) (encrypt.OreTerm, error) { + term, err := f.field.Term(ctx, c, "lt", v) + return encrypt.OreTerm(term), err +} + +func (f AgeField) Lte(ctx context.Context, c *encrypt.Cipher, v uint32) (encrypt.OreTerm, error) { + term, err := f.field.Term(ctx, c, "lte", v) + return encrypt.OreTerm(term), err +} + +func (f AgeField) Gt(ctx context.Context, c *encrypt.Cipher, v uint32) (encrypt.OreTerm, error) { + term, err := f.field.Term(ctx, c, "gt", v) + return encrypt.OreTerm(term), err +} + +func (f AgeField) Gte(ctx context.Context, c *encrypt.Cipher, v uint32) (encrypt.OreTerm, error) { + term, err := f.field.Term(ctx, c, "gte", v) + return encrypt.OreTerm(term), err +} + +func (f AgeField) Between(ctx context.Context, c *encrypt.Cipher, lo, hi uint32) (encrypt.Range[encrypt.OreTerm], error) { + low, high, err := f.field.Range(ctx, c, "between", lo, hi) + return encrypt.Range[encrypt.OreTerm]{Low: low, High: high}, err } diff --git a/languages/golang/encrypt/export_test.go b/languages/golang/encrypt/export_test.go index 8fd779c95..753d1a196 100644 --- a/languages/golang/encrypt/export_test.go +++ b/languages/golang/encrypt/export_test.go @@ -118,7 +118,7 @@ func deterministicClient(ctx context.Context, wasm []byte, seed [32]byte) (*Clie _ = c.Close() return nil, err } - out, err := c.call(ctx, func(inst *instance) ([]byte, error) { + out, err := c.call(ctx, func(ctx context.Context, inst *instance) ([]byte, error) { return inst.call(ctx, inst.cipherInit, buf(encoded)) }) if err != nil { diff --git a/languages/golang/encrypt/fixture_test.go b/languages/golang/encrypt/fixture_test.go index e992a9679..5f92793a7 100644 --- a/languages/golang/encrypt/fixture_test.go +++ b/languages/golang/encrypt/fixture_test.go @@ -122,21 +122,21 @@ func TestGeneratedCodeOpensTheRustRecordFixture(t *testing.T) { } } // The terms Go derives are the bytes Rust stored. - eq, err := testusers.Fields.Age.Equality(ctx, cipher, f.Plaintext.Age) + eq, err := testusers.Fields.Age.Eq(ctx, cipher, f.Plaintext.Age) if err != nil || !eq.Equal(stored.Age.Equality) { t.Errorf("age equality: %v, equal=%v", err, eq.Equal(stored.Age.Equality)) } - ore, err := testusers.Fields.Age.Ore(ctx, cipher, f.Plaintext.Age) + ore, err := testusers.Fields.Age.Lt(ctx, cipher, f.Plaintext.Age) if err != nil || !bytes.Equal(ore, stored.Age.Ore) { t.Errorf("age ore: %v, equal=%v", err, bytes.Equal(ore, stored.Age.Ore)) } - emailEq, err := testusers.Fields.Email.Equality(ctx, cipher, f.Plaintext.Email) + emailEq, err := testusers.Fields.Email.Eq(ctx, cipher, f.Plaintext.Email) if err != nil || !emailEq.Equal(stored.Email.Equality) { t.Errorf("email equality: %v, equal=%v", err, emailEq.Equal(stored.Email.Equality)) } - match, err := testusers.Fields.Email.Match(ctx, cipher, f.Plaintext.Email) - if err != nil || !bytes.Equal(match, stored.Email.Match) { - t.Errorf("email match: %v, equal=%v", err, bytes.Equal(match, stored.Email.Match)) + match, err := testusers.Fields.Email.Matches(ctx, cipher, f.Plaintext.Email) + if err != nil || !bytes.Equal(match.Term(), stored.Email.Match) { + t.Errorf("email match: %v, equal=%v", err, bytes.Equal(match.Term(), stored.Email.Match)) } // A fresh Go record of the same plaintext derives the same terms. again, err := testusers.Encrypt(ctx, cipher, []testusers.User{{ID: int64(f.Plaintext.ID), Age: f.Plaintext.Age, Email: f.Plaintext.Email, Notes: f.Plaintext.Notes}}) diff --git a/languages/golang/encrypt/generated_paths_test.go b/languages/golang/encrypt/generated_paths_test.go index efd787fbc..03011a841 100644 --- a/languages/golang/encrypt/generated_paths_test.go +++ b/languages/golang/encrypt/generated_paths_test.go @@ -117,19 +117,19 @@ func TestGeneratedCodeFromForAndFromAPolicyRunsAgainstTheGuest(t *testing.T) { } // A term derived through each path's Fields is the tag path's. - probe, err := testusers.Fields.Email.Equality(ctx, cipher, "bob@example.com") + probe, err := testusers.Fields.Email.Eq(ctx, cipher, "bob@example.com") if err != nil { t.Fatal(err) } - forProbe, err := testusers.MemberFields.Email.Equality(ctx, cipher, "bob@example.com") + forProbe, err := testusers.MemberFields.Email.Eq(ctx, cipher, "bob@example.com") if err != nil || !forProbe.Equal(probe) { t.Fatalf("the -for path's probe: %v, equal=%v", err, forProbe.Equal(probe)) } - policyProbe, err := testpolicy.Fields.Email.Equality(ctx, cipher, "bob@example.com") + policyProbe, err := testpolicy.Fields.Email.Eq(ctx, cipher, "bob@example.com") if err != nil || !policyProbe.Equal(probe) { t.Fatalf("the policy path's probe: %v, equal=%v", err, policyProbe.Equal(probe)) } - ore, err := testpolicy.Fields.Age.Ore(ctx, cipher, 29) + ore, err := testpolicy.Fields.Age.Lt(ctx, cipher, 29) if err != nil || !bytes.Equal(ore, tagged[1].Age.Ore) { t.Fatalf("the policy path's ORE probe: %v", err) } diff --git a/languages/golang/encrypt/gensupport/codec.go b/languages/golang/encrypt/gensupport/codec.go index 77e23cb60..fa94c2a16 100644 --- a/languages/golang/encrypt/gensupport/codec.go +++ b/languages/golang/encrypt/gensupport/codec.go @@ -203,7 +203,11 @@ func (c *Codec[P, E]) split(vals Values) (record.Source, map[string]any, error) return nil, nil, fmt.Errorf("the generated Source gave no field %q", f.name) } if f.crosses() { - row[f.name] = v + converted, err := asKind(f.kind, v) + if err != nil { + return nil, nil, fmt.Errorf("field %q: %w", f.name, err) + } + row[f.name] = converted } else { keep[f.name] = v } diff --git a/languages/golang/encrypt/gensupport/convert.go b/languages/golang/encrypt/gensupport/convert.go index 22162f8ea..678c527f0 100644 --- a/languages/golang/encrypt/gensupport/convert.go +++ b/languages/golang/encrypt/gensupport/convert.go @@ -13,10 +13,14 @@ import ( // convert writes an opened sealed value into out, a pointer to the Go type // the struct declares. The engine returns a value at the field's declared -// kind — int32, int64, uint32, uint64, float32, float64, string, []byte, -// bool, or a vcvalue.Object for a composite — and the struct's type is in -// the same family, narrower at most. A value outside the target's range, or -// of another family, is an error. +// kind — an integer of its own width (int8 to uint64, or vcvalue.Int128 and +// vcvalue.Uint128), float32, float64, string, []byte, bool, time.Time for a +// timestamp, vcvalue.Date, vcvalue.Decimal, or a vcvalue.Object for a +// composite — and the struct's type is that type, or in the same family and +// narrower at most (an EQL type's int32 opening into the int16 field it was +// widened from). A value outside the target's range, or of another family, +// is an error. A time, date, decimal or 128-bit integer is read only into +// its own type, which Get matches before it calls this. // // An error names types and positions, never the value: the value is // decrypted plaintext, and an error is what a program logs. @@ -300,6 +304,14 @@ func outOfRange(want any) error { func setInt[T ~int | ~int8 | ~int16 | ~int32 | ~int64](v any, out *T, lo, hi int64) error { var n int64 switch i := v.(type) { + case int8: + n = int64(i) + case int16: + n = int64(i) + case uint8: + n = int64(i) + case uint16: + n = int64(i) case int32: n = int64(i) case int64: @@ -326,6 +338,20 @@ func setInt[T ~int | ~int8 | ~int16 | ~int32 | ~int64](v any, out *T, lo, hi int func setUint[T ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64](v any, out *T, hi uint64) error { var n uint64 switch i := v.(type) { + case uint8: + n = uint64(i) + case uint16: + n = uint64(i) + case int8: + if i < 0 { + return outOfRange(*out) + } + n = uint64(i) + case int16: + if i < 0 { + return outOfRange(*out) + } + n = uint64(i) case uint32: n = uint64(i) case uint64: diff --git a/languages/golang/encrypt/gensupport/declaration.go b/languages/golang/encrypt/gensupport/declaration.go index 339044827..57d3e8c31 100644 --- a/languages/golang/encrypt/gensupport/declaration.go +++ b/languages/golang/encrypt/gensupport/declaration.go @@ -19,20 +19,35 @@ import ( // the engine refuses a plan whose indexed field has no type. type Kind string -// The kinds. int8, int16 and int32 are Int32; int and int64 are Int64; -// uint8, uint16 and uint32 are Uint32; uint and uint64 are Uint64; []byte is -// Bytes. A type defined over one of these has its underlying kind. +// The kinds. Each Go integer type has the kind of its own width: int8 is +// Int8, int16 Int16, int32 Int32, int and int64 Int64, uint8 Uint8, uint16 +// Uint16, uint32 Uint32, uint and uint64 Uint64, and encrypt.Int128 and +// encrypt.Uint128 the 128-bit kinds. time.Time is Timestamp, encrypt.Date +// Date and encrypt.Decimal Decimal. []byte is Bytes. A type defined over a +// basic type has its underlying kind. A field stored as an EQL type takes +// the type's kind instead, when every value of its Go type fits it (an int16 +// into Integer's int32), and its value is converted to that kind before it +// crosses. const ( - Untyped Kind = "" - Bool Kind = "bool" - Int32 Kind = "int32" - Int64 Kind = "int64" - Uint32 Kind = "uint32" - Uint64 Kind = "uint64" - Float32 Kind = "float32" - Float64 Kind = "float64" - String Kind = "string" - Bytes Kind = "bytes" + Untyped Kind = "" + Bool Kind = "bool" + Int8 Kind = "int8" + Int16 Kind = "int16" + Int32 Kind = "int32" + Int64 Kind = "int64" + Int128 Kind = "int128" + Uint8 Kind = "uint8" + Uint16 Kind = "uint16" + Uint32 Kind = "uint32" + Uint64 Kind = "uint64" + Uint128 Kind = "uint128" + Float32 Kind = "float32" + Float64 Kind = "float64" + Decimal Kind = "decimal" + Date Kind = "date" + Timestamp Kind = "timestamp" + String Kind = "string" + Bytes Kind = "bytes" ) // OpaqueField is the one field of an opaque declaration: the whole struct, diff --git a/languages/golang/encrypt/gensupport/field.go b/languages/golang/encrypt/gensupport/field.go index 8006b0a01..f4e8ebb32 100644 --- a/languages/golang/encrypt/gensupport/field.go +++ b/languages/golang/encrypt/gensupport/field.go @@ -10,7 +10,7 @@ import ( // Field is one sealed field's entry in a generated Fields value: it encrypts // one value of the field, for an update of one column, and derives the -// terms the field declares, for a query. T is the field's Go type. +// query term of each operator the field answers. T is the field's Go type. type Field[T any] struct { name string plan *record.Plan @@ -36,6 +36,14 @@ func NewField[T any](d Declaration, name string) Field[T] { return f } +// kind is the field's declared kind, as its plan holds it. +func (f Field[T]) kind() Kind { + if pf := f.plan.Field(f.name); pf != nil { + return Kind(pf.Kind) + } + return Untyped +} + // Encrypt seals one value of the field: its ciphertext and every term it // declares, in one request. func (f Field[T]) Encrypt(ctx context.Context, c *encrypt.Cipher, v T) (Output, error) { @@ -45,7 +53,11 @@ func (f Field[T]) Encrypt(ctx context.Context, c *encrypt.Cipher, v T) (Output, if c == nil { return Output{}, fmt.Errorf("gensupport: %s: Encrypt needs a cipher", f.name) } - row := record.Source{f.name: v} + value, err := asKind(f.kind(), v) + if err != nil { + return Output{}, fmt.Errorf("gensupport: %s: %w", f.name, err) + } + row := record.Source{f.name: value} if f.plan.ContextField != "" { // One value of one field has no record to take its context from: // the cipher names it, as it does for a query. @@ -65,58 +77,84 @@ func (f Field[T]) Encrypt(ctx context.Context, c *encrypt.Cipher, v T) (Output, return outputOf(sealed[0][f.name]), nil } -// Query derives the EQL query value for one value of an encrypt_into field: -// the operand that matches stored values of the field, in Output.EQL. The -// engine runs the EQL type's own query plan, with no data key. -func (f Field[T]) Query(ctx context.Context, c *encrypt.Cipher, v T) (Output, error) { - if f.err != nil { - return Output{}, f.err - } - if c == nil { - return Output{}, fmt.Errorf("gensupport: %s: Query needs a cipher", f.name) - } - out, err := c.Query(ctx, f.plan, f.name, v) +// Term derives the term of an exact operator the field answers, for one +// value: an index term for a field declared with indexes, the query value's +// JSON for a field that names an EQL type. The generated method for the +// operator converts it to its query type. The engine picks the index that +// answers the operator ([encrypt.Cipher.QueryTerm]). +func (f Field[T]) Term(ctx context.Context, c *encrypt.Cipher, operator string, v T) ([]byte, error) { + terms, err := f.query(ctx, c, operator, v, 1) if err != nil { - return Output{}, err + return nil, err } - return Output{EQL: out}, nil -} - -// Equality derives the field's equality term for one value. -func (f Field[T]) Equality(ctx context.Context, c *encrypt.Cipher, v T) (encrypt.EqualityTerm, error) { - return f.term(ctx, c, record.Equality, v) -} - -// Match derives the field's match term for one value. -func (f Field[T]) Match(ctx context.Context, c *encrypt.Cipher, v T) (encrypt.MatchTerm, error) { - return f.term(ctx, c, record.Match, v) -} - -// Ore derives the field's ORE term for one value. -func (f Field[T]) Ore(ctx context.Context, c *encrypt.Cipher, v T) (encrypt.OreTerm, error) { - return f.term(ctx, c, record.Ore, v) + return terms[0], nil } -// Ope derives the field's OPE term for one value. -func (f Field[T]) Ope(ctx context.Context, c *encrypt.Cipher, v T) (encrypt.OpeTerm, error) { - return f.term(ctx, c, record.Ope, v) +// Range derives the two terms of a range operator the field answers, such +// as between: the low bound's term, then the high bound's. +func (f Field[T]) Range(ctx context.Context, c *encrypt.Cipher, operator string, lo, hi T) ([]byte, []byte, error) { + terms, err := f.query(ctx, c, operator, []any{lo, hi}, 2) + if err != nil { + return nil, nil, err + } + return terms[0], terms[1], nil } -// JSON derives the field's json index term. The engine does not derive it -// yet, so it fails. -func (f Field[T]) JSON(context.Context, *encrypt.Cipher, T) (encrypt.JSONTerm, error) { +// query derives an exact operator's terms, and refuses an answer of another +// shape than the generated method's: a probabilistic term has a query type +// of its own (Matches). Each operand is converted to the field's kind as a +// written value is ([asKind]), so the query finds what a write stored. +func (f Field[T]) query(ctx context.Context, c *encrypt.Cipher, operator string, input any, parts int) ([][]byte, error) { if f.err != nil { return nil, f.err } - return nil, fmt.Errorf("gensupport: %s: the engine does not derive the json index yet", f.name) + if c == nil { + return nil, fmt.Errorf("%w: gensupport: %s: a query needs a cipher", encrypt.ErrEncoding, f.name) + } + pair, isPair := input.([]any) + values := []any{input} + if isPair { + values = pair + } + converted := make([]any, len(values)) + for i, v := range values { + value, err := asKind(f.kind(), v) + if err != nil { + return nil, fmt.Errorf("gensupport: %s: %w", f.name, err) + } + converted[i] = value + } + operand := converted[0] + if isPair { + operand = converted + } + term, err := c.QueryTerm(ctx, f.plan, f.name, operator, operand) + if err != nil { + return nil, err + } + if term.Fidelity != record.Exact || len(term.Terms) != parts { + return nil, fmt.Errorf("gensupport: %s: %s came back as a %s term of %d parts, not an exact one of %d", f.name, operator, term.Fidelity, len(term.Terms), parts) + } + return term.Terms, nil } -func (f Field[T]) term(ctx context.Context, c *encrypt.Cipher, output record.Output, v T) ([]byte, error) { +// Matches derives the matches query for one value of a field declared with +// a match index: the term, and what Verify and TargetLimit need. A function, +// not a method, because only a string field answers matches. A nil cipher +// is refused by [encrypt.NewMatchQuery], with [encrypt.ErrEncoding]. +func Matches[T ~string](ctx context.Context, f Field[T], c *encrypt.Cipher, v T) (encrypt.MatchQuery[T], error) { if f.err != nil { - return nil, f.err + return encrypt.MatchQuery[T]{}, f.err } - if c == nil { - return nil, fmt.Errorf("gensupport: %s: a term needs a cipher", f.name) + return encrypt.NewMatchQuery(ctx, c, f.plan, f.name, v) +} + +// EQLMatches derives the matches query for one value of a field that names +// an EQL type with a match index: the type's query value Q, and what Verify +// and TargetLimit need. +func EQLMatches[Q ~[]byte, T ~string](ctx context.Context, f Field[T], c *encrypt.Cipher, v T) (encrypt.EQLMatchQuery[Q, T], error) { + if f.err != nil { + return encrypt.EQLMatchQuery[Q, T]{}, f.err } - return c.Derive(ctx, f.plan, f.name, output, v) + return encrypt.NewEQLMatchQuery[Q](ctx, c, f.plan, f.name, v) } diff --git a/languages/golang/encrypt/gensupport/gensupport_internal_test.go b/languages/golang/encrypt/gensupport/gensupport_internal_test.go index 72a40f043..b39b57f65 100644 --- a/languages/golang/encrypt/gensupport/gensupport_internal_test.go +++ b/languages/golang/encrypt/gensupport/gensupport_internal_test.go @@ -12,6 +12,7 @@ import ( "github.com/cipherstash/stack/languages/golang/encrypt" "github.com/cipherstash/stack/languages/golang/internal/record" + "github.com/cipherstash/vitaminc/bindings/go/vcffi" "github.com/cipherstash/vitaminc/bindings/go/vcvalue" ) @@ -394,3 +395,68 @@ func check(err error, ok bool) error { } return nil } + +// A value sealed at an EQL integer type's kind is converted to it on the +// host: any Go integer of a value that fits, from a narrower type or a wider +// one, and a value that does not fit is refused with ErrEncoding, naming the +// kind and not the value (ADR-0002). +func TestAsKindConvertsAnIntegerThatFitsAndRefusesOneThatDoesNot(t *testing.T) { + for _, c := range []struct { + kind Kind + in any + want any + }{ + {Int32, int8(-7), int32(-7)}, + {Int32, uint16(65535), int32(65535)}, + {Int32, int64(math.MaxInt32), int32(math.MaxInt32)}, + {Int32, int(math.MinInt32), int32(math.MinInt32)}, + {Int64, uint32(math.MaxUint32), int64(math.MaxUint32)}, + {Int64, uint64(math.MaxInt64), int64(math.MaxInt64)}, + {Int8, int8(3), int8(3)}, + {String, "s", "s"}, + } { + got, err := asKind(c.kind, c.in) + if err != nil || got != c.want { + t.Errorf("asKind(%s, %T) = %v (%T), %v; want %v (%T)", c.kind, c.in, got, got, err, c.want, c.want) + } + } + for _, c := range []struct { + kind Kind + in any + }{ + {Int32, int64(math.MaxInt32) + 1}, + {Int32, int64(math.MinInt32) - 1}, + {Int32, uint32(math.MaxUint32)}, + {Int64, uint64(math.MaxInt64) + 1}, + {Uint8, int8(-1)}, + } { + _, err := asKind(c.kind, c.in) + if !errors.Is(err, encrypt.ErrEncoding) { + t.Errorf("asKind(%s, %T out of range) = %v, want ErrEncoding", c.kind, c.in, err) + } + if err != nil && strings.Contains(err.Error(), fmt.Sprint(c.in)) { + t.Errorf("asKind's error names the value: %v", err) + } + } +} + +// encodedInt is an integer type that writes itself, as an int32 of its value +// plus 100. +type encodedInt int16 + +func (v encodedInt) EncryptValue(enc vcffi.Encoder) error { + enc.Int32(int32(v) + 100) + return nil +} + +// A value whose type writes itself crosses as it is, whatever the kind: a +// conversion to a built-in integer would drop its EncryptValue, so a write +// would store one value and a query, which keeps it, ask for another. +func TestAsKindLeavesAValueThatWritesItself(t *testing.T) { + for _, kind := range []Kind{Int16, Int32, Int64} { + got, err := asKind(kind, encodedInt(7)) + if err != nil || got != encodedInt(7) { + t.Errorf("asKind(%s, encodedInt(7)) = %v (%T), %v; want encodedInt(7)", kind, got, got, err) + } + } +} diff --git a/languages/golang/encrypt/gensupport/widen.go b/languages/golang/encrypt/gensupport/widen.go new file mode 100644 index 000000000..02e13c735 --- /dev/null +++ b/languages/golang/encrypt/gensupport/widen.go @@ -0,0 +1,139 @@ +package gensupport + +import ( + "fmt" + "math" + "reflect" + "time" + + "github.com/cipherstash/stack/languages/golang/encrypt" + "github.com/cipherstash/vitaminc/bindings/go/vcffi" + "github.com/cipherstash/vitaminc/bindings/go/vcvalue" +) + +// asKind is a sealed field's value as the Go type of its declared kind, the +// width the engine seals it at. A field's kind is its Go type's own unless the +// field is stored as an EQL type of another integer kind (an int16 stored as +// Integer is sealed as an int32, and so is an int64, ADR-0002): then the value +// is converted here, on the host, because nothing below the binding converts. +// Only an integer changes; every other value, and an integer already of its +// kind's width, crosses as it is. A value outside the kind's range is refused +// with encrypt.ErrEncoding: a Go type wider than the kind is accepted by +// stashgen and range checked here, value by value. +// +// A value whose type writes itself (vcffi.Encryptable) crosses as it is too: +// converting it to a built-in integer would drop its EncryptValue, and the +// engine holds what it writes to the field's kind. A write and a query of one +// field both convert here ([Field.Encrypt], [Field.Term]), so they agree. +// +// The error names the kind and not the value, which is plaintext. +func asKind(kind Kind, v any) (any, error) { + if err := checkValue(v); err != nil { + return nil, err + } + if !isInteger(kind) { + return v, nil + } + switch v.(type) { + case vcvalue.Int128, vcvalue.Uint128, vcffi.Encryptable: + return v, nil + } + rv := reflect.ValueOf(v) + if !rv.IsValid() { + return v, nil + } + var signed *int64 + var unsigned *uint64 + switch rv.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + i := rv.Int() + signed = &i + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + u := rv.Uint() + unsigned = &u + default: + return v, nil + } + out, ok := integerAs(kind, signed, unsigned) + if !ok { + return nil, fmt.Errorf("%w: a value does not fit the field's kind %s", encrypt.ErrEncoding, kind) + } + return out, nil +} + +// checkValue refuses a date, decimal or timestamp the codec cannot write, before +// it reaches the codec, so the caller can name the field: the codec's own +// refusal names neither. A zero encrypt.Date (year 0, month 0, day 0) is not +// a date and is refused here. The error is vitaminc's, which names the type +// and not the value. +func checkValue(v any) error { + var err error + switch v := v.(type) { + case vcvalue.Date: + err = v.Validate() + case vcvalue.Decimal: + err = v.Validate() + case time.Time: + err = vcvalue.Timestamp{Seconds: v.Unix(), Nanoseconds: uint32(v.Nanosecond())}.Validate() //nolint:gosec // Nanosecond is in [0, 1e9) + } + if err != nil { + return fmt.Errorf("%w: %w", encrypt.ErrEncoding, err) + } + return nil +} + +func isInteger(k Kind) bool { + switch k { + case Int8, Int16, Int32, Int64, Int128, Uint8, Uint16, Uint32, Uint64, Uint128: + return true + } + return false +} + +// integerAs is the integer, given as exactly one of a signed or an unsigned +// value, as the Go type of kind, if it fits. A 128-bit kind has no arm: its +// only Go types are encrypt.Int128 and Uint128, which asKind passes through, +// and stashgen refuses a built-in integer field stored as a 128-bit kind, so a +// built-in integer never reaches one here; if one did, it is refused as not +// fitting. +func integerAs(kind Kind, signed *int64, unsigned *uint64) (any, bool) { + inSigned := func(lo, hi int64) (int64, bool) { + if signed != nil { + return *signed, *signed >= lo && *signed <= hi + } + return int64(*unsigned), *unsigned <= uint64(hi) //nolint:gosec // range-checked + } + inUnsigned := func(hi uint64) (uint64, bool) { + if unsigned != nil { + return *unsigned, *unsigned <= hi + } + return uint64(*signed), *signed >= 0 && uint64(*signed) <= hi //nolint:gosec // range-checked + } + switch kind { + case Int8: + i, ok := inSigned(math.MinInt8, math.MaxInt8) + return int8(i), ok //nolint:gosec // range-checked: ok is false when it does not fit + case Int16: + i, ok := inSigned(math.MinInt16, math.MaxInt16) + return int16(i), ok //nolint:gosec // range-checked: ok is false when it does not fit + case Int32: + i, ok := inSigned(math.MinInt32, math.MaxInt32) + return int32(i), ok //nolint:gosec // range-checked: ok is false when it does not fit + case Int64: + i, ok := inSigned(math.MinInt64, math.MaxInt64) + return i, ok + case Uint8: + u, ok := inUnsigned(math.MaxUint8) + return uint8(u), ok //nolint:gosec // range-checked: ok is false when it does not fit + case Uint16: + u, ok := inUnsigned(math.MaxUint16) + return uint16(u), ok //nolint:gosec // range-checked: ok is false when it does not fit + case Uint32: + u, ok := inUnsigned(math.MaxUint32) + return uint32(u), ok //nolint:gosec // range-checked: ok is false when it does not fit + case Uint64: + u, ok := inUnsigned(math.MaxUint64) + return u, ok + } + return nil, false +} diff --git a/languages/golang/encrypt/guest.go b/languages/golang/encrypt/guest.go index c5bbecbd4..04d01730c 100644 --- a/languages/golang/encrypt/guest.go +++ b/languages/golang/encrypt/guest.go @@ -82,11 +82,15 @@ type instance struct { // on it. mem *guest.Allocator - exports guest.Exports - cipherInit, shutdown, keyset api.Function - term, query api.Function - encryptRecord, decryptRecord api.Function - planCheck, targets api.Function + exports guest.Exports + cipherInit, shutdown, keyset api.Function + term api.Function + queryTerm, verify, limit api.Function + encryptRecord, decryptRecord api.Function + planCheck, targets, operators api.Function + // The step loop (step.go): take a paused export's step, resume it with + // the responses, or abort it. + io, resume, abort api.Function } // guestModuleConfig is the module configuration every guest instance runs @@ -112,10 +116,13 @@ func guestModuleConfig() wazero.ModuleConfig { // strict policy, memory that cannot be locked fails instantiation with // ErrMemoryLock. func newInstance(ctx context.Context, wasm []byte, t *transport, policy guest.LockPolicy) (*instance, error) { - // WithCloseOnContextDone lets a caller's deadline or cancellation - // interrupt an in-flight guest call — which otherwise holds the Client's - // lock against every other user. An interrupted call closes the module, - // so the Client is done afterwards; the alternative is a wedged process. + // WithCloseOnContextDone closes the module when a call's context ends. + // A guest call never runs under the caller's context: Client.call runs + // it under guest.Detach, whose context ends only when the guest has run + // on long after its caller gave up. Closing the module then frees the + // Client's lock, which a stuck call would otherwise hold against every + // other user, at the cost of the Client: the alternative is a wedged + // process. config := wazero.NewRuntimeConfig(). WithCompilationCache(compilationCache()). WithCloseOnContextDone(true) @@ -171,11 +178,17 @@ func newInstance(ctx context.Context, wasm []byte, t *transport, policy guest.Lo "se_shutdown": &inst.shutdown, "se_keyset": &inst.keyset, "se_term": &inst.term, - "se_query": &inst.query, + "se_query_term": &inst.queryTerm, + "se_verify": &inst.verify, + "se_target_limit": &inst.limit, "se_encrypt_record": &inst.encryptRecord, "se_decrypt_record": &inst.decryptRecord, "se_plan_check": &inst.planCheck, "se_targets": &inst.targets, + "se_operators": &inst.operators, + "se_io": &inst.io, + "se_resume": &inst.resume, + "se_abort": &inst.abort, } for name, slot := range exports { if *slot = module.ExportedFunction(name); *slot == nil { @@ -192,8 +205,8 @@ func newInstance(ctx context.Context, wasm []byte, t *transport, policy guest.Lo // release runs the guest's shutdown — the client key and every loaded // index key wiped inside the instance — and closes the runtime, which // frees the linear memory through the allocator's wipe. It is what Close -// does, and what the cleanup on an unreachable Client does. A module an -// interrupted call or a trap already closed cannot run se_shutdown; the +// does, and what the cleanup on an unreachable Client does. A module a +// stuck call or a trap already closed cannot run se_shutdown; the // runtime close still wipes and frees its memory, so nothing is left // behind either way. func (inst *instance) release() error { diff --git a/languages/golang/encrypt/guest/Cargo.lock b/languages/golang/encrypt/guest/Cargo.lock index 88e3723f7..a5bb1941d 100644 --- a/languages/golang/encrypt/guest/Cargo.lock +++ b/languages/golang/encrypt/guest/Cargo.lock @@ -338,15 +338,17 @@ dependencies = [ [[package]] name = "cllw-ore" -version = "0.5.0" +version = "0.5.2-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "476f300d37a5029d3d9dd57145d4db50a23f40ae9b4d1374c44543978b906191" +checksum = "24eb4a774d070a6c2b52175b98273cd7193c61e1bda39c1a98b50b7a2d91375a" dependencies = [ "blake3", "hex", "subtle", "thiserror 1.0.69", "unicode-normalization", + "vitaminc-ore", + "vitaminc-protected 0.6.1", "zeroize", ] @@ -484,7 +486,7 @@ dependencies = [ "url", "utoipa", "uuid", - "vitaminc", + "vitaminc 0.5.1", ] [[package]] @@ -709,8 +711,7 @@ dependencies = [ "stack-encrypt", "thiserror 2.0.20", "ts-rs", - "vitaminc-aead-value", - "vitaminc-prf", + "vitaminc-aead 0.6.1", "zeroize", ] @@ -1486,6 +1487,15 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -2055,8 +2065,8 @@ dependencies = [ "tracing", "url", "uuid", - "vitaminc", - "vitaminc-protected", + "vitaminc 0.6.1", + "vitaminc-protected 0.6.1", "web-time", "zeroize", "zerokms-protocol", @@ -2064,7 +2074,7 @@ dependencies = [ [[package]] name = "stack-encrypt" -version = "0.2.0" +version = "0.3.0" dependencies = [ "base64ct", "cllw-ore", @@ -2075,18 +2085,20 @@ dependencies = [ "stack-kms", "thiserror 1.0.69", "uuid", - "vitaminc-aead", - "vitaminc-aead-value", - "vitaminc-encrypt", + "vitaminc-aead 0.6.1", + "vitaminc-aead-frame", + "vitaminc-encrypt 0.6.1", "vitaminc-hmac", + "vitaminc-normalize", + "vitaminc-ore", "vitaminc-prf", - "vitaminc-protected", + "vitaminc-protected 0.6.1", "zeroize", ] [[package]] name = "stack-encrypt-derive" -version = "0.2.0" +version = "0.3.0" dependencies = [ "proc-macro2", "quote", @@ -2109,8 +2121,9 @@ dependencies = [ "stack-guest-abi", "stack-kms", "uuid", - "vitaminc-aead-value", - "vitaminc-protected", + "vitaminc-aead 0.6.1", + "vitaminc-aead-frame", + "vitaminc-protected 0.6.1", "zeroize", "zerokms-protocol", ] @@ -2122,8 +2135,9 @@ dependencies = [ "miette", "serde_json", "thiserror 1.0.69", - "vitaminc-aead-value", - "vitaminc-protected", + "vitaminc-aead 0.6.1", + "vitaminc-aead-frame", + "vitaminc-protected 0.6.1", "zeroize", ] @@ -2149,8 +2163,8 @@ dependencies = [ "tracing", "url", "uuid", - "vitaminc", - "vitaminc-protected", + "vitaminc 0.6.1", + "vitaminc-protected 0.6.1", "zeroize", "zerokms-protocol", ] @@ -2357,6 +2371,36 @@ dependencies = [ "syn 3.0.4", ] +[[package]] +name = "toml_datetime" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.25.17+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3641d5bbb5349a79e1020a242d251efbc546ad8048d133958323ce9c40a9c9c" +dependencies = [ + "indexmap", + "toml_datetime", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.1.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c" +dependencies = [ + "winnow", +] + [[package]] name = "tracing" version = "0.1.44" @@ -2424,6 +2468,12 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +[[package]] +name = "unicode-general-category" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b993bddc193ae5bd0d623b49ec06ac3e9312875fdae725a975c51db1cc1677f" + [[package]] name = "unicode-ident" version = "1.0.24" @@ -2573,12 +2623,26 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35042fb7a81d72dc43c53fec835e61027f18b4d01cc0f7e12d6c6a6ffbf3bfb9" dependencies = [ - "vitaminc-aead", - "vitaminc-context", - "vitaminc-encrypt", - "vitaminc-protected", - "vitaminc-random", - "vitaminc-traits", + "vitaminc-aead 0.5.1", + "vitaminc-context 0.5.1", + "vitaminc-encrypt 0.5.1", + "vitaminc-protected 0.5.1", + "vitaminc-random 0.5.1", + "vitaminc-traits 0.5.1", +] + +[[package]] +name = "vitaminc" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac5c15b6c25efcb9a6111f7108ab8101947a7bf7e9af3ff6d6a73358a1ace0da" +dependencies = [ + "vitaminc-aead 0.6.1", + "vitaminc-context 0.6.1", + "vitaminc-encrypt 0.6.1", + "vitaminc-protected 0.6.1", + "vitaminc-random 0.6.1", + "vitaminc-traits 0.6.1", ] [[package]] @@ -2589,10 +2653,27 @@ checksum = "62cacd4dae485e98cfe5407e919187a8468dd933ea4234be5115b7d13a30f3c6" dependencies = [ "bytes", "serde", - "vitaminc-aead-derive", - "vitaminc-context", - "vitaminc-protected", - "vitaminc-random", + "vitaminc-aead-derive 0.5.1", + "vitaminc-context 0.5.1", + "vitaminc-protected 0.5.1", + "vitaminc-random 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-aead" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71b8c5c4ced92545dce5fd7cf04581d08210def174cc81475cf227fa2506c5b7" +dependencies = [ + "bytes", + "futures-util", + "serde", + "thiserror 2.0.20", + "vitaminc-aead-derive 0.6.1", + "vitaminc-context 0.6.1", + "vitaminc-protected 0.6.1", + "vitaminc-random 0.6.1", "zeroize", ] @@ -2608,13 +2689,24 @@ dependencies = [ ] [[package]] -name = "vitaminc-aead-value" -version = "0.5.1" +name = "vitaminc-aead-derive" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d78cdadbc6374c3bd7c19fb4d99abca693b96953b18fef8c608efbe092cf3ea" +checksum = "4c546497a972d0f0498f2f8d5f537c514bad82df8662951c63d0c80023808900" dependencies = [ - "vitaminc-aead", - "vitaminc-protected", + "proc-macro2", + "quote", + "syn 3.0.4", +] + +[[package]] +name = "vitaminc-aead-frame" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35992a269bcaa5b201f1938e54bfbf167bfa6fe975d83cbdbdb54c2a363c5ef" +dependencies = [ + "serde", + "vitaminc-aead 0.6.1", "zeroize", ] @@ -2625,7 +2717,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7df52501fe33cdb3ee9e155b5242fac184c037d147e58c96e5143ed011252a8" dependencies = [ "mutants", - "vitaminc-protected", + "vitaminc-protected 0.5.1", +] + +[[package]] +name = "vitaminc-context" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4c4bc2bd9811253eb427657565a45bd4826e2379e93ee1c4d00c808a769882" +dependencies = [ + "mutants", + "vitaminc-protected 0.6.1", ] [[package]] @@ -2636,35 +2738,79 @@ checksum = "9fbd0e1748055e381e02033e08af385de879c4dcf32e0f6739ac0c0cf0c6f13d" dependencies = [ "aes-gcm", "aws-lc-rs", - "vitaminc-aead", - "vitaminc-protected", - "vitaminc-random", + "vitaminc-aead 0.5.1", + "vitaminc-protected 0.5.1", + "vitaminc-random 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-encrypt" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0923694602855b33a296d9af473e282e8096c1cfe1b30b8695d3b6651717fc5" +dependencies = [ + "aes-gcm", + "aws-lc-rs", + "vitaminc-aead 0.6.1", + "vitaminc-protected 0.6.1", + "vitaminc-random 0.6.1", "zeroize", ] [[package]] name = "vitaminc-hmac" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15fe558a5e92d4f2b3f811c5b67d863d9255da5f66d08a71d4f0dd3d0011c563" +checksum = "bd361f626e95cbe770b9d012e4a86c43cfefe4aefb3d5b3ed9339a83085bdc53" dependencies = [ "hmac", "sha2 0.11.0", "vitaminc-prf", - "vitaminc-protected", + "vitaminc-protected 0.6.1", "zeroize", ] +[[package]] +name = "vitaminc-normalize" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "214b2a9d085924c3bc3c91f3ba74238e8848bf54990e5f48f170c71fbacea07a" +dependencies = [ + "thiserror 2.0.20", + "unicode-general-category", + "unicode-normalization", + "vitaminc-aead 0.6.1", + "vitaminc-protected 0.6.1", +] + +[[package]] +name = "vitaminc-ore" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed88c54b5f06f2177ecbfb7666812adf645406f6fb555f4e2f0fd7fa218e71c4" +dependencies = [ + "thiserror 2.0.20", + "unicode-general-category", + "unicode-normalization", + "vitaminc-aead 0.6.1", + "vitaminc-context 0.6.1", + "vitaminc-normalize", + "vitaminc-protected 0.6.1", +] + [[package]] name = "vitaminc-prf" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712d31d46d76b38c6b62deb35f516fc5636a35f90f39c0213d0ca9a052b4400b" +checksum = "c2715cca25006b4656223bc932ab4fd7f70d387aa4ec63a4e2ef33aa8cd2b3a5" dependencies = [ "mutants", "thiserror 2.0.20", - "vitaminc-context", - "vitaminc-protected", + "vitaminc-aead 0.6.1", + "vitaminc-context 0.6.1", + "vitaminc-normalize", + "vitaminc-protected 0.6.1", ] [[package]] @@ -2680,7 +2826,24 @@ dependencies = [ "serde_bytes", "subtle", "thiserror 2.0.20", - "vitaminc-protected-derive", + "vitaminc-protected-derive 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-protected" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1bb76dd473f5aa89b844f92018ebe3041deb8e5390e7061cca4283d959ff855" +dependencies = [ + "bitvec", + "digest 0.11.3", + "libc", + "serde", + "serde_bytes", + "subtle", + "thiserror 2.0.20", + "vitaminc-protected-derive 0.6.1", "zeroize", ] @@ -2695,6 +2858,18 @@ dependencies = [ "syn 3.0.4", ] +[[package]] +name = "vitaminc-protected-derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7478ed160c019059746e75fc613563dcdcd5266d155a34601d29377a1c4afc3" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 3.0.4", +] + [[package]] name = "vitaminc-random" version = "0.5.1" @@ -2705,8 +2880,23 @@ dependencies = [ "getrandom 0.4.3", "rand 0.10.2", "thiserror 2.0.20", - "vitaminc-protected", - "vitaminc-random-derives", + "vitaminc-protected 0.5.1", + "vitaminc-random-derives 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-random" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b477af7c01c3d9ef2647e46952ad3df7f246b3f806b1d4009ee83beecec613a" +dependencies = [ + "chacha20", + "getrandom 0.4.3", + "rand 0.10.2", + "thiserror 2.0.20", + "vitaminc-protected 0.6.1", + "vitaminc-random-derives 0.6.1", "zeroize", ] @@ -2721,6 +2911,17 @@ dependencies = [ "syn 3.0.4", ] +[[package]] +name = "vitaminc-random-derives" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5a0de8da428c6789dc067a578a0462e411099721d616736cf29e1622230c35" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.4", +] + [[package]] name = "vitaminc-traits" version = "0.5.1" @@ -2732,8 +2933,24 @@ dependencies = [ "rmp-serde", "serde", "thiserror 2.0.20", - "vitaminc-protected", - "vitaminc-random", + "vitaminc-protected 0.5.1", + "vitaminc-random 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-traits" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a900f0edcacd49c8557ab54722175869fec66926054a6fbdc53a05069db3c922" +dependencies = [ + "anyhow", + "bytes", + "rmp-serde", + "serde", + "thiserror 2.0.20", + "vitaminc-protected 0.6.1", + "vitaminc-random 0.6.1", "zeroize", ] @@ -2979,6 +3196,15 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winnow" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" +dependencies = [ + "memchr", +] + [[package]] name = "wit-bindgen" version = "0.57.1" diff --git a/languages/golang/encrypt/guest/Cargo.toml b/languages/golang/encrypt/guest/Cargo.toml index ef9814ecf..e39ab37b0 100644 --- a/languages/golang/encrypt/guest/Cargo.toml +++ b/languages/golang/encrypt/guest/Cargo.toml @@ -47,27 +47,27 @@ eql = ["dep:eql-bindings"] # HTTP comes from the host (see `wasm:wasi-check` in the suite root). stack-auth = { path = "../../../../packages/stack-auth", default-features = false } # `dynamic`: the runtime value model this guest speaks — contexts, index -# terms and record plans over `FfiValue`, shared with every other binding. +# terms and record plans read from frames, shared with every other binding. stack-encrypt = { path = "../../../../packages/stack-encrypt", default-features = false, features = ["dynamic"] } # The guest ABI every guest under bindings/go shares: the allocator and # buffer registry (and with them the `se_alloc`/`se_dealloc` exports), the -# packed-result helpers, the status table and the `transport_send` import. +# packed-result helpers, the status table and the step loop. # This crate defines only the exports that are its own. stack-guest-abi = { path = "../../../../packages/stack-guest-abi" } stack-kms = { path = "../../../../packages/stack-kms", default-features = false } # The EQL types, for the `eql` build only. By path, like every other # eql-bindings dependency in the repository: the SQL that stores a payload # and the Rust that emits it must agree (scripts/lint-no-eql-registry-pins.mjs). -eql-bindings = { path = "../../../../packages/eql/crates/eql-bindings", features = ["stack-encrypt"], optional = true } +eql-bindings = { path = "../../../../packages/eql/crates/eql-bindings", features = ["targets"], optional = true } zerokms-protocol = "=0.12.31" -# The FFI codec + `FfiValue` tree, shared with vitaminc's own guest — one -# codec, not a fork. Same vitaminc version stack-encrypt builds against -# (see the comment in packages/stack-encrypt/Cargo.toml). A different -# version here fails at the `FfiValue: Decrypt` bound, since the aead crate -# would be duplicated. -vitaminc-aead-value = "0.5.1" -vitaminc-protected = "0.5.1" +# The transport frame and ciphertext codec, shared with vitaminc's own +# guest — one codec, not a fork. Same vitaminc version stack-encrypt builds +# against (see the comment in packages/stack-encrypt/Cargo.toml). A +# different version here fails at the `ValueFrame: Decrypt` bound, since the +# aead crate would be duplicated. +vitaminc-aead-frame = { version = "0.6.1", features = ["serde"] } +vitaminc-protected = "0.6.1" futures = { version = "0.3", default-features = false, features = ["executor"] } serde = "1" @@ -76,6 +76,8 @@ uuid = "1" zeroize = "1" [dev-dependencies] +# The test tree (`tests/support`) walks values through vitaminc's sinks. +vitaminc-aead = "0.6.1" stack-kms = { path = "../../../../packages/stack-kms", default-features = false, features = ["test-support"] } # For minting a valid client-key fixture in the config tests. recipher = "=0.3.1" diff --git a/languages/golang/encrypt/guest/src/abi.rs b/languages/golang/encrypt/guest/src/abi.rs index 5e5d1c675..2d6e47e52 100644 --- a/languages/golang/encrypt/guest/src/abi.rs +++ b/languages/golang/encrypt/guest/src/abi.rs @@ -6,25 +6,42 @@ //! //! - **Every export handed plaintext wipes that buffer in place before it //! returns**, rather than leaving it for `se_dealloc`: [`se_cipher_init`] -//! (the config carries the client key), and [`se_term`], [`se_query`] and -//! [`se_encrypt_record`] (their value/source buffers). The host's plaintext therefore lives no longer +//! (the config carries the client key), and [`se_term`], +//! [`se_query_term`], [`se_verify`] and [`se_encrypt_record`] (their +//! value, source and input buffers, and [`se_verify`]'s page of decrypted +//! values). The host's plaintext therefore lives no longer //! than the call, instead of until the host gets round to releasing it. //! **A host must not read a plaintext input buffer back after the call, or //! pass the same buffer to two calls** — it will be zeros. Option, context, //! AAD and plan buffers are not secret and are left untouched. //! - Output buffers from the decrypt exports contain plaintext; the host must //! copy them out and immediately `se_dealloc` (which zeroizes). +//! - **The guest never waits on the network: it steps.** An export that can +//! reach ZeroKMS ([`se_cipher_init`], [`se_keyset`], [`se_term`], +//! [`se_encrypt_record`], [`se_decrypt_record`], [`se_query_term`]) runs +//! its work as a future, polled once. Done, it returns its output as +//! always. Waiting on a request, it returns `STATUS_NEEDS_IO` instead: the +//! host takes the paused operation's handle and requests with [`se_io`], +//! performs them, and hands the responses to [`se_resume`], which returns +//! the same three ways; or it gives up with [`se_abort`] +//! (`stack_guest_abi::step`, and [`crate::io`] for the wire form). Several +//! operations may be paused at once, each under its own handle. A paused +//! operation owns its inputs — the plaintext among them, wiped when it +//! ends or is aborted — so a host's input buffers are free once the +//! export returns, paused or not. A host reads a step's requests (and a +//! failure's `se_last_error`) before it steps another operation. //! - **One instance is one client.** [`se_cipher_init`] runs once per //! instance: it builds the //! `StackCipher>` (one -//! `load-keyset` round trip through the host transport for the default +//! `load-keyset` round trip, through the step loop, for the default //! keyset) and returns that keyset's id. There is no cipher handle: the //! keysets a client uses are selected per call through the options object //! ([`crate::options`]), loaded on first use through the cipher's own //! cache. Nothing crosses the boundary that the host could allocate, //! alias or free. -//! - [`se_shutdown`] is the one lifetime call: it drops the cipher (client -//! key and every loaded index key wiped by `ZeroizeOnDrop`) and wipes +//! - [`se_shutdown`] is the one lifetime call: it drops every paused +//! operation, then the cipher (client +//! key and every loaded index key wiped by `ZeroizeOnDrop`), and wipes //! every buffer the registry still holds. It exists because closing a //! wasm instance frees linear memory without running Rust destructors — //! without it, key material would sit in freed host memory. After it, a @@ -35,10 +52,10 @@ //! [`se_shutdown`] is a no-op, and a *malformed* call is //! `STATUS_ENCODING` in any state, because validation runs first (see //! below). -//! - During an entry-point call the host's imported functions may re-enter -//! the guest **only** through `se_alloc` (to place the transport response -//! / token); calling any other export from inside a host import is -//! undefined behaviour of the embedding, not of this module. +//! - During an entry-point call the host's imported function may re-enter +//! the guest **only** through `se_alloc` (to place the token); calling any +//! other export from inside a host import is undefined behaviour of the +//! embedding, not of this module. //! - **Every export runs through `stack_guest_abi::abi::export`**, so a //! failure leaves its full error for `se_last_error`: the code, message, //! help and fields of the `stack_encrypt`, `stack_kms` or `stack_auth` @@ -52,8 +69,9 @@ //! fields, so their contexts must be non-empty (`STATUS_ENCODING` //! otherwise): each is a [`stack_encrypt::NonEmpty`] from the moment it is //! parsed, and the sealing and opening sides bind that one value. -//! [`se_plan_check`] and [`se_targets`] answer the Go generator's questions -//! and need no cipher. +//! [`se_plan_check`], [`se_targets`] and [`se_operators`] answer the Go +//! generator's questions and need no cipher; nor do [`se_verify`] and [`se_target_limit`], a +//! probabilistic query's two questions, which use no key. //! //! Every export decodes and validates *all* of its inputs — the operation //! payload, the plan or context, the term kind, the value against the @@ -66,24 +84,25 @@ //! inside the call, after every check. //! //! Wasm modules are single-threaded; the host must serialize calls into one -//! instance. +//! instance. Between calls it may interleave steps of different operations. use std::cell::{Cell, RefCell}; use std::panic::{catch_unwind, AssertUnwindSafe}; +use std::rc::Rc; -use futures::executor::block_on; -use stack_encrypt::{KeysetCipher, StackCipher}; +use stack_encrypt::StackCipher; use stack_guest_abi::abi::{export, input, take_plaintext, wipe_input}; use stack_guest_abi::buffers; +use stack_guest_abi::call; use stack_guest_abi::last_error::{self, malformed, out_of_order}; -use vitaminc_aead_value::transport as codec; -use vitaminc_aead_value::FfiValue; +use stack_guest_abi::status::STATUS_NEEDS_IO; +use stack_guest_abi::step::{self, Operation, Step}; +use crate::io; use crate::ops; use crate::options::{parse_options, parse_selector, scope_for, KeysetSelector, Side}; #[cfg(not(feature = "deterministic-kms"))] use crate::status::STATUS_INTERNAL; -use stack_encrypt::dynamic::Scope; #[cfg(not(feature = "deterministic-kms"))] use stack_encrypt::ErrorPayload; @@ -101,63 +120,51 @@ type GuestCipher = StackCipher; thread_local! { // Wasm is single-threaded, so a thread-local `RefCell` is a plain owner - // of the cipher — no `Send`/`Sync` bounds required. - static CIPHER: RefCell> = const { RefCell::new(None) }; + // of the cipher — no `Send`/`Sync` bounds required. Paused operations + // share it through the `Rc`, so their handles are dropped before it at + // shutdown, and the last owner wipes it. + static CIPHER: RefCell>> = const { RefCell::new(None) }; /// Set by `se_shutdown`: after it, `se_cipher_init` is refused too, so /// an instance the host has torn down cannot be quietly revived with /// stale buffers around. static SHUT_DOWN: Cell = const { Cell::new(false) }; + /// Set while an `se_cipher_init` is paused, so a second one is refused + /// before the first has installed its cipher. + static INITIALISING: Cell = const { Cell::new(false) }; } -/// Decode one codec-encoded input. -fn decode(bytes: &[u8]) -> Result { - codec::decode_value(&mut codec::Reader::new(bytes)) - .map_err(|_| malformed("an input is not a value in the transport codec")) -} - -/// Run `f` with the instance's cipher, or report `STATUS_STATE` when there -/// is none (never initialised, or shut down). -fn with_cipher(f: impl FnOnce(&GuestCipher) -> Result) -> Result { - CIPHER.with(|c| { - let c = c.borrow(); - let cipher = c.as_ref().ok_or_else(|| { - out_of_order( - "there is no cipher: call se_cipher_init first, and none after se_shutdown", - ) - })?; - f(cipher) +/// The instance's cipher, or `STATUS_STATE` when there is none (never +/// initialised, still initialising, or shut down). +fn cipher() -> Result, u32> { + CIPHER.with(|c| c.borrow().clone()).ok_or_else(|| { + out_of_order("there is no cipher: call se_cipher_init first, and none after se_shutdown") }) } -/// Run `f` with the keyset the mint-side options in `opts` select, -/// resolving it through the cipher (a first use is one `load-keyset` round -/// trip). The options are decoded and validated before the cipher is -/// consulted. -fn with_keyset( - opts: &[u8], - f: impl FnOnce(&KeysetCipher<'_, GuestKms>) -> Result, -) -> Result { - let options = parse_options(decode(opts)?, Side::Mint)?; - with_cipher(|cipher| { - let keyset = block_on(options.keyset.resolve(cipher))?; - f(&keyset) - }) +/// Turn what came of an operation's step into an export's result: the +/// output when done, `STATUS_NEEDS_IO` with the step registered for +/// [`se_io`] when paused, the status when failed. +fn deliver(step: Result) -> Result, u32> { + match step? { + Step::Done(out) => Ok(out), + Step::NeedsIo { handle, requests } => { + let encoded = io::encode_step(handle, &requests); + drop(requests); + let encoded = encoded.inspect_err(|_| { + let _ = step::abort(handle); + })?; + step::set_pending(encoded); + Err(STATUS_NEEDS_IO) + } + } } -/// Run `f` with the scope the open-side options in `opts` select: the -/// client for `{"any"}`, one keyset's cipher otherwise. -fn with_scope( - opts: &[u8], - f: impl FnOnce(Scope<'_, GuestKms>) -> Result, -) -> Result { - let options = parse_options(decode(opts)?, Side::Open)?; - with_cipher(|cipher| { - let scope = block_on(scope_for(cipher, &options.keyset))?; - f(scope) - }) +/// [`deliver`] an operation's first step. +fn run(work: Operation) -> Result, u32> { + deliver(step::start(work)) } -/// Initialise the instance's cipher from an FFI-codec-encoded config object +/// Initialise the instance's cipher from a config frame /// (see [`crate::config`]). Performs one `load-keyset` round trip through /// the host transport for the default keyset, and returns that keyset's id /// (16 raw UUID bytes) as the output buffer. The raw config buffer — which @@ -180,33 +187,43 @@ pub unsafe extern "C" fn se_cipher_init(cfg_ptr: *mut u8, cfg_len: u32) -> u64 { export(|| { // The pointer/length pair is validated first and on its own: a pair // that fails here returns before anything touches the range, which - // is `wipe_input`'s precondition. Only a validated buffer is decoded - // and, whatever the decode outcome, wiped. + // is `wipe_input`'s precondition. Only a validated buffer is parsed + // and, whatever the outcome, wiped. // SAFETY: host-owned ranges the export was handed; the borrows end // before it returns and before any wipe of an overlapping range. let bytes = unsafe { input(cfg_ptr, cfg_len)? }; - let decoded = decode(bytes); - // The borrow of the raw buffer ends with `decoded` owned; wipe the - // buffer now — it holds the client-key hex — before parsing (and - // before the init round trip), whatever the decode outcome. + // The parser borrows the buffer's strings and owns only what it + // builds from them, so the borrow ends here; wipe the buffer now — + // it holds the client key — before the init round trip, whatever + // the parse outcome. + let config = parse_init(bytes); unsafe { wipe_input(cfg_ptr, cfg_len) }; - cipher_init(decoded?) + cipher_init(config?) }) } #[cfg(not(feature = "deterministic-kms"))] -fn cipher_init(decoded: FfiValue) -> Result, u32> { +use crate::config::{parse_config as parse_init, CipherConfig as InitConfig}; +#[cfg(feature = "deterministic-kms")] +use crate::deterministic::Seed as InitConfig; +#[cfg(feature = "deterministic-kms")] +fn parse_init(bytes: &[u8]) -> Result { + InitConfig::parse(bytes) +} + +#[cfg(not(feature = "deterministic-kms"))] +fn cipher_init(config: InitConfig) -> Result, u32> { use crate::host::{HostTokenStrategy, WasiHostConnection}; use crate::status::STATUS_KMS_TRANSPORT; use stack_kms::{ClientOpts, StackKms}; - let config = crate::config::parse_config(decoded).map_err(|e| malformed(e.describe()))?; - if SHUT_DOWN.with(Cell::get) || CIPHER.with(|c| c.borrow().is_some()) { + if init_refused() { return Err(init_out_of_order()); } - // One request at a time: the host import is synchronous, so concurrency - // would only interleave nothing; keep the executor honest about it. + // One request at a time: a step hands the host one request, and the + // first version of the step loop keeps it that way. Raising it later + // changes no ABI: a step's request list can hold several. // // `max_keys_per_req` stays at the client default (500). That is what // bounds "one ZeroKMS call": a batch is assembled once, then @@ -236,7 +253,16 @@ fn cipher_init(decoded: FfiValue) -> Result, u32> { if let Some(size) = config.keyset_cache_size { builder = builder.keyset_cache_size(size); } - install(block_on(builder.init()).map_err(|e| crate::status::fail_error(&e))?) + let initialising = Initialising::begin(); + run(Box::pin(async move { + let _initialising = initialising; + install( + builder + .init() + .await + .map_err(|e| crate::status::fail_error(&e))?, + ) + })) } /// The `deterministic-kms` build's init: the config buffer is the @@ -244,35 +270,63 @@ fn cipher_init(decoded: FfiValue) -> Result, u32> { /// endpoint, no token, no network. A test artefact, never shipped; see /// [`crate::deterministic`]. #[cfg(feature = "deterministic-kms")] -fn cipher_init(decoded: FfiValue) -> Result, u32> { - use vitaminc_protected::Controlled; - - let not_a_seed = || malformed("the deterministic build's config is a 32-byte seed"); - let FfiValue::Bytes(seed) = decoded else { - return Err(not_a_seed()); - }; - let seed: [u8; 32] = seed - .risky_ref() - .as_slice() - .try_into() - .map_err(|_| not_a_seed())?; - if SHUT_DOWN.with(Cell::get) || CIPHER.with(|c| c.borrow().is_some()) { +fn cipher_init(seed: InitConfig) -> Result, u32> { + if init_refused() { return Err(init_out_of_order()); } - let builder = StackCipher::builder().kms(crate::deterministic::DeterministicSource::new(seed)); - install(block_on(builder.init()).map_err(|e| crate::status::fail_error(&e))?) + let builder = StackCipher::builder().kms(seed.source()); + let initialising = Initialising::begin(); + run(Box::pin(async move { + let _initialising = initialising; + install( + builder + .init() + .await + .map_err(|e| crate::status::fail_error(&e))?, + ) + })) +} + +/// Whether an `se_cipher_init` must be refused: after shutdown, with a +/// cipher installed, or with another init paused. +fn init_refused() -> bool { + SHUT_DOWN.with(Cell::get) + || INITIALISING.with(Cell::get) + || CIPHER.with(|c| c.borrow().is_some()) +} + +/// Marks an init in flight from the moment it starts until its work ends: +/// done, failed or aborted. +struct Initialising; + +impl Initialising { + fn begin() -> Self { + INITIALISING.with(|i| i.set(true)); + Initialising + } +} + +impl Drop for Initialising { + fn drop(&mut self) { + INITIALISING.with(|i| i.set(false)); + } } -/// `se_cipher_init` called a second time, or after `se_shutdown`. +/// `se_cipher_init` called a second time, while one is paused, or after +/// `se_shutdown`. fn init_out_of_order() -> u32 { - out_of_order("the cipher is already initialised, or the instance is shut down") + out_of_order("the cipher is already initialised or initialising, or the instance is shut down") } /// Install the built cipher as the instance's and return its default /// keyset's id. fn install(cipher: GuestCipher) -> Result, u32> { + // A shutdown that overtook a paused init installs nothing. + if SHUT_DOWN.with(Cell::get) { + return Err(init_out_of_order()); + } let default = cipher.default_keyset().keyset_id().as_bytes().to_vec(); - CIPHER.with(|c| *c.borrow_mut() = Some(cipher)); + CIPHER.with(|c| *c.borrow_mut() = Some(Rc::new(cipher))); Ok(default) } @@ -285,16 +339,15 @@ fn install(cipher: GuestCipher) -> Result, u32> { /// is `STATUS_STATE`, [`se_cipher_init`] included; a malformed one is /// `STATUS_ENCODING` first, as in any other state. /// -/// The index keys' wipe holds because each `HmacSha256Prf` clone a -/// derivation takes is created and dropped inside one `block_on`'d call, -/// and the guest is single-threaded, so no clone is alive when the host -/// calls this. That is the precondition, not a property of the drop: -/// anything that later parks a PRF clone beyond an ABI call turns this -/// wipe into a no-op for that key. +/// Every paused operation is dropped first: each holds the cipher, and may +/// hold a PRF clone a derivation took, plaintext, or keys it was handed. +/// Dropping them before the cipher is what makes the cipher's drop the last +/// owner's, and so its wipe real. #[no_mangle] pub extern "C" fn se_shutdown() { let _ = catch_unwind(AssertUnwindSafe(|| { SHUT_DOWN.with(|s| s.set(true)); + step::drop_all(); CIPHER.with(|c| { let _ = c.borrow_mut().take(); }); @@ -317,14 +370,15 @@ pub unsafe extern "C" fn se_keyset(sel_ptr: *const u8, sel_len: u32) -> u64 { export(|| { // SAFETY: host-owned ranges the export was handed; the borrows end // before it returns and before any wipe of an overlapping range. - let selector = parse_selector(decode(unsafe { input(sel_ptr, sel_len)? })?)?; + let selector = parse_selector(unsafe { input(sel_ptr, sel_len)? })?; if selector == KeysetSelector::Any { return Err(malformed(r#"{"any"} is not a keyset"#)); } - with_cipher(|cipher| { - let keyset = block_on(selector.resolve(cipher))?; + let cipher = cipher()?; + run(Box::pin(async move { + let keyset = selector.resolve(&cipher).await?; Ok(keyset.keyset_id().as_bytes().to_vec()) - }) + })) }) } @@ -336,7 +390,7 @@ pub unsafe extern "C" fn se_keyset(sel_ptr: *const u8, sel_len: u32) -> u64 { /// /// The context is one part — a string, bytes, or an `i32`/`i64`/`u32`/`u64` /// — or an array of parts, which may nest as deep as the transport codec -/// allows (`vitaminc_aead_value::transport::MAX_DEPTH` levels, counted from +/// allows (`vitaminc_aead_frame::MAX_DEPTH` levels, counted from /// the root of the encoded value; deeper is refused as `STATUS_ENCODING` /// before the context is parsed). [`stack_encrypt::dynamic::context`] is the one home of /// that grammar and of which Rust context each shape spells. @@ -362,15 +416,17 @@ pub unsafe extern "C" fn se_term( ) -> u64 { export(|| { let value = unsafe { take_plaintext(val_ptr, val_len)? }; - let value = value.as_slice(); // SAFETY: host-owned ranges the export was handed; the borrows end // before it returns and before any wipe of an overlapping range. - let context = unsafe { input(ctx_ptr, ctx_len)? }; + let context = unsafe { input(ctx_ptr, ctx_len)? }.to_vec(); let opts = unsafe { input(opt_ptr, opt_len)? }; - ops::validate::term(value, context, kind)?; - with_keyset(opts, |keyset| { - block_on(ops::term(keyset, value, context, kind)) - }) + ops::validate::term(&value, &context, kind)?; + let options = parse_options(opts, Side::Mint)?; + let cipher = cipher()?; + run(Box::pin(async move { + let keyset = options.keyset.resolve(&cipher).await?; + ops::term(&keyset, &value, &context, kind).await + })) }) } @@ -395,15 +451,17 @@ pub unsafe extern "C" fn se_encrypt_record( ) -> u64 { export(|| { let source = unsafe { take_plaintext(src_ptr, src_len)? }; - let source = source.as_slice(); // SAFETY: host-owned ranges the export was handed; the borrows end // before it returns and before any wipe of an overlapping range. - let plan = unsafe { input(plan_ptr, plan_len)? }; + let plan = unsafe { input(plan_ptr, plan_len)? }.to_vec(); let opts = unsafe { input(opt_ptr, opt_len)? }; - ops::validate::record(source, plan)?; - with_keyset(opts, |keyset| { - block_on(ops::encrypt_record(keyset, source, plan)) - }) + ops::validate::record(&source, &plan)?; + let options = parse_options(opts, Side::Mint)?; + let cipher = cipher()?; + run(Box::pin(async move { + let keyset = options.keyset.resolve(&cipher).await?; + ops::encrypt_record(&keyset, &source, &plan).await + })) }) } @@ -435,14 +493,16 @@ pub unsafe extern "C" fn se_decrypt_record( export(|| { // SAFETY: host-owned ranges the export was handed; the borrows end // before it returns and before any wipe of an overlapping range. - let record = unsafe { input(rec_ptr, rec_len)? }; - let plan = unsafe { input(plan_ptr, plan_len)? }; + let record = unsafe { input(rec_ptr, rec_len)? }.to_vec(); + let plan = unsafe { input(plan_ptr, plan_len)? }.to_vec(); let opts = unsafe { input(opt_ptr, opt_len)? }; - let expected = parse_options(decode(opts)?, Side::Open)?.context; - ops::validate::record_tree(record, plan, expected.as_ref())?; - with_scope(opts, |scope| { - block_on(ops::decrypt_record(scope, record, plan, expected)) - }) + let options = parse_options(opts, Side::Open)?; + ops::validate::record_tree(&record, &plan, options.context.as_ref())?; + let cipher = cipher()?; + run(Box::pin(async move { + let scope = scope_for(&cipher, &options.keyset).await?; + ops::decrypt_record(scope, &record, &plan, options.context).await + })) }) } @@ -465,39 +525,125 @@ pub unsafe extern "C" fn se_plan_check(plan_ptr: *const u8, plan_len: u32) -> u6 }) } -/// Derive the EQL query value of one target field under the keyset `opts` -/// selects: a codec-encoded plaintext, the codec-encoded plan and the -/// field's name (UTF-8 bytes) in, the query value's JSON bytes out -/// ([`ops::query`]). The plan is parsed against this build's resolver, so -/// a build without EQL types refuses it as `STATUS_ENCODING` before the -/// cipher is consulted, as it refuses the same plan at [`se_plan_check`]. +/// Derive the query term for one plan field, an operator and its input +/// under the keyset `opts` selects ([`ops::query_term`]): a codec-encoded +/// input (one value, or for `between` a list of two), the codec-encoded +/// plan, and the field's and the operator's names (UTF-8 bytes) in; the +/// term's codec-encoded object out. An operator the field does not answer +/// is `STATUS_ENCODING` naming the field, as a mistyped value is, before +/// the cipher is consulted; the refusals the typed path makes before a term +/// exists (match text that cuts no token or does not normalize) are +/// `STATUS_TERM`, also before the cipher. A range the wrong way round is +/// not refused: it matches no row, as SQL's `BETWEEN` does. The input +/// buffer is wiped in place. /// /// # Safety /// /// As for [`se_term`]. #[no_mangle] -pub unsafe extern "C" fn se_query( +pub unsafe extern "C" fn se_query_term( val_ptr: *mut u8, val_len: u32, plan_ptr: *const u8, plan_len: u32, field_ptr: *const u8, field_len: u32, + op_ptr: *const u8, + op_len: u32, opt_ptr: *const u8, opt_len: u32, ) -> u64 { export(|| { let value = unsafe { take_plaintext(val_ptr, val_len)? }; - let value = value.as_slice(); // SAFETY: host-owned ranges the export was handed; the borrows end // before it returns and before any wipe of an overlapping range. + let plan = unsafe { input(plan_ptr, plan_len)? }.to_vec(); + let field = unsafe { input(field_ptr, field_len)? }.to_vec(); + let operator = unsafe { input(op_ptr, op_len)? }.to_vec(); + let opts = unsafe { input(opt_ptr, opt_len)? }; + ops::validate::query_term(&value, &plan, &field, &operator)?; + let options = parse_options(opts, Side::Mint)?; + let cipher = cipher()?; + run(Box::pin(async move { + let keyset = options.keyset.resolve(&cipher).await?; + ops::query_term(&keyset, &value, &plan, &field, &operator).await + })) + }) +} + +/// Verify a page of decrypted values against a probabilistic query +/// ([`ops::verify`]): the query's codec-encoded input and a codec-encoded +/// list of values, the codec-encoded plan, and the field's and the +/// operator's names in; a codec-encoded list of booleans out, one per value. +/// Both plaintext buffers, the input and the values, are wiped in place. An +/// exact operator has nothing to verify and is `STATUS_ENCODING`. Needs no +/// cipher: it works in every instance state, as [`se_plan_check`] does. +/// +/// # Safety +/// +/// As for [`se_term`]. +#[no_mangle] +pub unsafe extern "C" fn se_verify( + in_ptr: *mut u8, + in_len: u32, + vals_ptr: *mut u8, + vals_len: u32, + plan_ptr: *const u8, + plan_len: u32, + field_ptr: *const u8, + field_len: u32, + op_ptr: *const u8, + op_len: u32, +) -> u64 { + export(|| { + // Both buffers are taken, and so wiped, before either result is + // acted on: a bad query pointer must not leave the page of + // decrypted values unwiped behind an early return. + let query = unsafe { take_plaintext(in_ptr, in_len) }; + let values = unsafe { take_plaintext(vals_ptr, vals_len) }; + let (query, values) = (query?, values?); + // SAFETY: host-owned ranges the export was handed; the borrows end + // before it returns. let plan = unsafe { input(plan_ptr, plan_len)? }; let field = unsafe { input(field_ptr, field_len)? }; - let opts = unsafe { input(opt_ptr, opt_len)? }; - ops::validate::query(value, plan, field)?; - with_keyset(opts, |keyset| { - block_on(ops::query(keyset, value, plan, field)) - }) + let operator = unsafe { input(op_ptr, op_len)? }; + ops::verify(query.as_slice(), values.as_slice(), plan, field, operator) + }) +} + +/// How many rows a probabilistic query should fetch for `want` of them to +/// verify ([`ops::target_limit`]): the term's bytes as [`se_query_term`] +/// returned them, the codec-encoded statistics, the codec-encoded plan, +/// and the field's and the operator's names in, with `want`; the +/// codec-encoded limit out, an unsigned integer or null. An exact operator +/// has no fetch to size and is `STATUS_ENCODING`. Needs no cipher. +/// +/// # Safety +/// +/// As for [`se_term`]. +#[no_mangle] +pub unsafe extern "C" fn se_target_limit( + term_ptr: *const u8, + term_len: u32, + stats_ptr: *const u8, + stats_len: u32, + plan_ptr: *const u8, + plan_len: u32, + field_ptr: *const u8, + field_len: u32, + op_ptr: *const u8, + op_len: u32, + want: u64, +) -> u64 { + export(|| { + // SAFETY: host-owned ranges the export was handed; the borrows end + // before it returns. + let term = unsafe { input(term_ptr, term_len)? }; + let stats = unsafe { input(stats_ptr, stats_len)? }; + let plan = unsafe { input(plan_ptr, plan_len)? }; + let field = unsafe { input(field_ptr, field_len)? }; + let operator = unsafe { input(op_ptr, op_len)? }; + ops::target_limit(term, stats, plan, field, operator, want) }) } @@ -508,3 +654,74 @@ pub unsafe extern "C" fn se_query( pub extern "C" fn se_targets() -> u64 { export(ops::targets) } + +/// The operators one plan field answers ([`ops::operators`]): the +/// codec-encoded plan and the field's name (UTF-8 bytes) in, a codec-encoded +/// list of operator objects out. A field the plan does not have is +/// `STATUS_ENCODING`. Needs no cipher: it works in every instance state, as +/// [`se_plan_check`] does. +/// +/// # Safety +/// +/// As for [`se_term`]. +#[no_mangle] +pub unsafe extern "C" fn se_operators( + plan_ptr: *const u8, + plan_len: u32, + field_ptr: *const u8, + field_len: u32, +) -> u64 { + export(|| { + // SAFETY: host-owned ranges the export was handed; the borrows end + // before they return. + let plan = unsafe { input(plan_ptr, plan_len)? }; + let field = unsafe { input(field_ptr, field_len)? }; + ops::operators(plan, field) + }) +} + +/// The step a paused export left: its handle and the requests it waits on, +/// as a packed buffer ([`crate::io`]), handed over once — the slot is +/// emptied, so a second call returns zero, as does a call with no step +/// waiting. The host calls it after `STATUS_NEEDS_IO`, before it runs any +/// other export, copies the buffer out and releases it with `se_dealloc` +/// (which wipes it: it carries the bearer token). +#[no_mangle] +pub extern "C" fn se_io() -> u64 { + match step::take_pending() { + Some((ptr, len)) => call::pack_buffer(ptr as usize as u32, len as u32), + None => 0, + } +} + +/// Hand a paused operation the responses to the requests its last step +/// asked for ([`crate::io`] has the frame), and run its next step. Returns +/// as the export that started it does: the output when done, +/// `STATUS_NEEDS_IO` when paused again (under the same handle), or the +/// status of its failure. The responses buffer can carry wrapped keys and +/// is wiped in place. A handle that names no paused operation is +/// `STATUS_STATE`; responses that do not decode, or are not one per +/// request, are `STATUS_ENCODING`, and the operation is dropped. +/// +/// # Safety +/// +/// As for [`se_term`]. +#[no_mangle] +pub unsafe extern "C" fn se_resume(handle: u64, resp_ptr: *mut u8, resp_len: u32) -> u64 { + export(|| { + let bytes = unsafe { take_plaintext(resp_ptr, resp_len) }; + let responses = bytes.and_then(|bytes| io::decode_responses(&bytes)); + let responses = responses.inspect_err(|_| { + let _ = step::abort(handle); + })?; + deliver(step::resume(handle, responses)) + }) +} + +/// Give up on a paused operation: drop it, wiping everything it held. An +/// empty output; `STATUS_STATE` for a handle that names no paused +/// operation (one that finished, failed or was aborted). +#[no_mangle] +pub extern "C" fn se_abort(handle: u64) -> u64 { + export(|| step::abort(handle).map(|()| Vec::new())) +} diff --git a/languages/golang/encrypt/guest/src/config.rs b/languages/golang/encrypt/guest/src/config.rs index 800461444..a08f576ce 100644 --- a/languages/golang/encrypt/guest/src/config.rs +++ b/languages/golang/encrypt/guest/src/config.rs @@ -1,8 +1,8 @@ //! Parsing of the `se_cipher_init` configuration. //! -//! The config crosses the boundary as one FFI-codec-encoded -//! [`FfiValue::Object`] — the same codec every other entry point uses, so -//! there is no second config format. Recognised keys (all string values): +//! The config crosses the boundary as one frame object, read by serde +//! (`vitaminc_aead_frame::serde`), the same format as every other control +//! message. Recognised keys (all string values): //! //! | key | required | meaning | //! |---------------|----------|---------| @@ -17,60 +17,26 @@ //! Every other keyset is selected per call (see [`crate::options`]). Unknown //! keys are rejected — a typo'd optional key must not silently fall back to a //! default — so a host still sending `keyset` is told so rather than quietly -//! encrypting somewhere else. +//! encrypting somewhere else. A key given twice is refused by the frame. //! -//! The parsed [`FfiValue`] holds the client-key hex inside -//! `Protected`, which wipes on drop; the raw config *buffer* is wiped by the -//! ABI layer immediately after decoding (see [`crate::abi`]). +//! Every string is borrowed from the config buffer, so the only copy of the +//! client key this parser makes is the [`ClientKey`] it builds. The ABI +//! layer wipes the buffer as soon as [`parse_config`] returns (see +//! [`crate::abi`]). +//! +//! A refusal is [`STATUS_ENCODING`](crate::status::STATUS_ENCODING), with a +//! message that names the key at fault and never a value, because the +//! config holds the client key. An unrecognised key is not named either: +//! if a value is pasted where a key should be, the unrecognised key *is* +//! that value. use std::num::NonZeroUsize; +use serde::{Deserialize, Deserializer}; +use stack_guest_abi::last_error::malformed; use stack_kms::{ClientKey, ZeroKmsEndpoint}; use uuid::Uuid; -use vitaminc_aead_value::FfiValue; -use zeroize::Zeroizing; - -/// A parse failure, carrying which key was at fault. Maps to -/// `STATUS_ENCODING` at the ABI, and [`describe`](Self::describe) is the -/// message the host reads through `se_last_error`: the name of the key at -/// fault crosses the boundary, its value never does. -#[derive(Debug, PartialEq, Eq)] -pub enum ConfigError { - /// The config was not an object of string values. - NotAnObject, - /// A required key was absent. - Missing(&'static str), - /// A key held something other than a string. - NotAString(&'static str), - /// A key's value failed its own validation (bad UUID, bad hex, bad URL). - Invalid(&'static str), - /// A key appeared twice. The codec rejects duplicate object keys before - /// this parser runs, but `parse_config` is `pub` and takes any - /// [`FfiValue`] — last-write-wins on, say, `client_key` must never be - /// silent. - Duplicate(&'static str), - /// A key this version does not recognise. - UnknownKey(String), -} - -impl ConfigError { - /// Says what was wrong with the config, for the host to read. - /// - /// The message names the key at fault but never its value, because the - /// config holds the client key. An unrecognised key is not named - /// either: if a value is pasted where a key should be, the unrecognised - /// key *is* that value. - pub fn describe(&self) -> String { - match self { - Self::NotAnObject => "the config is not an object of string values".to_owned(), - Self::Missing(key) => format!("the config has no {key}"), - Self::NotAString(key) => format!("the config's {key} is not a string"), - Self::Invalid(key) => format!("the config's {key} is not valid"), - Self::Duplicate(key) => format!("the config gives {key} twice"), - Self::UnknownKey(_) => "the config has a key this version does not know".to_owned(), - } - } -} +use vitaminc_aead_frame::serde::from_slice; /// Everything `se_cipher_init` needs to build the cipher. pub struct CipherConfig { @@ -79,93 +45,93 @@ pub struct CipherConfig { pub keyset_cache_size: Option, } -/// Parse a decoded config value. Consumes it so the client-key material has -/// one owner; the `Protected` payloads are wiped when the strings drop here. -pub fn parse_config(value: FfiValue) -> Result { - let FfiValue::Object(entries) = value else { - return Err(ConfigError::NotAnObject); - }; +/// Parse the config frame a host sent. See the [module docs](self). +pub fn parse_config(bytes: &[u8]) -> Result { + read(bytes).map_err(malformed) +} - // Every slot is a `Zeroizing`, not just the key one: the - // client-key slot *must* wipe on every exit path (any of the `?`s below - // can fire while it holds a full encoding of the client root key), and - // making one slot special invites the next edit to add an early return - // above the wipe. Uniform is cheaper than remembering. - let mut client_id: Option> = None; - let mut client_key_encoded: Option> = None; - let mut url: Option> = None; - let mut cache_size: Option> = None; +/// [`parse_config`], with the refusal's message. +fn read(bytes: &[u8]) -> Result { + let wire: Wire<'_> = from_slice(bytes).map_err(|e| format!("the config: {e}"))?; + // `from_encoded_v1` is lenient by design: hex in either case *or* the + // base64 `secretkey.json` holds, matching every native loader. + let client_key = ClientKey::from_encoded_v1(wire.client_id.0, wire.client_key) + .map_err(|_| "the config: client_key: a client key that is not valid".to_owned())?; + Ok(CipherConfig { + client_key, + endpoint: wire.zerokms_url.map(|url| url.0), + keyset_cache_size: wire.keyset_cache_size.map(|size| size.0), + }) +} - for (key, value) in entries { - let slot = match key.as_str() { - "client_id" => &mut client_id, - "client_key" => &mut client_key_encoded, - "zerokms_url" => &mut url, - "keyset_cache_size" => &mut cache_size, - _ => return Err(ConfigError::UnknownKey(key)), - }; - // The codec already rejects duplicate object keys, so on the ABI - // path the slot is always vacant — but this function accepts any - // `FfiValue`, so enforce it rather than assume it. - if slot.is_some() { - return Err(ConfigError::Duplicate(name_of(&key))); - } - let FfiValue::String(s) = value else { - return Err(ConfigError::NotAString(name_of(&key))); - }; - let text = Zeroizing::new( - std::str::from_utf8(s.risky_ref()) - .map_err(|_| ConfigError::NotAString(name_of(&key)))? - .to_string(), - ); - *slot = Some(text); - } +/// The config as a host writes it. Each field validates as it reads, +/// through `TryFrom`. The frame's serde never repeats a `TryFrom` error's +/// text (it could carry the value), so a refusal names the key and says +/// only that its value was not accepted; each error here is still a fixed +/// string, for the reader. +#[derive(Deserialize)] +#[serde(deny_unknown_fields)] +struct Wire<'a> { + client_id: ClientId, + client_key: &'a str, + #[serde(default, deserialize_with = "present")] + zerokms_url: Option, + #[serde(default, deserialize_with = "present")] + keyset_cache_size: Option, +} - let client_id = client_id.ok_or(ConfigError::Missing("client_id"))?; - let client_id = Uuid::parse_str(&client_id).map_err(|_| ConfigError::Invalid("client_id"))?; +/// Absent is `None`. Present, a value must be a string: a null is refused. +fn present<'de, D: Deserializer<'de>, T: Deserialize<'de>>(d: D) -> Result, D::Error> { + T::deserialize(d).map(Some) +} - // Lenient by design: `from_encoded_v1` takes hex in either case *or* the - // base64 `secretkey.json` holds, matching every native loader. The - // `Zeroizing` slot wipes the encoded copy however this returns — the - // decoded `FfiValue`'s own copy was consumed above, and the raw input - // buffer is the ABI layer's to wipe. - let client_key_encoded = client_key_encoded.ok_or(ConfigError::Missing("client_key"))?; - let client_key = ClientKey::from_encoded_v1(client_id, &client_key_encoded) - .map_err(|_| ConfigError::Invalid("client_key"))?; +/// A client id: a UUID, as text. +#[derive(Deserialize)] +#[serde(try_from = "&str")] +struct ClientId(Uuid); - let endpoint = url - .map(|u| u.parse().map_err(|_| ConfigError::Invalid("zerokms_url"))) - .transpose()?; +impl TryFrom<&str> for ClientId { + type Error = &'static str; - let keyset_cache_size = cache_size - .map(|n| { - n.parse::() - .map_err(|_| ConfigError::Invalid("keyset_cache_size")) - }) - .transpose()?; + fn try_from(text: &str) -> Result { + Uuid::parse_str(text) + .map(ClientId) + .map_err(|_| "a client id that is not a UUID") + } +} - Ok(CipherConfig { - client_key, - endpoint, - keyset_cache_size, - }) +/// The ZeroKMS endpoint to pin. +#[derive(Deserialize)] +#[serde(try_from = "&str")] +struct Url(ZeroKmsEndpoint); + +impl TryFrom<&str> for Url { + type Error = &'static str; + + fn try_from(text: &str) -> Result { + text.parse().map(Url).map_err(|_| "a URL that is not valid") + } } -/// Intern the key name for error reporting (`&'static str` keeps -/// [`ConfigError`] cheap; unknown keys carry the owned string instead). -fn name_of(key: &str) -> &'static str { - match key { - "client_id" => "client_id", - "client_key" => "client_key", - "zerokms_url" => "zerokms_url", - "keyset_cache_size" => "keyset_cache_size", - _ => "unknown", +/// A positive integer, as a decimal string. +#[derive(Deserialize)] +#[serde(try_from = "&str")] +struct CacheSize(NonZeroUsize); + +impl TryFrom<&str> for CacheSize { + type Error = &'static str; + + fn try_from(text: &str) -> Result { + text.parse() + .map(CacheSize) + .map_err(|_| "a size that is not a positive decimal integer") } } #[cfg(test)] mod tests { use super::*; + use crate::test_frame::{frame, obj, s, V}; /// A valid v1 client key for fixtures, minted through the real key type /// so the hex exercises the actual `from_hex_v1` decoder. @@ -178,22 +144,27 @@ mod tests { (id, key.to_hex_v1().expect("encode fixture key")) } - fn obj(entries: Vec<(&str, &str)>) -> FfiValue { - FfiValue::Object( - entries - .into_iter() - .map(|(k, v)| (k.to_string(), FfiValue::String(v.into()))) - .collect(), - ) + fn config(entries: Vec<(&'static str, V)>) -> Result { + read(&frame(&obj(entries))) + } + + /// The config's refusal, checked to name neither the client key nor any + /// value or unknown key the test sent. + fn refused(v: &V, secrets: &[&str]) -> String { + let message = read(&frame(v)).err().expect("refused"); + for secret in secrets { + assert!(!message.contains(secret), "{message:?} echoes {secret:?}"); + } + message } #[test] fn parses_a_minimal_config() { let (id, hex) = client_key_hex(); - let cfg = parse_config(obj(vec![ - ("client_id", &id.to_string()), - ("client_key", &hex), - ])) + let cfg = config(vec![ + ("client_id", s(&id.to_string())), + ("client_key", s(&hex)), + ]) .expect("minimal config parses"); assert_eq!(cfg.client_key.key_id, id); assert!(cfg.endpoint.is_none()); @@ -203,28 +174,27 @@ mod tests { #[test] fn parses_the_keyset_cache_size() { let (id, hex) = client_key_hex(); - let id_s = id.to_string(); - let cfg = parse_config(obj(vec![ - ("client_id", &id_s), - ("client_key", &hex), - ("keyset_cache_size", "16"), - ])) - .expect("config parses"); + let with = |size: V| { + obj(vec![ + ("client_id", s(&id.to_string())), + ("client_key", s(&hex)), + ("keyset_cache_size", size), + ]) + }; + let cfg = read(&frame(&with(s("16")))).expect("config parses"); assert_eq!(cfg.keyset_cache_size, NonZeroUsize::new(16)); for bad in ["0", "-1", "sixteen", ""] { - assert!( - matches!( - parse_config(obj(vec![ - ("client_id", &id_s), - ("client_key", &hex), - ("keyset_cache_size", bad), - ])), - Err(ConfigError::Invalid("keyset_cache_size")) - ), + assert_eq!( + refused(&with(s(bad)), &[&hex]), + "the config: keyset_cache_size: a value its type does not accept", "{bad:?} must be refused" ); } + // A decimal string, not an integer, and not null. + for bad in [V::U32(16), V::Null] { + assert!(refused(&with(bad), &[&hex]).starts_with("the config: keyset_cache_size: ")); + } } /// A keyset is not a config key: the default is the server's and a @@ -235,25 +205,27 @@ mod tests { fn a_keyset_key_is_rejected_like_any_other_unknown_key() { let (id, hex) = client_key_hex(); for key in ["keyset", "keyset_id"] { - assert!(matches!( - parse_config(obj(vec![ - ("client_id", &id.to_string()), - ("client_key", &hex), - (key, "users"), - ])), - Err(ConfigError::UnknownKey(_)) - )); + let message = refused( + &obj(vec![ + ("client_id", s(&id.to_string())), + ("client_key", s(&hex)), + (key, s("users")), + ]), + // "keyset" alone is inside the expected `keyset_cache_size`. + &[&hex, "users", "keyset_id"], + ); + assert!(message.contains("an unknown key"), "{message}"); } } #[test] fn parses_the_zerokms_url() { let (id, hex) = client_key_hex(); - let cfg = parse_config(obj(vec![ - ("client_id", &id.to_string()), - ("client_key", &hex), - ("zerokms_url", "https://zerokms.example.com"), - ])) + let cfg = config(vec![ + ("client_id", s(&id.to_string())), + ("client_key", s(&hex)), + ("zerokms_url", s("https://zerokms.example.com")), + ]) .expect("config parses"); assert!(cfg.endpoint.is_some()); } @@ -266,7 +238,6 @@ mod tests { use base64ct::Encoding; let (id, hex) = client_key_hex(); - let id_s = id.to_string(); let bytes = base16ct::lower::decode_vec(&hex).expect("fixture hex"); let base64 = base64ct::Base64::encode_string(&bytes); @@ -275,8 +246,11 @@ mod tests { ("uppercase hex", hex.to_uppercase()), ("base64", base64), ] { - let cfg = parse_config(obj(vec![("client_id", &id_s), ("client_key", &encoded)])) - .unwrap_or_else(|e| panic!("{label} must parse, got {e:?}")); + let cfg = config(vec![ + ("client_id", s(&id.to_string())), + ("client_key", s(&encoded)), + ]) + .unwrap_or_else(|e| panic!("{label} must parse, got {e}")); assert_eq!(cfg.client_key.key_id, id, "{label}"); assert_eq!( cfg.client_key.to_hex_v1().expect("re-encode"), @@ -286,57 +260,96 @@ mod tests { } } + /// Every refusal names the key at fault and never a value: not the + /// client key, not a bad id or URL, not an unknown key. #[test] - fn rejects_bad_configs() { + fn rejects_bad_configs_without_echoing_a_value() { let (id, hex) = client_key_hex(); let id_s = id.to_string(); + let secrets = [ + hex.as_str(), + "nope", + "zerokms_urk", + "typo.example", + "deadbeef", + ]; + let cases = [ + (V::Null, "the config: expected "), + ( + V::Arr(vec![s(&id_s), s(&hex)]), + "the config: expected struct Wire, found an array", + ), + ( + obj(vec![ + ("client_id", s(&id_s)), + ("client_key", V::Bytes(hex.clone().into_bytes())), + ]), + "the config: client_key: expected a borrowed string, found bytes", + ), + ( + obj(vec![("client_id", s(&id_s))]), + "the config: missing field `client_key`", + ), + ( + obj(vec![("client_id", s("nope")), ("client_key", s(&hex))]), + "the config: client_id: a value its type does not accept", + ), + ( + obj(vec![("client_id", s(&id_s)), ("client_key", V::U64(1))]), + "the config: client_key: ", + ), + ( + // Valid hex, not a keyset. + obj(vec![("client_id", s(&id_s)), ("client_key", s("deadbeef"))]), + "the config: client_key: a client key that is not valid", + ), + ( + obj(vec![ + ("client_id", s(&id_s)), + ("client_key", s(&hex)), + ("zerokms_urk", s("https://typo.example.com")), + ]), + "the config: an unknown key, ", + ), + ( + obj(vec![ + ("client_id", s(&id_s)), + ("client_key", s(&hex)), + ("zerokms_url", s("not a url")), + ]), + "the config: zerokms_url: a value its type does not accept", + ), + ( + obj(vec![ + ("client_id", s(&id_s)), + ("client_key", s(&hex)), + ("zerokms_url", V::Null), + ]), + "the config: zerokms_url: ", + ), + ]; + for (config, expected) in &cases { + let message = refused(config, &secrets); + assert!( + message.starts_with(expected), + "{message:?} is not {expected:?}" + ); + } + } - assert!(matches!( - parse_config(FfiValue::Null), - Err(ConfigError::NotAnObject) - )); - assert!(matches!( - parse_config(obj(vec![("client_id", &id_s)])), - Err(ConfigError::Missing("client_key")) - )); - assert!(matches!( - parse_config(obj(vec![("client_id", "nope"), ("client_key", &hex)])), - Err(ConfigError::Invalid("client_id")) - )); - assert!(matches!( - parse_config(obj(vec![ - ("client_id", &id_s), - ("client_key", "deadbeef"), // valid hex, not a keyset - ])), - Err(ConfigError::Invalid("client_key")) - )); - assert!(matches!( - parse_config(obj(vec![ - ("client_id", &id_s), - ("client_key", &hex), - ("zerokms_urk", "https://typo.example.com"), - ])), - Err(ConfigError::UnknownKey(_)) - )); - // The codec refuses duplicate keys on the ABI path, but this - // function is `pub` over any `FfiValue`: a repeated `client_key` - // must be an error, never a silent last-write-wins on root key - // material. - assert!(matches!( - parse_config(obj(vec![ - ("client_id", &id_s), - ("client_key", &hex), - ("client_key", &hex), - ])), - Err(ConfigError::Duplicate("client_key")) - )); - assert!(matches!( - parse_config(obj(vec![ - ("client_id", &id_s), - ("client_key", &hex), - ("zerokms_url", "not a url"), - ])), - Err(ConfigError::Invalid("zerokms_url")) - )); + /// A repeated `client_key` is never a silent last-write-wins on root key + /// material: the frame refuses it. + #[test] + fn a_repeated_key_is_refused() { + let (id, hex) = client_key_hex(); + let message = refused( + &obj(vec![ + ("client_id", s(&id.to_string())), + ("client_key", s(&hex)), + ("client_key", s(&hex)), + ]), + &[&hex], + ); + assert!(message.starts_with("the config: "), "{message}"); } } diff --git a/languages/golang/encrypt/guest/src/deterministic.rs b/languages/golang/encrypt/guest/src/deterministic.rs index e58a26e74..88a789d51 100644 --- a/languages/golang/encrypt/guest/src/deterministic.rs +++ b/languages/golang/encrypt/guest/src/deterministic.rs @@ -11,3 +11,59 @@ //! binary carries it; the tests read it from disk. pub use stack_kms::DeterministicSource; + +use serde::Deserialize; +use stack_guest_abi::last_error::malformed; +use vitaminc_aead_frame::serde::from_slice; +use zeroize::Zeroize; + +/// The `deterministic-kms` build's whole config: the source's 32-byte seed, +/// a frame holding bytes and nothing else. Wiped when it drops. +#[derive(Deserialize)] +#[serde(try_from = "&[u8]")] +pub struct Seed([u8; 32]); + +impl TryFrom<&[u8]> for Seed { + type Error = &'static str; + + fn try_from(bytes: &[u8]) -> Result { + bytes + .try_into() + .map(Seed) + .map_err(|_| "a seed that is not 32 bytes") + } +} + +impl Drop for Seed { + fn drop(&mut self) { + self.0.zeroize(); + } +} + +impl Seed { + /// Read the seed frame the host sent in place of a config. + pub fn parse(bytes: &[u8]) -> Result { + from_slice(bytes) + .map_err(|_| malformed("the deterministic build's config is a 32-byte seed")) + } + + /// The key source this seed drives. + pub fn source(&self) -> DeterministicSource { + DeterministicSource::new(self.0) + } +} + +#[cfg(test)] +mod tests { + use super::Seed; + use crate::test_frame::{frame, V}; + use vitaminc_aead_frame::serde::from_slice; + + /// A seed is 32 bytes, and only bytes: 32 characters of text are refused. + #[test] + fn a_seed_is_32_bytes_never_text() { + assert!(from_slice::(&frame(&V::Bytes(vec![7; 32]))).is_ok()); + assert!(from_slice::(&frame(&V::Bytes(vec![7; 31]))).is_err()); + assert!(from_slice::(&frame(&V::Str("x".repeat(32)))).is_err()); + } +} diff --git a/languages/golang/encrypt/guest/src/host.rs b/languages/golang/encrypt/guest/src/host.rs index 7c7564f5f..605bf7d42 100644 --- a/languages/golang/encrypt/guest/src/host.rs +++ b/languages/golang/encrypt/guest/src/host.rs @@ -1,7 +1,16 @@ -//! The host imports and the types built over them: [`WasiHostConnection`] -//! (a [`ZeroKMSConnection`] whose transport is the host's HTTP client) and -//! [`HostTokenStrategy`] (an [`AuthStrategy`] that asks the host for the -//! bearer token). wasm32-only — everything here calls an imported function. +//! The guest's two connections to its host: [`WasiHostConnection`] (a +//! [`ZeroKMSConnection`] whose requests the host performs, through the step +//! loop) and [`HostTokenStrategy`] (an [`AuthStrategy`] that asks the host +//! for the bearer token). wasm32-only — the token is an imported function. +//! +//! # Requests +//! +//! The guest never waits on the network. A ZeroKMS request is recorded for +//! the step being run (`stack_guest_abi::step::request`) and the export +//! returns to the host with it, paused; the host performs it and resumes the +//! operation with the response ([`crate::io`] has the wire form). So a host +//! whose HTTP client cannot block — `fetch` on the edge — can run the guest, +//! and the guest is never running while a request is in flight. //! //! # Import contract (module `cipherstash_transport`) //! @@ -9,11 +18,9 @@ //! guest buffers with `se_alloc` and the guest reclaims them through the //! shared registry (`stack_guest_abi::buffers`). //! -//! - `transport_send(..)` — perform one HTTP request. The import and its -//! contract are `stack_guest_abi::transport`'s, shared with every guest; -//! this module only builds ZeroKMS requests over it. //! - `token_get(token_out) -> status` — hand over the current bearer token -//! (Phase-1 auth: minting and refresh stay on the host). `token_out` is a +//! (Phase-1 auth: minting and refresh stay on the host, which holds a +//! fresh token before each step, so this never waits). `token_out` is a //! `(ptr_out, len_out)` slot pair filled with an `se_alloc`'d buffer; //! status `0` is success, anything else a host-side failure. This //! guest's own: the credential guest supplies tokens rather than asking @@ -34,7 +41,7 @@ use std::sync::Mutex; use stack_auth::{AuthError, AuthStrategy, CustomError, SecretToken, ServiceToken}; use stack_guest_abi::buffers; use stack_guest_abi::headers::header_value; -use stack_guest_abi::transport; +use stack_guest_abi::step; use stack_kms::{BaseUrlUnresolved, ZeroKMSConnection, ZeroKMSConnectionInit, ZeroKmsEndpoint}; use zeroize::Zeroizing; use zerokms_protocol::{ViturRequest, ViturRequestError}; @@ -47,9 +54,9 @@ extern "C" { fn token_get(token_ptr_out: *mut u32, token_len_out: *mut u32) -> i32; } -/// A [`ZeroKMSConnection`] whose transport is the `transport_send` host -/// import. The host call is synchronous from the guest's perspective, so -/// `send` resolves immediately — `block_on` in the ABI layer never parks. +/// A [`ZeroKMSConnection`] whose requests the host performs: `send` records +/// its request for the step being run and resolves when the host resumes the +/// operation with the response (see the [module docs](self)). /// /// The endpoint is pinned at init when the cipher config named one; /// otherwise it is discovered by `StackKms` from the access token's @@ -126,11 +133,12 @@ impl ZeroKMSConnection for WasiHostConnection { let auth = Zeroizing::new(format!("Bearer {access_token}")); let headers = Zeroizing::new(request_headers(auth.as_str())); - // The shared import reclaims both response slots before judging - // either, and the body it hands back wipes on drop (it carries - // wrapped key material). - let response = transport::send("POST", url.as_str(), &headers, &body) - .map_err(|e| ViturRequestError::parse("Host response buffer failed validation", e))?; + // The request's headers and body wipe on drop, and so does the + // response's body: it carries wrapped key material. + let request = step::Request::new("POST", url.to_string(), headers, body); + let response = step::request(request) + .await + .map_err(|e| ViturRequestError::prepare("The host was not asked for the request", e))?; let content_type = header_value(&response.headers, "content-type"); map_response(response.status, content_type, &response.body) diff --git a/languages/golang/encrypt/guest/src/io.rs b/languages/golang/encrypt/guest/src/io.rs new file mode 100644 index 000000000..13618e8d2 --- /dev/null +++ b/languages/golang/encrypt/guest/src/io.rs @@ -0,0 +1,188 @@ +//! How a step of the step loop crosses the boundary +//! ([`stack_guest_abi::step`]): the requests a paused operation hands the +//! host, and the responses the host hands back. Both are transport frames, +//! read and written with serde. +//! +//! When an export pauses it returns `STATUS_NEEDS_IO` instead of an output, +//! and the host takes the step with `se_io`: +//! +//! ```text +//! { "handle": , +//! "requests": [ { "method": "POST", "url": , +//! "headers": , "body": }, ... ] } +//! ``` +//! +//! The host performs every request and calls `se_resume` with the handle and +//! their responses, in the same order: +//! +//! ```text +//! [ { "status": , "headers": , "body": }, ... ] +//! ``` +//! +//! `headers` is the `name: value` line format of +//! [`stack_guest_abi::headers`] both ways. A `status` is the HTTP status, or +//! negative for a request the host could not perform, with its error text as +//! the body: the contract `transport_send` had, field for field. A step +//! carries the bearer token and a request body that can hold key-material +//! contexts, and a response can carry wrapped keys, so the guest wipes its +//! copies, and the host wipes the buffers with `se_dealloc`. + +use serde::{Deserialize, Serialize, Serializer}; +use stack_guest_abi::last_error::malformed; +use stack_guest_abi::step::{Request, Response}; +use vitaminc_aead_frame::serde::{from_slice, to_vec}; +use zeroize::Zeroizing; + +use crate::status::STATUS_ENCODING; + +/// The step the host takes with `se_io`, as frame bytes. The bytes carry a +/// bearer token, so the caller registers them and the host's `se_dealloc` +/// wipes them; the staging buffer is wiped here. +pub fn encode_step(handle: u64, requests: &[Request]) -> Result, u32> { + #[derive(Serialize)] + struct Wire<'a> { + handle: u64, + requests: Vec>, + } + #[derive(Serialize)] + struct RequestWire<'a> { + method: &'a str, + url: &'a str, + headers: Bytes<'a>, + body: Bytes<'a>, + } + let wire = Wire { + handle, + requests: requests + .iter() + .map(|request| RequestWire { + method: request.method, + url: &request.url, + headers: Bytes(&request.headers), + body: Bytes(&request.body), + }) + .collect(), + }; + let frame = Zeroizing::new(to_vec(&wire).map_err(|_| STATUS_ENCODING)?); + // Sized exactly, as every output is: the registry would otherwise + // reallocate a buffer with spare capacity and leave the old one unwiped. + let mut out = Vec::new(); + out.try_reserve_exact(frame.len()) + .map_err(|_| stack_guest_abi::last_error::internal("no memory for a step's requests"))?; + out.extend_from_slice(&frame); + Ok(out) +} + +/// The responses the host handed `se_resume`, copied out of its buffer into +/// ones the guest wipes. +pub fn decode_responses(bytes: &[u8]) -> Result, u32> { + #[derive(Deserialize)] + #[serde(deny_unknown_fields)] + struct ResponseWire<'a> { + status: i32, + #[serde(borrow)] + headers: &'a [u8], + #[serde(borrow)] + body: &'a [u8], + } + let wire: Vec> = + from_slice(bytes).map_err(|e| malformed(format!("the responses: {e}")))?; + Ok(wire + .into_iter() + .map(|r| { + Response::new( + r.status, + r.headers.to_vec(), + Zeroizing::new(r.body.to_vec()), + ) + }) + .collect()) +} + +/// Bytes, written as a bytes leaf. +struct Bytes<'a>(&'a [u8]); + +impl Serialize for Bytes<'_> { + fn serialize(&self, s: S) -> Result { + s.serialize_bytes(self.0) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::test_frame::{frame, obj, V}; + + #[test] + fn a_step_is_its_handle_and_requests() { + let request = Request::new( + "POST", + "https://kms.example/keys".to_owned(), + Zeroizing::new(b"authorization: Bearer t\n".to_vec()), + Zeroizing::new(b"{\"k\":1}".to_vec()), + ); + let bytes = encode_step(7, &[request]).unwrap(); + let expected = frame(&obj(vec![ + ("handle", V::U64(7)), + ( + "requests", + V::Arr(vec![obj(vec![ + ("method", V::Str("POST".into())), + ("url", V::Str("https://kms.example/keys".into())), + ("headers", V::Bytes(b"authorization: Bearer t\n".to_vec())), + ("body", V::Bytes(b"{\"k\":1}".to_vec())), + ])]), + ), + ])); + assert_eq!(bytes, expected); + assert_eq!(bytes.capacity(), bytes.len()); + } + + #[test] + fn responses_read_in_order() { + let bytes = frame(&V::Arr(vec![ + obj(vec![ + ("status", V::I32(200)), + ( + "headers", + V::Bytes(b"content-type: application/json\n".to_vec()), + ), + ("body", V::Bytes(b"{}".to_vec())), + ]), + obj(vec![ + ("status", V::I32(-1)), + ("headers", V::Bytes(Vec::new())), + ("body", V::Bytes(b"dial tcp: refused".to_vec())), + ]), + ])); + let responses = decode_responses(&bytes).unwrap(); + assert_eq!(responses.len(), 2); + assert_eq!(responses[0].status, 200); + assert_eq!(&*responses[0].body, b"{}"); + assert_eq!(responses[1].status, -1); + assert_eq!(&*responses[1].body, b"dial tcp: refused"); + } + + #[test] + fn malformed_responses_are_refused_without_echoing_them() { + for bad in [ + V::Null, + obj(vec![("status", V::I32(200))]), + V::Arr(vec![obj(vec![ + ("status", V::I32(200)), + ("headers", V::Str("secret-looking".into())), + ("body", V::Bytes(Vec::new())), + ])]), + V::Arr(vec![obj(vec![ + ("status", V::I32(200)), + ("headers", V::Bytes(Vec::new())), + ("body", V::Bytes(Vec::new())), + ("extra", V::Bool(true)), + ])]), + ] { + assert_eq!(decode_responses(&frame(&bad)).err(), Some(STATUS_ENCODING)); + let error = stack_guest_abi::last_error::take().unwrap(); + assert!(!String::from_utf8_lossy(&error).contains("secret-looking")); + } + } +} diff --git a/languages/golang/encrypt/guest/src/lib.rs b/languages/golang/encrypt/guest/src/lib.rs index dfe7fbbdb..2d3c7acd3 100644 --- a/languages/golang/encrypt/guest/src/lib.rs +++ b/languages/golang/encrypt/guest/src/lib.rs @@ -45,9 +45,12 @@ //! `se_cipher_init`; derived data keys and index keys never leave. //! //! The exports are the record path (`se_encrypt_record`, `se_decrypt_record`), -//! per-field term derivation (`se_term`), a target field's EQL query value -//! (`se_query`), keyset resolution (`se_keyset`), the generator's two -//! questions (`se_plan_check`, `se_targets`) and the lifetime pair +//! the term of one index under a context (`se_term`, which the Go SDK asks +//! to name the field behind a record's term failure), a query named by +//! operator and a probabilistic query's two questions (`se_query_term`, +//! `se_verify`, `se_target_limit`; ADR-0007, amended 2026-10-16), keyset +//! resolution (`se_keyset`), the generator's three questions +//! (`se_plan_check`, `se_targets`, `se_operators`) and the lifetime pair //! (`se_cipher_init`, `se_shutdown`). There is no whole-value export: the //! Go SDK seals every value under a declaration (ADR-0007). //! @@ -73,13 +76,15 @@ //! - [`abi`], [`host`] (wasm32 only) — this guest's export surface and its //! token import. The conventions every guest shares — `se_alloc` / //! `se_dealloc`, the buffer registry, the packed result encoding, the -//! status table, the `transport_send` import — are `stack_guest_abi`'s; +//! status table, the step loop (`stack_guest_abi::step`) — are +//! `stack_guest_abi`'s, and [`io`] is how this guest's steps cross; //! [`abi`]'s module docs give this guest's contract on top of them. //! //! On wasm32 `vitaminc-encrypt` uses its pure-Rust (RustCrypto `aes-gcm`) //! backend; the trade-offs are documented there. Values cross the boundary -//! in the vitaminc FFI codec (`vitaminc_aead_value::transport` — an FFI -//! encoding, not a storage format); the leaves inside a ciphertext tree are +//! as vitaminc transport frames and ciphertext trees in vitaminc's +//! ciphertext codec (`vitaminc_aead_frame` — FFI encodings, not a storage +//! format); the leaves inside a ciphertext tree are //! the *frozen* `SealedValue` byte encoding from Phase 2, so a leaf lifted //! out of a tree is exactly what a database column holds. @@ -87,11 +92,17 @@ pub mod config; #[cfg(feature = "deterministic-kms")] pub mod deterministic; pub mod headers; +pub mod io; pub mod ops; pub mod options; pub mod response; pub mod status; +#[cfg(test)] +#[path = "../tests/support/mod.rs"] +mod support; pub mod targets; +#[cfg(test)] +mod test_frame; // The ABI's packed u64 results embed 32-bit pointers, its bounds checks // read the wasm linear-memory size, and `host` calls imported functions — diff --git a/languages/golang/encrypt/guest/src/ops.rs b/languages/golang/encrypt/guest/src/ops.rs index 9b0a8c9ac..450e655d3 100644 --- a/languages/golang/encrypt/guest/src/ops.rs +++ b/languages/golang/encrypt/guest/src/ops.rs @@ -4,9 +4,10 @@ //! module wires them to the session table and the packed ABI; nothing in //! here knows about linear memory. //! -//! Values and ciphertext trees cross the boundary in the vitaminc FFI codec -//! (`vitaminc_aead_value::transport`) — the same codec the vitaminc guest -//! uses, so the Go side carries exactly one codec. A ciphertext tree's +//! Values cross the boundary as vitaminc transport frames, and ciphertext +//! trees in vitaminc's ciphertext codec (`vitaminc_aead_frame`) — the same +//! encodings the vitaminc guest uses, so the Go side carries exactly one +//! codec. A ciphertext tree's //! leaves are re-encoded through [`SealedValue::to_bytes`] / //! [`SealedValue::from_bytes`]: the codec sees an opaque byte-string leaf, //! and the bytes inside it are the frozen storage encoding a database column @@ -34,17 +35,24 @@ //! directions, buffers sized before a byte of plaintext is written, the //! ABI's numeric term kinds, and the mapping from a library error to a //! status code. - -use stack_encrypt::dynamic::{self, Scalar, Scope}; +//! +//! Plaintext is never decoded into a value tree. A term's value is parsed and +//! walked in place to the scalar it holds, the way vitaminc's own guest walks +//! a frame into encryption. A record's source, a query's input and a page of +//! values to verify are read as [`ValueFrame`]s: the frame is checked against +//! the engine's value model, and the engine walks it, splitting a source into +//! one frame per field as it goes. A record opens into one frame, which is +//! the output. Control data (a plan, a context, an options object, query +//! statistics) carries no secret and is read from its frame with serde. + +use stack_encrypt::dynamic::{self, Scope, ValueFrame}; use stack_encrypt::sem::MatchOptions; use stack_encrypt::target::IndexSpec; use stack_encrypt::ErrorPayload; -use stack_encrypt::{ - BoxedPassthrough, CipherText, KeysetCipher, Label, SealedValue, StackCipherText, -}; +use stack_encrypt::{CipherText, KeysetCipher, Label, Node, SealedValue, StackCipherText}; use stack_kms::DataKeySource; -use vitaminc_aead_value::{transport as codec, FfiValue}; -use vitaminc_protected::Controlled; +use vitaminc_aead_frame::{decode_ciphertext, encode_ciphertext, Frame}; +use zeroize::Zeroizing; use stack_guest_abi::last_error; @@ -63,7 +71,7 @@ pub const TERM_OPE: u32 = 4; /// A ciphertext tree whose leaves are the frozen [`SealedValue`] byte /// encoding — the shape that crosses the FFI codec. -type BytesTree = CipherText, BoxedPassthrough>; +type BytesTree = Node>; // ============================================================================= // Terms @@ -71,15 +79,15 @@ type BytesTree = CipherText, BoxedPassthrough>; /// Derive one index term: a codec-encoded scalar and a codec-encoded /// context in, the term's frozen byte encoding out (see `stack-encrypt`'s -/// `sem` module docs). Under the local HMAC backend the derivation is one +/// `sem` module docs). The scalar's frame is walked in place. Under the local HMAC backend the derivation is one /// PRF/CLLW computation with no ZeroKMS I/O; that is the backend's /// property, not this operation's contract — the term API is a `Pending` /// so a backend that derives terms at ZeroKMS settles the same way. /// /// The context is one part — a string, bytes, or an `i32`/`i64`/`u32`/`u64` /// — or an array of parts, nested as deep as the transport codec allows -/// ([`codec::MAX_DEPTH`] levels from the root of the encoded value; deeper -/// is [`STATUS_ENCODING`] before the context is parsed), exactly as a plan +/// ([`MAX_DEPTH`](vitaminc_aead_frame::MAX_DEPTH) levels from the root of the frame; deeper +/// is [`STATUS_ENCODING`] before the context is read), exactly as a plan /// field's; [`dynamic::context`] is the one home of that grammar. Shape is identity: /// `[x]` is a PAE-framed list and `x` is not, so a probe takes the context /// in the shape the field was sealed under — a plan field's context @@ -97,23 +105,33 @@ where { // The same proof every stack-encrypt leaf demands: an empty context is // `STATUS_ENCODING` here, before any derivation. - let context = dynamic::context(decode_value(context)?).map_err(|e| fail_dynamic(&e))?; - let (scalar, kind) = parse_term(decode_value(value)?, kind)?; - dynamic::term(cipher, scalar, &kind, context) + let context = parse_context(context)?; + let value = parse_frame(value)?; + let kind = parse_term(value, kind)?; + dynamic::term(cipher, value, &kind, context) .await .map_err(|e| fail_dynamic(&e)) } -/// The static half of a term: the kind is one of the ABI's table, the value -/// is a scalar, and the scheme defines the pair -/// ([`IndexSpec::supports`]). Shared by [`term`] and [`validate::term`] so -/// the ABI refuses exactly what the operation would, before any keyset is -/// resolved. +/// A term's context: one frame, read by [`dynamic::context`]. Bytes that +/// are not a frame are refused as every other input's are, before the +/// context's own grammar. +fn parse_context( + context: &[u8], +) -> Result>, u32> { + let _ = parse_frame(context)?; + dynamic::context(context).map_err(|e| fail_dynamic(&e)) +} + +/// The static half of a term: the kind is one of the ABI's table, and the +/// value is one scalar the index takes ([`IndexSpec::defines`]). Shared by +/// [`term`] and [`validate::term`] so the ABI refuses exactly what the +/// operation would, before any keyset is resolved. /// /// The ABI's kind codes carry no options, so [`TERM_MATCH`] is the match /// index under the default options, the same index a plan's bare `"match"` /// names. -fn parse_term(value: FfiValue, kind: u32) -> Result<(Scalar, IndexSpec), u32> { +fn parse_term(value: Frame<'_>, kind: u32) -> Result { let kind = match kind { TERM_EQUALITY => IndexSpec::Equality, TERM_MATCH => IndexSpec::Match(MatchOptions::default()), @@ -125,11 +143,10 @@ fn parse_term(value: FfiValue, kind: u32) -> Result<(Scalar, IndexSpec), u32> { )) } }; - let scalar = Scalar::of(&value, &kind).map_err(|e| fail_dynamic(&e))?; - if !kind.supports(&scalar) { + if !kind.defines(value) { return Err(fail_dynamic(&dynamic::Error::Term { field: None, kind })); } - Ok((scalar, kind)) + Ok(kind) } // ============================================================================= @@ -164,10 +181,11 @@ where K: DataKeySource + Sync + 'static, { let plan = parse_plan(plan)?; - let tree = dynamic::record::encrypt_with(cipher, decode_value(source)?, &plan, &resolver()) - .map_err(|e| fail_dynamic(&e))? - .await - .map_err(|e| fail_error(&e))?; + let tree = + dynamic::record::encrypt_with(cipher, checked_plaintext(source)?, &plan, &resolver()) + .map_err(|e| fail_dynamic(&e))? + .await + .map_err(|e| fail_error(&e))?; encode_tree(tree) } @@ -203,39 +221,148 @@ where .map_err(|e| fail_dynamic(&e))? .await .map_err(|e| fail_error(&e))?; - encode_value(value) + encode_frame(value) } -/// Derive the EQL query value of one target field: a codec-encoded -/// plaintext, the codec-encoded plan and the field's name (UTF-8) in, the -/// query value's JSON bytes out — the operand `eql_v3.query_` takes. -/// Runs the EQL type's own query plan through this build's resolver -/// ([`crate::targets`]); a build without EQL types refuses the plan before -/// this is reached. No data key is minted: under the local backend the -/// equality term is one PRF derivation. -pub async fn query( +// ============================================================================= +// Queries by operator +// ============================================================================= + +/// Derive the query term for one plan field, an operator and its input +/// (ADR-0009; ADR-0007, amended 2026-10-16): a codec-encoded input, the +/// codec-encoded plan, the field's name and the operator's name (both UTF-8) +/// in, the term's codec-encoded object out (the `Serialize` form of +/// [`dynamic::QueryTerm`]): +/// +/// ```text +/// { "operator": "matches", "fidelity": "probabilistic", "index": "match", +/// "domain": null, "term": } +/// ``` +/// +/// The input is one value for every operator but `between`, whose input is +/// a list of two, low then high. It is read as the field's declared kind +/// first, so a host's float `34.0` queries a `uint64` field. A field with +/// indexes derives the term of the index that answers the operator, as +/// bytes; `between` derives one per bound, as a list of two. A field that +/// names an EQL type runs the type's query twin through this build's +/// resolver, and `term` holds the twin's JSON bytes and `domain` its +/// PostgreSQL domain. No data key is minted. +pub async fn query_term( cipher: &KeysetCipher<'_, K>, - value: &[u8], + input: &[u8], plan: &[u8], field: &[u8], + operator: &[u8], ) -> Result, u32> where K: DataKeySource + Sync + 'static, { + let (plan, field, operator) = parse_query(plan, field, operator)?; + let term = dynamic::query_term( + cipher, + &plan, + field, + operator, + checked_plaintext(input)?, + &resolver(), + ) + .map_err(|e| fail_dynamic(&e))? + .await + .map_err(|e| fail_error(&e))?; + encode_answer(&term) +} + +/// Verify a page of decrypted values against a probabilistic query: the +/// query's codec-encoded input and a codec-encoded list of values, with the +/// plan, the field's name and the operator's name, in; a codec-encoded list +/// of booleans out, one per value in order ([`dynamic::verify`]). The query +/// is named as it was derived, and its tokens are cut again from the input: +/// they are plaintext, so no term carries them. A null value is `false`. +/// Needs no cipher and no key. +pub fn verify( + input: &[u8], + values: &[u8], + plan: &[u8], + field: &[u8], + operator: &[u8], +) -> Result, u32> { + let (plan, field, operator) = parse_query(plan, field, operator)?; + // Each value becomes a frame of its own (wiped on drop): vitaminc's + // `Frame` walks a sequence but does not hand out its elements' frames, + // and reading them out of the frame layout here would duplicate + // vitaminc's parser. + let values = decode_plaintext(values)? + .elements() + .ok_or_else(|| last_error::malformed("the values to verify are not a list"))?; + let verified = dynamic::verify( + &plan, + field, + operator, + checked_plaintext(input)?, + values, + &resolver(), + ) + .map_err(|e| fail_dynamic(&e))?; + encode_answer(&verified) +} + +/// How many rows a probabilistic query should fetch for `want` of them to +/// verify: the term's bytes as [`query_term`] returned them (not a frame), +/// the codec-encoded statistics +/// ([`Stats::from_frame`](stack_encrypt::op::Stats::from_frame)), the plan, +/// the field's name and the operator's name in; the codec-encoded limit out, +/// an unsigned 64-bit integer or null for no finite fetch +/// ([`Limit::rows`](stack_encrypt::op::Limit::rows)). Needs no cipher and +/// no key. +pub fn target_limit( + term: &[u8], + stats: &[u8], + plan: &[u8], + field: &[u8], + operator: &[u8], + want: u64, +) -> Result, u32> { + let (plan, field, operator) = parse_query(plan, field, operator)?; + // Statistics are read without a field to hand; the error names the + // query's, as every other refusal of a query does. + let stats = stack_encrypt::op::Stats::from_frame(stats) + .map_err(|e| fail_dynamic(&e.in_field(field)))?; + let limit = dynamic::target_limit(&plan, field, operator, term, want, &stats, &resolver()) + .map_err(|e| fail_dynamic(&e))?; + encode_answer(&limit.rows()) +} + +/// The plan, field name and operator a query names: the plan parsed against +/// this build's resolver, the field's name UTF-8, and the operator one the +/// engine knows ([`dynamic::OpSpec::parse`]); an unknown operator is +/// refused naming the field, as an operator the field does not answer is. +fn parse_query<'f>( + plan: &[u8], + field: &'f [u8], + operator: &[u8], +) -> Result<(dynamic::record::Plan, &'f str, dynamic::OpSpec), u32> { let plan = parse_plan(plan)?; let field = std::str::from_utf8(field) .map_err(|_| last_error::malformed("the field name is not UTF-8"))?; - dynamic::record::query(cipher, &plan, field, decode_value(value)?, &resolver()) - .map_err(|e| fail_dynamic(&e))? - .await - .map_err(|e| fail_error(&e)) + let operator = std::str::from_utf8(operator) + .ok() + .and_then(dynamic::OpSpec::parse) + .ok_or_else(|| { + fail_dynamic(&dynamic::Error::Source { + field: Some(field.to_owned()), + reason: dynamic::Reason::UnknownOperator, + }) + })?; + Ok((plan, field, operator)) } -/// A codec-encoded plan, parsed against this build's resolver: a target -/// name this build cannot run is refused here, the same way at every -/// export that takes a plan. +/// A plan's frame, parsed against this build's resolver: a target name this +/// build cannot run is refused here, the same way at every export that +/// takes a plan. Bytes that are not a frame are refused as every other +/// input's are, before the plan's own grammar. fn parse_plan(plan: &[u8]) -> Result { - dynamic::record::plan_with(decode_value(plan)?, &resolver()).map_err(|e| fail_dynamic(&e)) + let _ = parse_frame(plan)?; + dynamic::record::plan_with(plan, &resolver()).map_err(|e| fail_dynamic(&e)) } // ============================================================================= @@ -255,8 +382,8 @@ pub fn plan_check(plan: &[u8]) -> Result<(), u32> { /// The EQL types this build of the engine knows, as a codec-encoded /// `{"targets": [...]}`: one entry per type in -/// [`TargetDescriptor::to_value`](stack_encrypt::dynamic::TargetDescriptor::to_value)'s -/// wire form, producible or not, with the reason when not. The build +/// [`TargetDescriptor`](stack_encrypt::dynamic::TargetDescriptor)'s +/// `Serialize` form, producible or not, with the reason when not. The build /// without EQL types lists none, which a generator reads as "no /// `encrypt_into` type is available" and refuses the tag; the `eql` build /// lists the catalog, and a generator writes `encrypt_into` only for an @@ -278,18 +405,50 @@ pub fn plan_check(plan: &[u8]) -> Result<(), u32> { /// | `query_sql_domain` | string or null | the Postgres domain of the query value | /// | `producible` | bool | whether this build produces the type | /// | `reason` | string or null | why not, when `producible` is false | +/// | `operators` | list of objects | the operators the engine answers for the type, each `{"operator", "fidelity", "arity", "index"}` ([`TargetDescriptor`](stack_encrypt::dynamic::TargetDescriptor#wire-format)) | +/// +/// The first ten keys are eql-bindings' row; `operators` is the engine's, +/// computed from the row, so a generator asks the engine which operators a +/// type answers and how far each answer can be trusted. pub fn targets() -> Result, u32> { use stack_encrypt::dynamic::TargetResolver as _; - encode_value(FfiValue::Object(vec![( - "targets".to_string(), - FfiValue::Array( - resolver() - .targets() - .iter() - .map(|target| target.to_value()) - .collect(), - ), - )])) + #[derive(serde::Serialize)] + struct Targets { + targets: Vec, + } + encode_answer(&Targets { + targets: resolver().targets(), + }) +} + +/// The operators one field of a codec-encoded plan answers, as a +/// codec-encoded list: one object per operator, in the order the engine +/// lists them, each the `Serialize` form of a +/// [`dynamic::OperatorEntry`]: +/// +/// ```text +/// [ { "operator": "eq", "fidelity": "exact", "arity": "one", "index": "eq" }, ... ] +/// ``` +/// +/// Exactly the operators [`query_term`] derives a term for on that field +/// ([`dynamic::field_operators`]): the operators a field declared with +/// indexes answers, and those its EQL type answers for a field that names +/// one. The Go generator (`stashgen`) asks this for every sealed field it +/// writes and generates one query method per entry, so it holds no copy of +/// which index answers which operator. A field the plan does not have is +/// [`STATUS_ENCODING`]. Needs no cipher. +pub fn operators(plan: &[u8], field: &[u8]) -> Result, u32> { + let plan = parse_plan(plan)?; + let field = std::str::from_utf8(field) + .map_err(|_| last_error::malformed("the field name is not UTF-8"))?; + let operators = + dynamic::field_operators(&plan, field, &resolver()).map_err(|e| fail_dynamic(&e))?; + encode_answer( + &operators + .iter() + .map(|(operator, index)| dynamic::OperatorEntry::new(*operator, index)) + .collect::>(), + ) } // ============================================================================= @@ -308,13 +467,10 @@ pub mod validate { /// A term's inputs, as [`term`] takes them: the context decodes and is /// non-empty, the kind is one of [`TERM_EQUALITY`] .. [`TERM_OPE`], and - /// the value is a scalar the scheme defines that term for - /// ([`IndexSpec::supports`]). + /// the value is one scalar the index takes ([`IndexSpec::defines`]). pub fn term(value: &[u8], context: &[u8], kind: u32) -> Result<(), u32> { - dynamic::context(decode_value(context)?) - .map(drop) - .map_err(|e| fail_dynamic(&e))?; - parse_term(decode_value(value)?, kind).map(drop) + let _ = parse_context(context)?; + parse_term(parse_frame(value)?, kind).map(drop) } /// A record source against its plan, as [`encrypt_record`] takes them: @@ -323,38 +479,25 @@ pub mod validate { /// against its field's outputs). pub fn record(source: &[u8], plan: &[u8]) -> Result<(), u32> { let plan = parse_plan(plan)?; - dynamic::record::check_source(decode_value(source)?, &plan).map_err(|e| fail_dynamic(&e)) + dynamic::record::check_source(checked_plaintext(source)?, &plan) + .map_err(|e| fail_dynamic(&e)) } - /// A target query's inputs, as [`query`] takes them: the plan parses - /// against this build's resolver, the field is one of its target fields, - /// and the value is of the field's declared kind. - pub fn query(value: &[u8], plan: &[u8], field: &[u8]) -> Result<(), u32> { - let plan = parse_plan(plan)?; - let field = std::str::from_utf8(field) - .map_err(|_| last_error::malformed("the field name is not UTF-8"))?; - let refuse = |reason| { - fail_dynamic(&dynamic::Error::Plan { - field: Some(field.to_owned()), - reason, - }) - }; - let field = plan - .fields() - .iter() - .find(|candidate| candidate.name() == field) - .ok_or_else(|| refuse(dynamic::Reason::NoSuchField))?; - if field.target().is_none() { - return Err(refuse(dynamic::Reason::NotATarget)); - } - let value = decode_value(value)?; - if field.field_type().is_some_and(|kind| !kind.holds(&value)) { - return Err(fail_dynamic(&dynamic::Error::Source { - field: Some(field.name().to_owned()), - reason: dynamic::Reason::FieldType, - })); - } - Ok(()) + /// A query's inputs, as [`query_term`](super::query_term) takes them: + /// the plan parses, the field is one of its fields, the operator is one + /// the engine knows and the field answers, and the input reads as the + /// field's kind and passes the refusals the typed path makes before a + /// term exists ([`dynamic::check_query`]). + pub fn query_term(input: &[u8], plan: &[u8], field: &[u8], operator: &[u8]) -> Result<(), u32> { + let (plan, field, operator) = parse_query(plan, field, operator)?; + dynamic::check_query( + &plan, + field, + operator, + checked_plaintext(input)?, + &resolver(), + ) + .map_err(|e| fail_dynamic(&e)) } /// A record tree against its plan, as [`decrypt_record`] takes them: @@ -373,32 +516,60 @@ pub mod validate { // Codec glue // ============================================================================= -fn decode_value(bytes: &[u8]) -> Result { - codec::decode_value(&mut codec::Reader::new(bytes)) - .map_err(|_| last_error::malformed("an input is not a value in the transport codec")) +/// Plaintext from a frame: checked against the engine's value model and +/// held as the frame, in a buffer wiped when it drops. The same frames are +/// refused as control data's, so a malformed input fails the same way on +/// every path. +fn decode_plaintext(bytes: &[u8]) -> Result { + ValueFrame::from_bytes(bytes).map_err(|_| not_a_frame()) } -/// Encode a value tree into a buffer sized **before** the first byte is -/// written. -/// -/// This buffer is plaintext on the decrypt path, and a `Vec` grown by the -/// codec's pushes would leave partial plaintext in every abandoned -/// allocation a reallocation could not extend in place — memory nothing -/// wipes, undercutting the guarantee the registry makes about the buffer it -/// eventually hands the host. Reserving the exact encoded length up front -/// means the encoder never reallocates, and `register`'s `into_boxed_slice` -/// (capacity == length) does not copy either. -fn encode_value(value: FfiValue) -> Result, u32> { - let mut out = exact_buffer(value_encoded_len(&value))?; - codec::encode_value(value, &mut out).map_err(|_| STATUS_ENCODING)?; +/// Plaintext checked as [`decode_plaintext`] checks it, and walked in place +/// from the host's buffer: for a source or an input that is walked once, +/// where a frame of its own would be one more copy of the plaintext. The +/// record split copies each field into its own wiped frame, and a query's +/// input is read straight into its term. +fn checked_plaintext(bytes: &[u8]) -> Result, u32> { + ValueFrame::check(bytes).map_err(|_| not_a_frame()) +} + +/// An opened value as the output buffer: its frame, copied into a buffer +/// whose capacity is exactly its length (see [`encode_tree`]); the frame +/// is wiped when it drops. +fn encode_frame(frame: ValueFrame) -> Result, u32> { + let mut out = exact_buffer(Some(frame.risky_ref().len()))?; + out.extend_from_slice(frame.risky_ref()); + Ok(out) +} + +/// One frame, parsed and checked but not decoded: what a term's value is +/// walked from, in place. +fn parse_frame(bytes: &[u8]) -> Result, u32> { + Frame::parse(bytes).map_err(|_| not_a_frame()) +} + +fn not_a_frame() -> u32 { + last_error::malformed("an input is not a value in the transport frame") +} + +/// One of the engine's answers (a query term, a page of verdicts, a limit, a +/// catalog), written to its frame by serde, in a buffer whose capacity is +/// exactly its length. An answer is not plaintext, but the registry's +/// `into_boxed_slice` would reallocate a buffer with spare capacity, so it +/// is sized as every other output is. A query term's search tokens are +/// derived from plaintext, so the staging buffer is wiped once copied. +fn encode_answer(answer: &T) -> Result, u32> { + let frame = + Zeroizing::new(vitaminc_aead_frame::serde::to_vec(answer).map_err(|_| STATUS_ENCODING)?); + let mut out = exact_buffer(Some(frame.len()))?; + out.extend_from_slice(&frame); Ok(out) } fn decode_tree(bytes: &[u8]) -> Result { - let tree: BytesTree = - codec::decode_ciphertext_boxed(&mut codec::Reader::new(bytes)).map_err(|_| { - last_error::malformed("the record is not a ciphertext tree in the transport codec") - })?; + let tree: BytesTree = decode_ciphertext(bytes).map_err(|_| { + last_error::malformed("the record is not a ciphertext tree in the transport codec") + })?; // Structural only — a decoded leaf proves nothing until its AEAD opens // (see the `SealedValue` docs). map_leaves(tree, &mut |l: Vec| { @@ -408,25 +579,25 @@ fn decode_tree(bytes: &[u8]) -> Result { } /// The encode twin of [`decode_tree`]. Passthrough nodes can carry caller -/// plaintext, so this is sized up front for the same reason -/// [`encode_value`] is. +/// plaintext, so this is sized up front: the registry wipes only the buffer +/// it holds, and `register`'s `into_boxed_slice` reallocates a `Vec` whose +/// capacity exceeds its length, leaving the old allocation unwiped. fn encode_tree(tree: StackCipherText) -> Result, u32> { let tree = map_leaves(tree, &mut |l: SealedValue| Ok::<_, u32>(l.to_bytes()))?; let mut out = exact_buffer(tree_encoded_len(&tree))?; - codec::encode_ciphertext_boxed(tree, &mut out).map_err(|_| STATUS_ENCODING)?; + encode_ciphertext(&tree, &mut out).map_err(|_| STATUS_ENCODING)?; Ok(out) } /// Rebuild a ciphertext tree with every leaf run through `leaf`, keeping the -/// structure (and the passthrough payloads) untouched. One definition for +/// structure (and the passthrough frames) untouched. One definition for /// both directions of the frozen [`SealedValue`] leaf encoding. fn map_leaves( - tree: CipherText, + tree: Node, leaf: &mut impl FnMut(A) -> Result, -) -> Result, E> { +) -> Result, E> { Ok(match tree { CipherText::Single(l) => CipherText::Single(leaf(l)?), - CipherText::None(l) => CipherText::None(leaf(l)?), CipherText::EmptySequence(l) => CipherText::EmptySequence(leaf(l)?), CipherText::EmptyMap(l) => CipherText::EmptyMap(leaf(l)?), CipherText::Sequence(items) => CipherText::Sequence( @@ -460,41 +631,14 @@ fn exact_buffer(len: Option) -> Result, u32> { Ok(out) } -/// Exact byte length of the codec's encoding of `value`. `None` on overflow -/// or on a length the codec's `u32` frames cannot express — the encode would -/// fail on those anyway, so the caller reports an encoding error. -fn value_encoded_len(value: &FfiValue) -> Option { - // tag byte + fixed payload, or tag + u32 length prefix + payload. - let framed = |len: usize| u32::try_from(len).ok().and_then(|_| len.checked_add(5)); - match value { - FfiValue::Null | FfiValue::Undefined | FfiValue::Bool(_) => Some(1), - FfiValue::Int32(_) | FfiValue::UInt32(_) | FfiValue::Float32(_) => Some(5), - FfiValue::Int64(_) | FfiValue::UInt64(_) | FfiValue::Float64(_) => Some(9), - FfiValue::String(s) => framed(s.risky_ref().len()), - FfiValue::Bytes(b) => framed(b.risky_ref().len()), - FfiValue::Array(items) => items.iter().try_fold(5usize, |acc, item| { - acc.checked_add(value_encoded_len(item)?) - }), - FfiValue::Object(entries) => entries.iter().try_fold(5usize, |acc, (key, value)| { - acc.checked_add(framed(key.len())?.checked_sub(1)?)? - .checked_add(value_encoded_len(value)?) - }), - FfiValue::Passthrough(inner) => value_encoded_len(inner)?.checked_add(1), - } -} - -/// Exact byte length of the codec's encoding of a ciphertext tree. The -/// passthrough payloads are read (not consumed) through `Any::downcast_ref`, -/// matching what `encode_ciphertext_boxed` will re-home them to; a payload -/// that is not an [`FfiValue`] is `None`, which is the same rejection the -/// encoder would make. +/// Exact byte length of the codec's encoding of a ciphertext tree. A +/// passthrough is its node byte and its frame, written as it is. fn tree_encoded_len(tree: &BytesTree) -> Option { let framed = |len: usize| u32::try_from(len).ok().and_then(|_| len.checked_add(5)); match tree { - CipherText::Single(l) - | CipherText::None(l) - | CipherText::EmptySequence(l) - | CipherText::EmptyMap(l) => framed(l.len()), + CipherText::Single(l) | CipherText::EmptySequence(l) | CipherText::EmptyMap(l) => { + framed(l.len()) + } CipherText::Sequence(items) => items .iter() .try_fold(5usize, |acc, item| acc.checked_add(tree_encoded_len(item)?)), @@ -502,63 +646,39 @@ fn tree_encoded_len(tree: &BytesTree) -> Option { acc.checked_add(framed(key.len())?.checked_sub(1)?)? .checked_add(tree_encoded_len(value)?) }), - CipherText::Passthrough(p) => { - value_encoded_len((**p).downcast_ref::()?)?.checked_add(1) - } + CipherText::Passthrough(p) => p.0.len().checked_add(1), } } #[cfg(test)] mod tests { use super::*; - use vitaminc_protected::Protected; - - // `value_encoded_len` / `tree_encoded_len` re-derive the codec's framing - // arithmetic; the codec exports no `encoded_len` of its own, so these - // pins are the only thing that fails if the two drift. Drift is not a - // cosmetic bug: an undersized reservation makes `encode_value` - // reallocate mid-encode, leaving unwiped partial plaintext in the - // abandoned allocation — silently. - - fn every_value_shape() -> Vec { - vec![ - FfiValue::Null, - FfiValue::Undefined, - FfiValue::Bool(true), - FfiValue::Int32(-5), - FfiValue::UInt32(5), - FfiValue::Float32(1.5), - FfiValue::Int64(-9), - FfiValue::UInt64(9), - FfiValue::Float64(2.5), - FfiValue::String("".into()), - FfiValue::String("héllo".into()), - FfiValue::Bytes(Protected::new(Vec::new())), - FfiValue::Bytes(Protected::new(vec![0u8; 300])), - FfiValue::Array(Vec::new()), - FfiValue::Array(vec![FfiValue::Bool(false), FfiValue::String("x".into())]), - FfiValue::Object(Vec::new()), - FfiValue::Object(vec![ - ("a".to_string(), FfiValue::Int32(1)), - ( - "nested".to_string(), - FfiValue::Object(vec![("b".to_string(), FfiValue::Null)]), - ), - ]), - FfiValue::Passthrough(Box::new(FfiValue::Int64(7))), - FfiValue::Passthrough(Box::new(FfiValue::Array(vec![FfiValue::String( - "deep".into(), - )]))), - ] - } - + use crate::support::Tree; + use vitaminc_protected::Controlled; + + // `tree_encoded_len` re-derives the codec's arithmetic; the codec exports + // no `encoded_len` of its own, so this pin is the only thing that fails if + // the two drift. Drift is not a cosmetic bug: an undersized reservation + // makes `encode_tree` reallocate mid-encode, leaving unwiped partial + // plaintext in the abandoned allocation — silently. + + /// The registry wipes the buffer it is handed, and `into_boxed_slice` + /// reallocates one whose capacity exceeds its length. So every answer's + /// capacity is its length. #[test] - fn value_encoded_len_matches_the_codec_exactly() { - for (i, value) in every_value_shape().into_iter().enumerate() { - let expected = value_encoded_len(&value).expect("encodable shape"); - let mut out = Vec::new(); - codec::encode_value(value, &mut out).expect("codec encode"); - assert_eq!(out.len(), expected, "shape {i}"); + fn an_encoded_answer_has_no_spare_capacity() { + let entries = [ + dynamic::OperatorEntry::new(dynamic::OpSpec::Eq, &IndexSpec::Equality), + dynamic::OperatorEntry::new(dynamic::OpSpec::Between, &IndexSpec::Ope), + ]; + for out in [ + encode_answer(&vec![true, false, true]), + encode_answer(&Some(11u64)), + encode_answer(&None::), + encode_answer(&entries), + ] { + let out = out.expect("encodes"); + assert_eq!(out.capacity(), out.len()); } } @@ -568,10 +688,9 @@ mod tests { let trees: Vec = vec![ leaf(b""), leaf(&[7u8; 40]), - CipherText::None(vec![1, 2]), CipherText::EmptySequence(vec![3]), CipherText::EmptyMap(Vec::new()), - CipherText::Sequence(vec![leaf(b"a"), CipherText::None(vec![9])]), + CipherText::Sequence(vec![leaf(b"a"), CipherText::EmptyMap(vec![9])]), CipherText::Map(vec![ ("name".to_string(), leaf(b"ct")), ( @@ -579,32 +698,33 @@ mod tests { CipherText::Map(vec![("x".to_string(), leaf(b"y"))]), ), ]), - CipherText::Passthrough( - Box::new(FfiValue::Bytes(Protected::new(vec![1, 2, 3]))) as BoxedPassthrough - ), + CipherText::Passthrough(stack_encrypt::PassthroughFrame( + Tree::Bytes(vec![1, 2, 3]) + .to_frame() + .expect("a frame") + .risky_unwrap(), + )), ]; for (i, tree) in trees.into_iter().enumerate() { let expected = tree_encoded_len(&tree).expect("encodable shape"); let mut out = Vec::new(); - codec::encode_ciphertext_boxed(tree, &mut out).expect("codec encode"); + encode_ciphertext(&tree, &mut out).expect("codec encode"); assert_eq!(out.len(), expected, "tree {i}"); } } // ---- the EQL target path, native, over FakeDataKeySource ----------------- - fn encoded(value: FfiValue) -> Vec { - let mut out = Vec::new(); - codec::encode_value(value, &mut out).expect("encode"); - out + fn encoded(value: Tree) -> Vec { + value.to_frame().expect("encode").risky_unwrap() } - fn text(value: &str) -> FfiValue { - FfiValue::String(value.into()) + fn text(value: &str) -> Tree { + Tree::String(value.into()) } - fn object(entries: Vec<(&str, FfiValue)>) -> FfiValue { - FfiValue::Object( + fn object(entries: Vec<(&str, Tree)>) -> Tree { + Tree::Object( entries .into_iter() .map(|(k, v)| (k.to_string(), v)) @@ -619,10 +739,7 @@ mod tests { ( "email", object(vec![ - ( - "context", - FfiValue::Array(vec![text("users"), text("email")]), - ), + ("context", Tree::Array(vec![text("users"), text("email")])), ("target", text("TextEq")), ("type", text("string")), ]), @@ -630,11 +747,8 @@ mod tests { ( "notes", object(vec![ - ( - "context", - FfiValue::Array(vec![text("users"), text("notes")]), - ), - ("outputs", FfiValue::Array(vec![text("c")])), + ("context", Tree::Array(vec![text("users"), text("notes")])), + ("outputs", Tree::Array(vec![text("c")])), ("type", text("string")), ]), ), @@ -644,22 +758,22 @@ mod tests { #[test] fn targets_lists_what_this_build_holds_in_the_wire_shape() { let out = targets().expect("encodes"); - let FfiValue::Object(entries) = decode_value(&out).expect("decodes") else { + let Tree::Object(entries) = Tree::from_frame(&out).expect("decodes") else { panic!("an object"); }; assert_eq!(entries.len(), 1); assert_eq!(entries[0].0, "targets"); - let FfiValue::Array(items) = &entries[0].1 else { + let Tree::Array(items) = &entries[0].1 else { panic!("a list"); }; if !crate::targets::HOLDS_EQL { assert!(items.is_empty(), "the build without EQL types lists none"); return; } - let FfiValue::Object(text_eq) = items + let Tree::Object(text_eq) = items .iter() .find(|item| { - matches!(item, FfiValue::Object(fields) if fields.iter().any(|(k, v)| k == "name" && matches!(v, FfiValue::String(s) if s.risky_ref() == b"TextEq"))) + matches!(item, Tree::Object(fields) if fields.iter().any(|(k, v)| k == "name" && matches!(v, Tree::String(s) if s.as_bytes() == b"TextEq"))) }) .expect("TextEq is listed") else { @@ -678,10 +792,15 @@ mod tests { "query", "query_sql_domain", "producible", - "reason" + "reason", + "operators" ] ); - assert!(matches!(text_eq[8].1, FfiValue::Bool(true))); + assert!(matches!(text_eq[8].1, Tree::Bool(true))); + assert!( + matches!(&text_eq[10].1, Tree::Array(operators) if operators.len() == 1), + "TextEq answers one operator" + ); } #[test] @@ -695,10 +814,7 @@ mod tests { let refused = encoded(object(vec![( "email", object(vec![ - ( - "context", - FfiValue::Array(vec![text("users"), text("email")]), - ), + ("context", Tree::Array(vec![text("users"), text("email")])), ("target", text(name)), ]), )])); @@ -731,7 +847,7 @@ mod tests { validate::record(&source, &plan).expect("the source fits"); let sealed = block_on(encrypt_record(&keyset, &source, &plan)).expect("seals"); - // The stored tree carries the EQL JSON under "eql": the v3 envelope + // The stored tree carries the EQL JSON under "eql": the v4 envelope // with the column as its i and a stack-encrypt ciphertext. let tree = decode_tree(&sealed).expect("a tree"); let CipherText::Map(mut fields) = tree else { @@ -749,11 +865,11 @@ mod tests { let CipherText::Passthrough(payload) = &outputs[0].1 else { panic!("a passthrough") }; - let FfiValue::Bytes(bytes) = payload.downcast_ref::().expect("a value") else { + let Tree::Bytes(bytes) = Tree::from_frame(&payload.0).expect("a value") else { panic!("bytes") }; - let eql: serde_json::Value = serde_json::from_slice(bytes.risky_ref()).expect("JSON"); - assert_eq!(eql["v"], 3); + let eql: serde_json::Value = serde_json::from_slice(bytes.as_slice()).expect("JSON"); + assert_eq!(eql["v"], 4, "Stack Encrypt writes EQL v4"); assert_eq!(eql["i"], serde_json::json!({"t": "users", "c": "email"})); assert!(eql["c"].as_str().unwrap().starts_with("stack-encrypt:1:")); assert_eq!(eql["hm"].as_str().unwrap().len(), 64); @@ -762,19 +878,26 @@ mod tests { validate::record_tree(&sealed, &plan, None).expect("the tree fits"); let opened = block_on(decrypt_record(Scope::Client(&cipher), &sealed, &plan, None)).expect("opens"); - let FfiValue::Object(values) = decode_value(&opened).expect("a value") else { + let Tree::Object(values) = Tree::from_frame(&opened).expect("a value") else { panic!("an object") }; - assert!( - matches!(&values[0].1, FfiValue::String(s) if s.risky_ref() == b"alice@example.com") - ); - assert!(matches!(&values[1].1, FfiValue::String(s) if s.risky_ref() == b"likes cats")); + assert!(matches!(&values[0].1, Tree::String(s) if s.as_bytes() == b"alice@example.com")); + assert!(matches!(&values[1].1, Tree::String(s) if s.as_bytes() == b"likes cats")); - // The query value matches the stored term. + // The eq query's term is the type's query value, and it matches the + // stored term. let probe = encoded(text("alice@example.com")); - validate::query(&probe, &plan, b"email").expect("a target field"); - let query_bytes = block_on(query(&keyset, &probe, &plan, b"email")).expect("derives"); - let probe_json: serde_json::Value = serde_json::from_slice(&query_bytes).expect("JSON"); + validate::query_term(&probe, &plan, b"email", b"eq").expect("a target field answers eq"); + let term = block_on(query_term(&keyset, &probe, &plan, b"email", b"eq")).expect("derives"); + let Tree::Object(term) = Tree::from_frame(&term).expect("a value") else { + panic!("a query term is an object") + }; + assert!(matches!(&term[3].1, Tree::String(s) if s.as_bytes() == b"eql_v4.query_text_eq")); + let Tree::Bytes(query_bytes) = &term[4].1 else { + panic!("the term is the query value's bytes") + }; + let probe_json: serde_json::Value = + serde_json::from_slice(query_bytes.as_slice()).expect("JSON"); assert_eq!( probe_json["hm"], eql["hm"], "the query matches the stored value" @@ -786,15 +909,15 @@ mod tests { // A query on a sealed field, an unknown field, or a wrong kind is // refused at validation. assert_eq!( - validate::query(&probe, &plan, b"notes"), + validate::query_term(&probe, &plan, b"notes", b"eq"), Err(STATUS_ENCODING) ); assert_eq!( - validate::query(&probe, &plan, b"nope"), + validate::query_term(&probe, &plan, b"nope", b"eq"), Err(STATUS_ENCODING) ); assert_eq!( - validate::query(&encoded(FfiValue::UInt32(1)), &plan, b"email"), + validate::query_term(&encoded(Tree::UInt32(1)), &plan, b"email", b"eq"), Err(STATUS_ENCODING) ); } diff --git a/languages/golang/encrypt/guest/src/options.rs b/languages/golang/encrypt/guest/src/options.rs index 02db276e1..d3bb9f5fb 100644 --- a/languages/golang/encrypt/guest/src/options.rs +++ b/languages/golang/encrypt/guest/src/options.rs @@ -1,7 +1,7 @@ //! The per-call options object, and the keyset selector it carries. //! //! Every export that touches a keyset takes one more codec-encoded -//! argument: an [`FfiValue::Object`] with one required key, `keyset`, whose +//! argument: a frame object with one required key, `keyset`, whose //! value is a tagged object naming the keyset the call binds to, and on //! `se_decrypt_record` one optional key, `context` (below): //! @@ -45,11 +45,10 @@ use stack_encrypt::dynamic::Scope; use stack_encrypt::{KeysetCipher, Label, StackCipher}; use stack_kms::{IdentifiedBy, IndexKeySource}; use uuid::Uuid; -use vitaminc_aead_value::FfiValue; -use vitaminc_protected::Controlled; use zerokms_protocol::Name; use stack_guest_abi::last_error::malformed; +use vitaminc_aead_frame::serde::from_slice; use crate::status::fail_error; #[cfg(any(doc, test))] @@ -88,84 +87,133 @@ pub struct Options { pub context: Option/.rs, body)` per catalog family in CATALOG order, then @@ -839,7 +1178,7 @@ fn render_bindings(dir: &Path) -> Vec<(PathBuf, String)> { .map(|f| { ( dir.join(format!("{}.rs", f.name)), - render_family_bindings(f), + render_family_bindings(EqlVersion::V3, f), ) }) .collect(); @@ -852,18 +1191,37 @@ fn render_bindings(dir: &Path) -> Vec<(PathBuf, String)> { for f in eql_domains::families_with_scalar_domains().filter(|f| !f.is_scalar()) { rendered.push(( dir.join(format!("{}_storage.rs", f.name)), - render_scalar_only_bindings(f), + render_scalar_only_bindings(EqlVersion::V3, f), )); } rendered.push((dir.join("payload.rs"), render_payload_rs())); rendered.push((dir.join("query_payload.rs"), render_query_payload_rs())); - // The stack-encrypt target table and dispatch (`crate::targets`); gated - // to the `stack-encrypt` feature by the hand-written mod.rs. - rendered.push((dir.join("targets.rs"), crate::targets::render_targets_rs())); rendered.push((dir.join("inventory.rs"), render_inventory_rs())); rendered } +/// Render the v4 bindings: one module per family with a scalar domain (a +/// mixed family's scalar domains under its own name, since v4 has no +/// hand-written SteVec module to sit beside), and the Stack Encrypt target +/// table and dispatch (`targets.rs`, declared under the `targets` feature in +/// the hand-written `v4/mod.rs`). Stack Encrypt produces v4 only, so the +/// target table lives here. +fn render_v4_bindings(dir: &Path) -> Vec<(PathBuf, String)> { + let mut rendered: Vec<(PathBuf, String)> = eql_domains::families_with_scalar_domains() + .map(|f| { + let body = if f.is_scalar() { + render_family_bindings(EqlVersion::V4, f) + } else { + render_scalar_only_bindings(EqlVersion::V4, f) + }; + (dir.join(format!("{}.rs", f.name)), body) + }) + .collect(); + rendered.push((dir.join("targets.rs"), crate::targets::render_targets_rs())); + rendered.push((dir.join("inventory.rs"), render_v4_inventory_rs())); + rendered +} + /// Regenerate every committed Rust binding file under `out_root`: one /// `.rs` per catalog family plus the `inventory.rs` `all()` list. /// Hand-written `terms.rs` / `domain_type.rs` / `mod.rs` carry no marker, so @@ -878,9 +1236,11 @@ fn render_bindings(dir: &Path) -> Vec<(PathBuf, String)> { /// prunes `.rs` for a type dropped from the catalog, marker-aware so the /// hand-written `terms.rs` / `domain_type.rs` / `mod.rs` are always preserved. pub fn generate_bindings(out_root: &Path) -> Result, WriteError> { - let dir = out_root.join(V3_BINDINGS_DIR); + let v3 = out_root.join(bindings_dir(EqlVersion::V3)); + let v4 = out_root.join(bindings_dir(EqlVersion::V4)); - let rendered = render_bindings(&dir); + let mut rendered = render_bindings(&v3); + rendered.extend(render_v4_bindings(&v4)); let targets: Vec = rendered.iter().map(|(p, _)| p.clone()).collect(); ensure_generated_paths_writable(&targets, GeneratedKind::Rust)?; @@ -890,7 +1250,9 @@ pub fn generate_bindings(out_root: &Path) -> Result, WriteError> { write_generated_file(p, body, GeneratedKind::Rust)?; written.push(p.clone()); } - remove_generated_orphans(&dir, GeneratedKind::Rust, &normalized_set(&written))?; + let keep = normalized_set(&written); + remove_generated_orphans(&v3, GeneratedKind::Rust, &keep)?; + remove_generated_orphans(&v4, GeneratedKind::Rust, &keep)?; Ok(written) } @@ -924,7 +1286,7 @@ mod tests { #[test] fn integer_family_structs_have_pinned_shape() { - let out = render_family_bindings(family("integer")); + let out = render_family_bindings(EqlVersion::V3, family("integer")); assert!(out.starts_with(crate::consts::RUST_GENERATED_MARKER)); for s in [ "struct Integer ", @@ -973,7 +1335,7 @@ mod tests { // twin = the storage struct minus `c`, on the `eql_v3.query_` // domain (prefix naming). Storage-only domains (no // operators) get no twin. - let out = render_family_bindings(family("integer")); + let out = render_family_bindings(EqlVersion::V3, family("integer")); for s in [ "struct IntegerEqQuery ", "struct IntegerOrdOreQuery ", @@ -1001,7 +1363,7 @@ mod tests { // Dual-term text domains keep BOTH terms in the query twin, still no `c`. // `_ord` and `_search` are OPE-backed (`op`); `_ord_ore` and // `_search_ore` keep `ob`. - let text = render_family_bindings(family("text")); + let text = render_family_bindings(EqlVersion::V3, family("text")); assert_eq!(field_idents(&text, "TextOrdQuery"), ["v", "i", "hm", "op"]); assert_eq!( field_idents(&text, "TextOrdOreQuery"), @@ -1024,7 +1386,7 @@ mod tests { // the capability label + the operator union (`Term::operators_for_terms`) // + the required-key list (`ENVELOPE_KEYS` ++ `Term::term_json_keys`). // No field docs, no new free-form catalog prose. - let integer = render_family_bindings(family("integer")); + let integer = render_family_bindings(EqlVersion::V3, family("integer")); // Storage-only: no operators. assert!(integer.contains("`public.eql_v3_integer` — storage-only domain.")); @@ -1046,7 +1408,7 @@ mod tests { // text_ord carries BOTH `hm` and `ob` — the dual-term distinction that // previously lived only in hand-written prose is now derivable in the doc. - let text = render_family_bindings(family("text")); + let text = render_family_bindings(EqlVersion::V3, family("text")); assert!(text.contains("Required keys: `v` `i` `c` `hm` `ob`.")); assert!(text.contains("`public.eql_v3_text_match` — match domain.")); assert!(text.contains("Operators: `@@`.")); @@ -1055,7 +1417,7 @@ mod tests { #[test] fn text_family_includes_bloom_and_dual_term_ord() { - let out = render_family_bindings(family("text")); + let out = render_family_bindings(EqlVersion::V3, family("text")); for s in [ "struct Text ", "struct TextEq ", @@ -1098,7 +1460,7 @@ mod tests { #[test] fn bool_storage_only_family_has_one_struct_no_terms() { - let out = render_family_bindings(family("boolean")); + let out = render_family_bindings(EqlVersion::V3, family("boolean")); assert_eq!(out.matches("pub struct ").count(), 1); assert!(out.contains("`public.eql_v3_boolean` — storage-only domain.")); assert_eq!(field_idents(&out, "Boolean"), ["v", "i", "c"]); @@ -1108,24 +1470,63 @@ mod tests { assert!(!out.contains("BloomFilter")); } + /// Stack Encrypt produces EQL v4 only (ADR-0002): no v3 struct derives + /// its traits, and the v4 structs that do name the v4 domain and `v: 4`. + #[test] + fn only_v4_structs_derive_stack_encrypt_traits() { + for f in eql_domains::families_with_scalar_domains() { + let v3 = if f.is_scalar() { + render_family_bindings(EqlVersion::V3, f) + } else { + render_scalar_only_bindings(EqlVersion::V3, f) + }; + assert!(!v3.contains("stack_encrypt"), "{}: v3 derives", f.name); + } + for (family, domain) in stored_payload_domains().filter(|(_, d)| d.is_scalar()) { + assert_eq!( + encryption_gap(EqlVersion::V3, family, domain), + Some(V3_ENCRYPTION_GAP) + ); + } + let text = render_family_bindings(EqlVersion::V4, family("text")); + assert!(text.contains("derive(stack_encrypt::EncryptFrom)")); + assert!(text.contains("`public.eql_v4_text_eq` — equality domain.")); + assert!(text.contains("\"eql_v4.query_text_eq\"")); + assert!(text.contains("use crate::v4::{DomainType, SchemaVersion};")); + assert!(!text.contains("eql_v3")); + } + #[test] fn generate_bindings_writes_family_files_and_inventory_with_markers() { let tmp = crate::writer::test_support::tempdir(); let written = generate_bindings(tmp.path()).unwrap(); let dir = tmp.path().join("crates/eql-bindings/src/v3"); - // scalar families + jsonb_storage + payload + query_payload + targets - // + inventory. - assert_eq!(written.len(), eql_domains::scalar_families().count() + 5); + let v4 = tmp.path().join("crates/eql-bindings/src/v4"); + // v3: scalar families + json_storage + payload + query_payload + + // inventory. v4: every family with a scalar domain + targets + + // inventory. + let families = eql_domains::scalar_families().count(); + let v4_families = eql_domains::families_with_scalar_domains().count(); + assert_eq!(written.len(), (families + 4) + (v4_families + 2)); assert!(dir.join("integer.rs").is_file()); assert!(dir.join("text.rs").is_file()); assert!(dir.join("json_storage.rs").is_file()); assert!(dir.join("payload.rs").is_file()); - assert!(dir.join("targets.rs").is_file()); assert!(dir.join("inventory.rs").is_file()); assert!( - !dir.join("mod.rs").exists(), - "mod.rs stays hand-written; not generated" + !dir.join("targets.rs").exists(), + "Stack Encrypt targets are v4 only" ); + assert!(v4.join("text.rs").is_file()); + assert!(v4.join("json.rs").is_file()); + assert!(v4.join("targets.rs").is_file()); + assert!(v4.join("inventory.rs").is_file()); + for d in [&dir, &v4] { + assert!( + !d.join("mod.rs").exists(), + "mod.rs stays hand-written; not generated" + ); + } for p in &written { let body = std::fs::read_to_string(p).unwrap(); assert!( @@ -1141,17 +1542,17 @@ mod tests { // source, so a render panic aborts before deletion. Lock in the // load-bearing property: render writes NOTHING to disk. A pre-existing // file in the target dir survives the render call untouched, and render - // returns one entry per family plus payload, query_payload, targets - // and inventory (last). + // returns one entry per family plus json_storage, payload, + // query_payload and inventory (last). let tmp = crate::writer::test_support::tempdir(); - let dir = tmp.path().join(V3_BINDINGS_DIR); + let dir = tmp.path().join(bindings_dir(EqlVersion::V3)); std::fs::create_dir_all(&dir).unwrap(); let sentinel = dir.join("integer.rs"); std::fs::write(&sentinel, "SENTINEL").unwrap(); let rendered = render_bindings(&dir); - assert_eq!(rendered.len(), eql_domains::scalar_families().count() + 5); + assert_eq!(rendered.len(), eql_domains::scalar_families().count() + 4); assert_eq!( std::fs::read_to_string(&sentinel).unwrap(), "SENTINEL", @@ -1331,7 +1732,7 @@ mod tests { // trait object (`DomainType::term_json_keys`) and validates converted // payloads through `DomainType::parse_value` — both must be emitted on // every generated scalar impl, derived from `Term::term_json_keys`. - let integer = render_family_bindings(family("integer")); + let integer = render_family_bindings(EqlVersion::V3, family("integer")); assert!(integer.contains("fn term_json_keys_static() -> Option<&'static [&'static str]>")); assert!(integer.contains("fn term_json_keys(&self) -> Option<&'static [&'static str]>")); assert!( @@ -1347,7 +1748,7 @@ mod tests { assert!(integer.contains(r#"&["op"]"#)); // Multi-term domains list keys in catalog (wire) order. - let text = render_family_bindings(family("text")); + let text = render_family_bindings(EqlVersion::V3, family("text")); assert!(text.contains(r#"&["hm", "op", "bf"]"#), "text_search keys"); assert!( text.contains(r#"&["hm", "ob", "bf"]"#), @@ -1364,7 +1765,7 @@ mod tests { // together: the leading fields of a generated struct must equal // `ENVELOPE_KEYS`, in order, so a change to the catalog's envelope keys // can't silently diverge from the emitter. - let out = render_family_bindings(family("integer")); + let out = render_family_bindings(EqlVersion::V3, family("integer")); let leading: Vec = field_idents(&out, "Integer"); let expected: Vec = eql_domains::ENVELOPE_KEYS .iter() @@ -1406,7 +1807,7 @@ mod tests { #[test] fn render_bindings_skips_non_scalar_families() { let tmp = crate::writer::test_support::tempdir(); - let dir = tmp.path().join(V3_BINDINGS_DIR); + let dir = tmp.path().join(bindings_dir(EqlVersion::V3)); let rendered = render_bindings(&dir); // The hand-written SteVec module `json.rs` is never generated... assert!( @@ -1419,9 +1820,9 @@ mod tests { rendered.iter().any(|(p, _)| p.ends_with("json_storage.rs")), "the json family's scalar storage domain must generate json_storage.rs" ); - // One file per scalar family + jsonb_storage + payload + query_payload + - // targets + inventory. - assert_eq!(rendered.len(), eql_domains::scalar_families().count() + 5); + // One file per scalar family + json_storage + payload + query_payload + + // inventory. + assert_eq!(rendered.len(), eql_domains::scalar_families().count() + 4); } #[test] @@ -1456,7 +1857,7 @@ mod tests { fn every_stored_domain_has_an_encryption_derive_or_a_reason() { let mut derived = Vec::new(); for (family, domain) in stored_payload_domains() { - match encryption_gap(family, domain) { + match encryption_gap(EqlVersion::V4, family, domain) { None => derived.push((family.name, domain.name)), // Every reason is a string literal, so "not empty" cannot // fail; what can is a reason that describes a different @@ -1464,16 +1865,25 @@ mod tests { // catalog fact that selects it. Some(reason) => { let full = domain.full_name(family.name); - let expected = if family.name != "text" { - "only the text family" - } else if domain.terms.iter().any(|t| !matches!(t, Term::Hm)) { - "ordering and match terms" + let expected = if !domain.is_scalar() { + "JSON index" + } else if family.name == "json" { + "tree of leaves" + } else if plaintext_of(family.name).is_none() { + "no Rust plaintext type for this family" + } else if ORDER_PENDING_FAMILIES.contains(&family.name) { + "no order term for a date, timestamp or decimal" + } else if domain.terms.contains(&Term::Ore) { + "block ORE terms" + } else if domain.terms.contains(&Term::Bloom) + && domain.terms.contains(&Term::Ope) + { + "carries a match term" } else { - assert!( - domain.terms.is_empty(), - "{full}: an hm-only text domain other than eq is not in the catalog" - ); - "storage-only text domain" + panic!( + "{full}: every specified domain without ORE or a match-and-order \ + query is derived: {reason}" + ) }; assert!(reason.contains(expected), "{full}: {reason}"); } @@ -1491,7 +1901,9 @@ mod tests { for (family, domain) in stored_payload_domains() { let listed = ENCRYPTION_DOMAINS.contains(&(family.name, domain.name)); for query in [false, true] { - let attrs = encryption_attrs(family, domain, query).0.to_string(); + let attrs = encryption_attrs(EqlVersion::V4, family, domain, query) + .0 + .to_string(); assert_eq!( attrs.contains("stack_encrypt :: EncryptFrom"), listed, @@ -1509,7 +1921,7 @@ mod tests { } #[test] - fn an_equality_only_text_domain_is_not_called_storage_only() { + fn an_unlisted_equality_only_domain_says_it_is_unlisted() { // Not in the catalog, which is why the branch needs a synthetic // domain: the only text domain reaching the hm-only branch today has // no terms, so a wrong reason there would survive every catalog walk. @@ -1522,8 +1934,11 @@ mod tests { terms: &[Term::Hm], shape: eql_domains::Shape::Scalar, }; - let reason = encryption_gap(&family, &hm_only).unwrap(); - assert!(reason.contains("equality-only"), "{reason}"); + let reason = encryption_gap(EqlVersion::V4, &family, &hm_only).unwrap(); + assert!( + reason.contains("not listed in ENCRYPTION_DOMAINS"), + "{reason}" + ); assert!(!reason.contains("storage-only"), "{reason}"); } } diff --git a/packages/eql/crates/eql-codegen/src/consts.rs b/packages/eql/crates/eql-codegen/src/consts.rs index 3422195f5..dbbae25a1 100644 --- a/packages/eql/crates/eql-codegen/src/consts.rs +++ b/packages/eql/crates/eql-codegen/src/consts.rs @@ -14,7 +14,11 @@ pub(crate) const AUTO_GENERATED_MARKER: &str = "-- AUTOMATICALLY GENERATED FILE. pub(crate) const RUST_GENERATED_MARKER: &str = "// @generated by eql-codegen from the eql-domains catalog — do not edit"; -/// The public `eql_v3` API surface: query operators, index extractors, +/// The generated SQL names its schemas and payload version by placeholder, +/// never literally: [`crate::render`] writes the one source out as `eql_v3` +/// (version 3) and `eql_v4` (version 4). See ADR-0002. +/// +/// The public API schema (`eql_v3` once rendered): query operators, index extractors, /// aggregates, AND the operator-backing comparison **wrappers** /// (`eq`/`neq`/`lt`/`lte`/`gt`/`gte`/`contains`/`contained_by`). The wrappers /// are public because they are the function-form equivalent of every supported @@ -22,7 +26,7 @@ pub(crate) const RUST_GENERATED_MARKER: &str = /// calls functions, not operators). User-column encrypted domains live in /// `public`; only index-term TYPES and never-invoked plumbing live in /// `INTERNAL_SCHEMA`. -pub(crate) const SCHEMA: &str = "eql_v3"; +pub(crate) const SCHEMA: &str = "{{prefix}}"; /// The schema housing INTERNAL eql_v3 objects only: the SEM index-term types /// (`hmac_256`, `bloom_filter`, `ore_block_256(_term)`, `ope_cllw`) and their @@ -33,7 +37,16 @@ pub(crate) const SCHEMA: &str = "eql_v3"; /// picker. NOTE: the operator-backing comparison *wrappers* are NOT here — /// they are public in `SCHEMA` (see above) so every operator has a callable /// function equivalent. -pub(crate) const INTERNAL_SCHEMA: &str = "eql_v3_internal"; +pub(crate) const INTERNAL_SCHEMA: &str = "{{prefix}}_internal"; + +/// The bare typname prefix of every public-schema encrypted domain, e.g. the +/// `{{prefix}}_` of `public.{{prefix}}_integer_eq`. The SQL counterpart of +/// [`eql_domains::PUBLIC_TYPNAME_PREFIX`], which stays the literal `eql_v3_` +/// for the Rust bindings: those describe v3 payloads only. +pub(crate) const PUBLIC_TYPNAME_PREFIX: &str = "{{prefix}}_"; + +/// The payload version every domain CHECK compares `VALUE->>'v'` against. +pub(crate) const EQL_VERSION: &str = "{{eql_version}}"; /// Always-present payload keys checked for presence in every domain CHECK. /// Term-specific keys are appended after these by `context::domain_block`. @@ -69,8 +82,8 @@ mod tests { // `list-schemas` subcommand) so a hand-edit to one side without the // other fails CI. Pinning the values here catches a Rust-side rename // before the SQL is even consulted. - assert_eq!(SCHEMA, "eql_v3"); - assert_eq!(INTERNAL_SCHEMA, "eql_v3_internal"); + assert_eq!(SCHEMA, "{{prefix}}"); + assert_eq!(INTERNAL_SCHEMA, "{{prefix}}_internal"); // `owned_schemas()` (lib.rs) is the public accessor the binary prints; // it must derive from these consts, public first. assert_eq!(crate::owned_schemas(), [SCHEMA, INTERNAL_SCHEMA]); diff --git a/packages/eql/crates/eql-codegen/src/context.rs b/packages/eql/crates/eql-codegen/src/context.rs index 066bdb189..a34cbd69b 100644 --- a/packages/eql/crates/eql-codegen/src/context.rs +++ b/packages/eql/crates/eql-codegen/src/context.rs @@ -54,6 +54,16 @@ pub fn environment() -> minijinja::Environment<'static> { include_str!("../templates/aggregates.sql.j2"), ) .expect("aggregates.sql template"); + env.add_template( + "range_types.sql", + include_str!("../templates/range_types.sql.j2"), + ) + .expect("range_types.sql template"); + env.add_template( + "range_functions.sql", + include_str!("../templates/range_functions.sql.j2"), + ) + .expect("range_functions.sql template"); env.add_template( "ore_fallback.sql", include_str!("../templates/ore_fallback.sql.j2"), @@ -61,6 +71,7 @@ pub fn environment() -> minijinja::Environment<'static> { .expect("ore_fallback.sql template"); env.add_global("schema", SCHEMA); env.add_global("internal_schema", INTERNAL_SCHEMA); + env.add_global("eql_version", EQL_VERSION); env } @@ -390,15 +401,15 @@ pub struct OreFallbackEntry { } /// The bare pg_type typname of a public-schema encrypted domain: the catalog -/// name carrying the [`eql_domains::PUBLIC_TYPNAME_PREFIX`] version prefix, -/// e.g. `eql_v3_integer_eq`. The prefix keeps EQL domains from +/// name carrying the [`PUBLIC_TYPNAME_PREFIX`] version prefix, +/// e.g. `{{prefix}}_integer_eq` (`eql_v3_integer_eq` once rendered). The prefix keeps EQL domains from /// shadowing PostgreSQL built-in type names (`integer`, `text`, `json`, …) /// and gives each EQL version a distinct column-type namespace so multiple /// versions can coexist in one database. Catalog names stay bare — the prefix /// is applied only at SQL-name construction (file names, REQUIRE paths, /// struct idents, and test names all keep the bare name). pub fn public_typname(name: &str) -> String { - format!("{}{name}", eql_domains::PUBLIC_TYPNAME_PREFIX) + format!("{PUBLIC_TYPNAME_PREFIX}{name}") } /// The schema-qualified SQL domain type name, e.g. `public.eql_v3_integer_eq`. @@ -463,13 +474,13 @@ mod tests { #[test] fn domain_name_qualifies_user_domains_with_public_schema() { - assert_eq!(domain_name("integer_eq"), "public.eql_v3_integer_eq"); + assert_eq!(domain_name("integer_eq"), "public.{{prefix}}_integer_eq"); } #[test] fn public_typname_carries_version_prefix() { - assert_eq!(public_typname("integer"), "eql_v3_integer"); - assert_eq!(public_typname("text_match"), "eql_v3_text_match"); + assert_eq!(public_typname("integer"), "{{prefix}}_integer"); + assert_eq!(public_typname("text_match"), "{{prefix}}_text_match"); } #[test] diff --git a/packages/eql/crates/eql-codegen/src/generate.rs b/packages/eql/crates/eql-codegen/src/generate.rs index 2e5ac00ae..b6df602af 100644 --- a/packages/eql/crates/eql-codegen/src/generate.rs +++ b/packages/eql/crates/eql-codegen/src/generate.rs @@ -964,6 +964,22 @@ pub fn render_type(spec: &DomainFamily, out_dir: &Path) -> Vec<(PathBuf, String) rendered.push((out_dir.join(format!("{name}_aggregates.sql")), agg)); } } + // The EQL v4 range surface (ADR-0009 decisions 7 and 8): a range query + // domain per ordering term, its bound accessors and `between`. Both files + // carry `-- ONLY EQL VERSION: 4`, so the build renders them into the v4 + // bundle only. None for a family with no ordering term. + if let Some(body) = crate::range::render_range_types_file(spec) { + rendered.push(( + out_dir.join(crate::range::range_types_file(family_name)), + body, + )); + } + if let Some(body) = crate::range::render_range_functions_file(spec) { + rendered.push(( + out_dir.join(crate::range::range_functions_file(family_name)), + body, + )); + } // json_entry cross-type operators: bind the fixed // public.eql_v3_json_entry leaf to every query operand this family declares // that carries the term json_entry can serve (Term::Ope) AND whose values @@ -1150,6 +1166,65 @@ mod tests { .expect("domain name") } + // The renderers emit placeholder SQL. These shadow them, rendering their + // output as eql_v3, so the assertions below read as installed SQL and every + // rendered file is also checked to be free of literal names and unknown + // placeholders. + fn v3(sql: String) -> String { + crate::render::render_str(&sql, crate::render::EqlVersion::V3).expect("renders as eql_v3") + } + + fn render_types_file(spec: &DomainFamily) -> String { + v3(super::render_types_file(spec)) + } + + fn render_functions_file(family_name: &str, domain: &Domain) -> String { + v3(super::render_functions_file(family_name, domain)) + } + + fn render_operators_file(family_name: &str, domain: &Domain) -> String { + v3(super::render_operators_file(family_name, domain)) + } + + fn render_aggregates_file(family_name: &str, domain: &Domain) -> Option { + super::render_aggregates_file(family_name, domain).map(v3) + } + + fn render_ore_fallback_file() -> String { + v3(super::render_ore_fallback_file()) + } + + fn render_json_entry_cross_functions( + spec: &DomainFamily, + domains: &[&Domain], + blocked_domains: &[&Domain], + ) -> String { + v3(super::render_json_entry_cross_functions( + spec, + domains, + blocked_domains, + )) + } + + fn render_json_entry_cross_operators( + spec: &DomainFamily, + domains: &[&Domain], + blocked_domains: &[&Domain], + ) -> String { + v3(super::render_json_entry_cross_operators( + spec, + domains, + blocked_domains, + )) + } + + fn render_type(spec: &DomainFamily, out_dir: &Path) -> Vec<(PathBuf, String)> { + super::render_type(spec, out_dir) + .into_iter() + .map(|(p, sql)| (p, v3(sql))) + .collect() + } + use std::fs; #[test] @@ -1219,10 +1294,13 @@ mod tests { // Query-operand + json_entry cross-type files for the term-bearing domains. assert!(names.contains(&"json_entry_integer_functions.sql".to_string())); assert!(names.contains(&"json_entry_integer_operators.sql".to_string())); + // The EQL v4 range surface: domains, then accessors and `between`. + assert!(names.contains(&"query_integer_range_types.sql".to_string())); + assert!(names.contains(&"query_integer_range_functions.sql".to_string())); // 1 types + 1 query_types + 2 per domain (5) + 2 query per term-bearing // domain (4) + 3 ord-capable aggregates = 1+1+10+8+3 = 23, plus the 2 - // json_entry cross files. - assert_eq!(written.len(), 25); + // json_entry cross files and the 2 range files. + assert_eq!(written.len(), 27); for p in &written { assert!(fs::read_to_string(p) .unwrap() @@ -1873,8 +1951,8 @@ mod tests { shape: Shape::Scalar, }, ); - assert_eq!(block.typname, "eql_v3_integer_q"); // no quote present → unchanged - // keys are sql_str-escaped key tokens; none should carry a bare unescaped quote. + assert_eq!(block.typname, "{{prefix}}_integer_q"); // no quote present → unchanged + // keys are sql_str-escaped key tokens; none should carry a bare unescaped quote. assert!(block.keys.iter().all(|k| !k.contains("o'"))); } @@ -2169,7 +2247,7 @@ mod tests { fn json_entry_type_is_derived_from_the_catalog() { // Not a hardcoded literal: a catalog rename or PUBLIC_TYPNAME_PREFIX bump // must flow through rather than silently drift (cf. #398 jsonb -> json). - assert_eq!(json_entry_type(), "public.eql_v3_json_entry"); + assert_eq!(json_entry_type(), "public.{{prefix}}_json_entry"); assert_eq!(json_entry_stem("integer"), "json_entry_integer"); assert_eq!( json_entry_functions_path("integer"), diff --git a/packages/eql/crates/eql-codegen/src/go_eql.rs b/packages/eql/crates/eql-codegen/src/go_eql.rs index 0389e2921..1f4d41634 100644 --- a/packages/eql/crates/eql-codegen/src/go_eql.rs +++ b/packages/eql/crates/eql-codegen/src/go_eql.rs @@ -127,7 +127,15 @@ pub fn render_go_eql() -> String { ) }; let status = match (row.reason, row.plaintext) { - (None, Some(kind)) => format!("The engine produces it from a {kind}."), + (None, Some(kind)) => { + // The Go kinds are read as words: "an int32", "a float64". + let article = if kind.starts_with(['a', 'e', 'i', 'o', 'u']) { + "an" + } else { + "a" + }; + format!("The engine produces it from {article} {kind}.") + } (None, None) => "The engine produces it.".to_owned(), (Some(reason), _) => format!("The engine cannot produce it yet: {reason}."), }; @@ -147,9 +155,39 @@ pub fn render_go_eql() -> String { methods(&mut out, &query_go, query_domain); } } + range_types(&mut out); out } +/// The range query types: one per family and ordering term, the operand of +/// `eql_v4.between` (ADR-0009 decision 7), so a `Between` term binds as one +/// parameter. Each holds the JSON `{"v", "i", "lo", "hi"}` value as bytes, +/// like every other query type. Not in the `Types` table, which lists +/// stored types; no stored type is producible yet for a range to query. +fn range_types(out: &mut String) { + for family in eql_domains::families_with_scalar_domains() { + for term in family.range_terms() { + let go = go_name(&family.range_struct_ident(term)); + let domain = crate::range::range_sql_domain(family, term); + let index = crate::targets::index_key(term); + let columns: Vec = family + .range_columns(term) + .iter() + .map(|d| go_name(&d.rust_struct_name(family.name))) + .collect(); + let _ = write!( + out, + "\n// {go} is a range query value over the {index} index of the {family} family: \ + both bounds of one BETWEEN,\n// included, as the one operand {domain} takes in \ + eql_v4.between. It ranges over {columns}.\ntype {go} []byte\n", + family = family.name, + columns = columns.join(", "), + ); + methods(out, &go, &domain); + } + } +} + /// Write `eql_gen.go` under `out_root` (the EQL subtree root, or the /// override `EQL_CODEGEN_OUT_ROOT`). Returns the path written. pub fn generate_go_eql(out_root: &Path) -> std::io::Result { @@ -204,15 +242,50 @@ mod tests { assert_eq!(out.matches("\ntype JSON []byte\n").count(), 1); assert_eq!(out.matches("\ntype SteVecQuery []byte\n").count(), 1); // TextEq is producible and says so; TextOrdOre is not and says why. - assert!(out.contains("// TextEq is the EQL type stored in public.eql_v3_text_eq")); + assert!(out.contains("// TextEq is the EQL type stored in public.eql_v4_text_eq")); assert!(out.contains("Producible: true, Reason: \"\"")); - assert!(out.contains("Name: \"TextOrdOre\"") && out.contains("CLLW")); + assert!(out.contains("Name: \"TextOrdOre\"") && out.contains("block ORE terms")); // Every table row is one line: the shape gofmt leaves alone. for line in out.lines().filter(|l| l.starts_with("\t{Name: ")) { assert!(line.ends_with("},"), "{line}"); } } + #[test] + fn the_package_has_one_range_type_per_family_and_ordering_term() { + let out = render_go_eql(); + let mut count = 0; + for family in eql_domains::families_with_scalar_domains() { + for term in family.range_terms() { + let go = family.range_struct_ident(term); + assert_eq!( + out.matches(&format!("\ntype {go} []byte\n")).count(), + 1, + "{go}" + ); + assert!(out.contains(&format!("func (v {go}) Value() (driver.Value, error)"))); + count += 1; + } + } + assert_eq!(count, 18, "nine ordered families, ORE and OPE each"); + assert!(out.contains( + "// IntegerRangeOreQuery is a range query value over the ore index of the integer family: \ + both bounds of one BETWEEN,\n// included, as the one operand eql_v4.query_integer_range_ore \ + takes in eql_v4.between. It ranges over IntegerOrdOre.\n" + )); + assert!(out.contains("It ranges over TextOrd, TextOrdOpe, TextSearch.\n")); + // Range types are query types, not stored ones: not in the table. + assert!(!out.contains("Name: \"IntegerRangeOreQuery\"")); + } + + #[test] + fn the_plaintext_kind_takes_the_article_it_is_read_with() { + let out = render_go_eql(); + assert!(out.contains("The engine produces it from an int32.")); + assert!(out.contains("The engine produces it from a float64.")); + assert!(!out.contains("from a int"), "a int32 or a int64"); + } + #[test] fn rendering_is_deterministic() { assert_eq!(render_go_eql(), render_go_eql()); diff --git a/packages/eql/crates/eql-codegen/src/lib.rs b/packages/eql/crates/eql-codegen/src/lib.rs index 03cdf3e48..02137825b 100644 --- a/packages/eql/crates/eql-codegen/src/lib.rs +++ b/packages/eql/crates/eql-codegen/src/lib.rs @@ -15,6 +15,8 @@ pub mod generate; pub mod go_eql; pub mod operator_surface; pub mod ordering; +pub mod range; +pub mod render; pub mod targets; pub mod writer; @@ -31,7 +33,11 @@ pub fn repo_root() -> PathBuf { .to_path_buf() } -/// The schemas the eql_v3 surface owns, public first: `[SCHEMA, INTERNAL_SCHEMA]`. +/// The schemas the SQL surface owns, public first: `[SCHEMA, INTERNAL_SCHEMA]`. +/// +/// These are placeholder source (`{{prefix}}`, `{{prefix}}_internal`), like the +/// SQL they are compared with; render them with [`render::render_str`] for one +/// EQL version's real names, as `list-schemas` does. /// /// Public accessor over the crate-private `consts::SCHEMA` / `INTERNAL_SCHEMA` /// so the binary (`list-schemas`) and the `test:schemas:parity` gate can read diff --git a/packages/eql/crates/eql-codegen/src/main.rs b/packages/eql/crates/eql-codegen/src/main.rs index 2dc95b195..5c473d439 100644 --- a/packages/eql/crates/eql-codegen/src/main.rs +++ b/packages/eql/crates/eql-codegen/src/main.rs @@ -26,13 +26,31 @@ fn main() -> ExitCode { return ExitCode::SUCCESS; } - // `list-schemas`: print the schemas the eql_v3 surface owns, public first, - // one per line. Consumed by `mise run test:schemas:parity`, which compares - // this against the SQL `eql_v3_internal.owned_schemas()` array in - // src/v3/schema.sql so the Rust consts and the SQL cannot drift. - if args.len() == 2 && args[1] == "list-schemas" { + // `list-schemas [3|4]`: print the schemas one EQL version's surface owns + // (default 3), rendered, public first, one per line. Consumed by + // `mise run test:schemas:parity`, which compares this against the rendered + // SQL `owned_schemas()` array in src/v3/schema.sql so the Rust consts and + // the SQL cannot drift. + if (args.len() == 2 || args.len() == 3) && args[1] == "list-schemas" { + let version = match args + .get(2) + .map_or(Ok(eql_codegen::render::EqlVersion::V3), |v| { + v.parse::() + }) { + Ok(v) => v, + Err(e) => { + eprintln!("error: {e}"); + return ExitCode::from(2); + } + }; for schema in eql_codegen::owned_schemas() { - println!("{schema}"); + match eql_codegen::render::render_str(schema, version) { + Ok(name) => println!("{name}"), + Err(e) => { + eprintln!("error: {e}"); + return ExitCode::FAILURE; + } + } } return ExitCode::SUCCESS; } @@ -117,6 +135,86 @@ fn main() -> ExitCode { } } + // `render <3|4> ...`: write each placeholder source file + // (relative to the working directory) as that EQL version, to the same + // relative path under . Consumed by tasks/build.sh, which renders + // the ordered surface and assembles the installer from the result. + if args.len() >= 4 && args[1] == "render" { + let version = match args[2].parse::() { + Ok(v) => v, + Err(e) => { + eprintln!("error: {e}"); + return ExitCode::from(2); + } + }; + let files: Vec = args[4..].iter().map(PathBuf::from).collect(); + // An empty file list writes nothing and would exit 0, so an empty + // order file in build.sh would surface later as a confusing "missing" + // error rather than here. + if files.is_empty() { + eprintln!("error: render needs at least one file: render <3|4> ..."); + return ExitCode::from(2); + } + return match eql_codegen::render::render_files( + std::path::Path::new("."), + &files, + std::path::Path::new(&args[3]), + version, + ) { + Ok(()) => ExitCode::SUCCESS, + Err(e) => { + eprintln!("error: {e}"); + ExitCode::FAILURE + } + }; + } + + // `select <3|4> ...`: print, in the order given, the files that + // belong to that EQL version: every file but one confined to the other + // version by a `-- ONLY EQL VERSION:` line. A kept file that `-- REQUIRE:`s + // a dropped one is refused. tasks/build.sh runs the + // install order through this before rendering each version's bundle, so + // the v4-only range surface never reaches the v3 installer. + if args.len() >= 3 && args[1] == "select" { + let version = match args[2].parse::() { + Ok(v) => v, + Err(e) => { + eprintln!("error: {e}"); + return ExitCode::from(2); + } + }; + let mut sources = Vec::new(); + for file in &args[3..] { + match std::fs::read_to_string(file) { + Ok(src) => sources.push((file.clone(), src)), + Err(e) => { + eprintln!("error: {file}: {e}"); + return ExitCode::FAILURE; + } + } + } + // Refuses a kept file that requires a dropped one, so each + // version's order stays closed under `-- REQUIRE:`. + let selected = match eql_codegen::render::select(&sources, version) { + Ok(selected) => selected, + Err(e) => { + eprintln!("error: {e}"); + return ExitCode::FAILURE; + } + }; + if selected.is_empty() { + eprintln!( + "error: select chose no file for EQL version {}", + version.number() + ); + return ExitCode::FAILURE; + } + for file in selected { + println!("{file}"); + } + return ExitCode::SUCCESS; + } + // `clean`: remove the generated SQL surface (marker-aware) under every // src/v3/scalars/* type dir. Replaces build.sh's filename-pattern sweep; // hand-written files (no AUTO-GENERATED marker) are preserved. @@ -152,8 +250,12 @@ fn main() -> ExitCode { eprintln!("Usage: eql-codegen (generate all types)"); eprintln!(" eql-codegen order (print the src/v3 install order, one path per line)"); eprintln!(" eql-codegen clean (remove the generated SQL surface)"); + eprintln!(" eql-codegen render <3|4> ... (render placeholder SQL as one EQL version)"); + eprintln!(" eql-codegen select <3|4> ... (print the files that belong to one EQL version)"); eprintln!(" eql-codegen list-types (print catalog tokens)"); - eprintln!(" eql-codegen list-schemas (print owned schemas, public first)"); + eprintln!( + " eql-codegen list-schemas [3|4] (print owned schemas, rendered, public first)" + ); eprintln!(" eql-codegen dump-catalog (print catalog surface as JSON)"); eprintln!(" eql-codegen bindings (regenerate eql-bindings Rust payload types)"); eprintln!(" eql-codegen go-eql (regenerate the Go package encrypt/eql)"); diff --git a/packages/eql/crates/eql-codegen/src/range.rs b/packages/eql/crates/eql-codegen/src/range.rs new file mode 100644 index 000000000..8c31f5d13 --- /dev/null +++ b/packages/eql/crates/eql-codegen/src/range.rs @@ -0,0 +1,617 @@ +//! The EQL v4 range surface: one range query domain per (family, ordering +//! term), its two bound accessors, and `between(column, range)` for every +//! stored domain that carries the term (ADR-0009, decisions 7 and 8). +//! +//! A `Between` query is one term holding both bounds (Stack Encrypt's +//! `RangeQuery`), and in SQL it stays one operand: +//! +//! ```sql +//! WHERE eql_v4.between(age, $1::eql_v4.query_integer_range_ore) +//! ``` +//! +//! Each bound is the single-bound domain's `ob` (ORE) or `op` (OPE) value, in +//! a `{v, i, lo, hi}` envelope ([`RANGE_BOUND_KEYS`]): a bound of an ORE range +//! is an `ob` array, a bound of an OPE range an `op` hex string. The engine +//! does not build that envelope yet; it will need to when the ordered EQL +//! types become producible. +//! +//! The range parameter must be cast to its exact range domain. `between` has +//! many overloads over jsonb-backed domains, and PostgreSQL resolves a +//! function's domain arguments as their base type, so an uncast `$1`, a +//! `jsonb` parameter, or a range of the wrong term or family matches several +//! overloads and fails with 42725 ("function ... is not unique") before the +//! query runs. The single-bound operators resolve an untyped `$1`; +//! `between` does not. +//! +//! EQL v3 has none of this. v3 is what cipherstash-client writes, and nothing +//! there produces a range. Both files carry the `-- ONLY EQL VERSION: 4` line +//! ([`ONLY_DIRECTIVE`]), so the build renders +//! them into the v4 bundle only, and the renderer refuses to render them as v3. + +use eql_domains::{DomainFamily, Term, RANGE_BOUND_KEYS}; + +use crate::consts::{sql_str, INTERNAL_SCHEMA}; +use crate::context::{domain_name, environment, query_domain_name}; +use crate::render::{EqlVersion, ONLY_DIRECTIVE}; + +/// The version the range surface belongs to. +pub const RANGE_VERSION: EqlVersion = EqlVersion::V4; + +/// The directive line every range file carries: `-- ONLY EQL VERSION: 4`. +pub fn only_directive() -> String { + format!("{ONLY_DIRECTIVE} {}", RANGE_VERSION.number()) +} + +/// The file holding a family's range domains: `query_integer_range_types.sql`. +pub fn range_types_file(family_name: &str) -> String { + format!("query_{family_name}_range_types.sql") +} + +/// The file holding a family's bound accessors and `between` overloads. +pub fn range_functions_file(family_name: &str) -> String { + format!("query_{family_name}_range_functions.sql") +} + +/// How a term reads in prose: `block ORE`, `CLLW OPE`. The SQL comments +/// and the binding structs' docs both read it here. +pub fn term_label(term: Term) -> &'static str { + match term { + Term::Ore => "block ORE", + Term::Ope => "CLLW OPE", + Term::Hm | Term::Bloom => unreachable!("{term:?} has no range domain"), + } +} + +/// The CHECK clauses one bound of a `term` range must satisfy: the shape the +/// single-bound query domain's term key has. An ORE bound is a non-empty +/// array of block terms, as `ob` is; an OPE bound is a hex string, as `op` is. +fn bound_checks(term: Term, bound: &str) -> Vec { + let bound = sql_str(bound); + match term { + Term::Ore => vec![ + format!("jsonb_typeof(VALUE -> '{bound}') = 'array'"), + format!("jsonb_array_length(VALUE -> '{bound}') > 0"), + ], + Term::Ope => vec![format!("jsonb_typeof(VALUE -> '{bound}') = 'string'")], + Term::Hm | Term::Bloom => unreachable!("{term:?} has no range domain"), + } +} + +/// The keys a range value must carry, in order: the envelope's `v` and `i`, +/// then the bounds ([`RANGE_BOUND_KEYS`]). What the domain CHECK requires +/// and what the binding structs' docs list. +pub fn range_required_keys() -> impl Iterator { + ["v", "i"].into_iter().chain(RANGE_BOUND_KEYS) +} + +#[derive(serde::Serialize)] +struct RangeDomainBlock { + name: String, + typname: String, + term_label: &'static str, + keys: Vec, + bound_checks: Vec, + comment: String, +} + +/// An ORE range domain the file disables when the install has no ORE +/// operator class, as `ore_fallback.sql` disables the single-bound ORE +/// domains: `name` for the identifier position, `name_literal` sql_str-escaped +/// for the poison error's message, `alternatives` for its hint. +#[derive(serde::Serialize)] +struct OreRangeFallback { + name: String, + name_literal: String, + alternatives: String, +} + +#[derive(serde::Serialize)] +struct RangeTypesContext { + only_directive: String, + family_name: String, + requires: Vec, + domains: Vec, + ore_ranges: Vec, +} + +/// The file whose poison function an ORE range's fallback calls. +const ORE_FALLBACK: &str = "src/v3/scalars/ore_fallback.sql"; + +/// The poison hint for an ORE range: the family's OPE range, which needs no +/// operator class. Every family with an ORE range has one today; a future +/// family without must still render a sentence. +fn ore_range_alternatives(spec: &DomainFamily) -> String { + if spec.range_terms().contains(&Term::Ope) { + format!( + "{} (range)", + query_domain_name(&spec.range_query_name(Term::Ope)) + ) + } else { + "a non-ORE encrypted domain".to_string() + } +} + +/// Body of `query__range_types.sql`, or `None` for a family with no +/// ordering term. +/// +/// An ORE range domain is disabled on an install without the ORE operator +/// class, as the single-bound ORE domains are. `ore_fallback.sql` cannot do +/// it, since it is shared with EQL v3 and the range domains are v4 only, so +/// this file adds the same NOT VALID poison CHECK to its own ORE range, +/// calling the function `ore_fallback.sql` creates under the same condition. +pub fn render_range_types_file(spec: &DomainFamily) -> Option { + let terms = spec.range_terms(); + if terms.is_empty() { + return None; + } + let domains = terms + .iter() + .map(|&term| { + let name = spec.range_query_name(term); + RangeDomainBlock { + typname: sql_str(&name), + name, + term_label: term_label(term), + keys: range_required_keys().map(sql_str).collect(), + bound_checks: RANGE_BOUND_KEYS + .iter() + .flat_map(|b| bound_checks(term, b)) + .collect(), + comment: sql_str(&format!( + "EQL {} range query operand ({})", + spec.name, + term_label(term) + )), + } + }) + .collect(); + let ore_ranges: Vec = terms + .iter() + .filter(|&&t| t == Term::Ore) + .map(|&t| { + let name = query_domain_name(&spec.range_query_name(t)); + OreRangeFallback { + name_literal: sql_str(&name), + name, + alternatives: sql_str(&ore_range_alternatives(spec)), + } + }) + .collect(); + let mut requires = vec!["src/v3/schema.sql".to_string()]; + if !ore_ranges.is_empty() { + requires.push(ORE_FALLBACK.to_string()); + } + let ctx = RangeTypesContext { + only_directive: only_directive(), + family_name: spec.name.to_string(), + requires, + domains, + ore_ranges, + }; + Some( + environment() + .get_template("range_types.sql") + .unwrap() + .render(&ctx) + .expect("render range_types.sql"), + ) +} + +#[derive(serde::Serialize)] +struct Accessor { + side: &'static str, + function_name: &'static str, + range: String, + term_label: &'static str, + returns: String, + body: String, +} + +#[derive(serde::Serialize)] +struct Between { + column: String, + range: String, + extractor: &'static str, + /// An ORE range, whose index needs the opclass a non-superuser + /// install skips: the generated docs say so. + ore: bool, + /// For an ORE range, the family's OPE column domains and OPE range, + /// which the generated docs point to instead. Empty otherwise. + ope_columns: String, + ope_range: String, +} + +#[derive(serde::Serialize)] +struct RangeFunctionsContext { + only_directive: String, + family_name: String, + requires: Vec, + accessors: Vec, + betweens: Vec, +} + +/// Body of `query__range_functions.sql`, or `None` for a family with no +/// ordering term: `lo` and `hi` for each range domain (in the internal +/// schema: only `between` calls them), then +/// `between(column, range)` for each stored domain carrying the range's term. +/// +/// An accessor reads its bound with the term's own constructor +/// (`ore_block_256` / `ope_cllw` over `{"ob": …}` / `{"op": …}`), the one +/// path a single-bound term is read by. `between` compares the column's +/// extractor, the expression a functional index is built on, against both. +pub fn render_range_functions_file(spec: &DomainFamily) -> Option { + let terms = spec.range_terms(); + if terms.is_empty() { + return None; + } + let family_name = spec.name; + let mut requires = vec![ + "src/v3/schema.sql".to_string(), + format!( + "src/v3/scalars/{family_name}/{}", + range_types_file(family_name) + ), + ]; + let mut accessors = Vec::new(); + let mut betweens = Vec::new(); + let ope_columns = spec + .range_columns(Term::Ope) + .iter() + .map(|d| format!("`{}`", domain_name(&d.full_name(family_name)))) + .collect::>() + .join(", "); + let ope_range = if terms.contains(&Term::Ope) { + format!("`{}`", query_domain_name(&spec.range_query_name(Term::Ope))) + } else { + String::new() + }; + for &term in &terms { + let range = spec.range_query_name(term); + let returns = format!("{INTERNAL_SCHEMA}.{}", term.ctor()); + for (side, function_name, bound) in [ + ("low", "lo", RANGE_BOUND_KEYS[0]), + ("high", "hi", RANGE_BOUND_KEYS[1]), + ] { + accessors.push(Accessor { + side, + function_name, + range: range.clone(), + term_label: term_label(term), + returns: returns.clone(), + body: format!( + "{INTERNAL_SCHEMA}.{}(jsonb_build_object('{}', r::jsonb -> '{}'))", + term.ctor(), + sql_str(term.json_key()), + sql_str(bound) + ), + }); + } + for domain in spec.range_columns(term) { + let full = domain.full_name(family_name); + let functions = format!("src/v3/scalars/{family_name}/{full}_functions.sql"); + if !requires.contains(&functions) { + requires.push(functions); + } + betweens.push(Between { + column: domain_name(&full), + range: range.clone(), + extractor: term.extractor(), + ore: term == Term::Ore, + ope_columns: if term == Term::Ore { + ope_columns.clone() + } else { + String::new() + }, + ope_range: if term == Term::Ore { + ope_range.clone() + } else { + String::new() + }, + }); + } + } + for extra in Term::term_requires(&terms) { + if !requires.iter().any(|r| r == extra) { + requires.push(extra.to_string()); + } + } + let ctx = RangeFunctionsContext { + only_directive: only_directive(), + family_name: family_name.to_string(), + requires, + accessors, + betweens, + }; + Some( + environment() + .get_template("range_functions.sql") + .unwrap() + .render(&ctx) + .expect("render range_functions.sql"), + ) +} + +/// The schema-qualified range domain for `term` under `spec`, as a v4 SQL +/// name: `eql_v4.query_integer_range_ore`. What the bindings name. +pub fn range_sql_domain(spec: &DomainFamily, term: Term) -> String { + format!("{}.{}", RANGE_VERSION.prefix(), spec.range_query_name(term)) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::render::{belongs_to, render_str}; + use eql_domains::{BOOLEAN, CATALOG, JSON, TEXT}; + + fn integer() -> &'static DomainFamily { + CATALOG.iter().find(|f| f.name == "integer").unwrap() + } + + #[test] + fn a_family_without_ordering_has_no_range_files() { + for f in [&BOOLEAN, &JSON] { + assert!(render_range_types_file(f).is_none(), "{}", f.name); + assert!(render_range_functions_file(f).is_none(), "{}", f.name); + } + } + + #[test] + fn range_files_belong_to_eql_v4_only() { + for f in CATALOG.iter().filter(|f| !f.range_terms().is_empty()) { + for body in [ + render_range_types_file(f).unwrap(), + render_range_functions_file(f).unwrap(), + ] { + assert_eq!(body.lines().nth(1), Some("-- ONLY EQL VERSION: 4")); + assert_eq!(belongs_to(&body, EqlVersion::V4), Ok(true)); + assert_eq!(belongs_to(&body, EqlVersion::V3), Ok(false)); + assert!(render_str(&body, EqlVersion::V3).is_err()); + render_str(&body, EqlVersion::V4).unwrap(); + } + } + } + + #[test] + fn the_range_domains_check_the_bound_shape_of_their_term() { + let v4 = render_str(&render_range_types_file(integer()).unwrap(), EqlVersion::V4).unwrap(); + assert!(v4.contains("CREATE DOMAIN eql_v4.query_integer_range_ore AS jsonb")); + assert!(v4.contains("CREATE DOMAIN eql_v4.query_integer_range_ope AS jsonb")); + let ore = v4 + .split("CREATE DOMAIN eql_v4.query_integer_range_ore") + .nth(1) + .unwrap() + .split("END IF;") + .next() + .unwrap(); + for clause in [ + "VALUE ? 'v'", + "VALUE ? 'i'", + "VALUE ? 'lo'", + "VALUE ? 'hi'", + "NOT (VALUE ? 'c')", + "jsonb_typeof(VALUE -> 'lo') = 'array'", + "jsonb_array_length(VALUE -> 'lo') > 0", + "jsonb_typeof(VALUE -> 'hi') = 'array'", + "jsonb_array_length(VALUE -> 'hi') > 0", + "COALESCE(VALUE->>'v' = '4', VALUE IS NULL)", + ] { + assert!(ore.contains(clause), "ORE range lacks {clause}:\n{ore}"); + } + let ope = v4 + .split("CREATE DOMAIN eql_v4.query_integer_range_ope") + .nth(1) + .unwrap() + .split("END IF;") + .next() + .unwrap(); + assert!(ope.contains("jsonb_typeof(VALUE -> 'lo') = 'string'")); + assert!(ope.contains("jsonb_typeof(VALUE -> 'hi') = 'string'")); + assert!(!ope.contains("jsonb_array_length"), "{ope}"); + assert!(v4.contains( + "COMMENT ON DOMAIN eql_v4.query_integer_range_ore IS 'EQL integer range query operand (block ORE)'" + )); + assert!(v4.contains( + "COMMENT ON DOMAIN eql_v4.query_integer_range_ope IS 'EQL integer range query operand (CLLW OPE)'" + )); + } + + #[test] + fn between_is_inlinable_and_compares_the_column_extractor_to_both_bounds() { + let v4 = render_str( + &render_range_functions_file(integer()).unwrap(), + EqlVersion::V4, + ) + .unwrap(); + assert!(v4.contains( + "CREATE FUNCTION eql_v4.between(a public.eql_v4_integer_ord_ore, r eql_v4.query_integer_range_ore)\n\ + RETURNS boolean\n\ + LANGUAGE sql IMMUTABLE PARALLEL SAFE\n\ + AS $$ SELECT eql_v4.ord_term_ore(a) >= eql_v4_internal.lo(r) AND eql_v4.ord_term_ore(a) <= eql_v4_internal.hi(r) $$;" + ), "{v4}"); + // OPE serves both OPE-backed column domains. + for column in ["public.eql_v4_integer_ord", "public.eql_v4_integer_ord_ope"] { + assert!(v4.contains(&format!( + "CREATE FUNCTION eql_v4.between(a {column}, r eql_v4.query_integer_range_ope)\n\ + RETURNS boolean\n\ + LANGUAGE sql IMMUTABLE PARALLEL SAFE\n\ + AS $$ SELECT eql_v4.ord_term(a) >= eql_v4_internal.lo(r) AND eql_v4.ord_term(a) <= eql_v4_internal.hi(r) $$;" + )), "{column}"); + } + assert_eq!(v4.matches("CREATE FUNCTION eql_v4.between(").count(), 3); + // Inlining needs no STRICT and no SET clause on `between`. + for between in v4.split("CREATE FUNCTION eql_v4.between(").skip(1) { + let header = between.split("AS $$").next().unwrap(); + assert!(!header.contains("STRICT"), "{header}"); + assert!(!header.contains("SET "), "{header}"); + } + } + + #[test] + fn each_bound_is_read_by_its_terms_own_constructor() { + let v4 = render_str( + &render_range_functions_file(integer()).unwrap(), + EqlVersion::V4, + ) + .unwrap(); + for (side, bound) in [("lo", "lo"), ("hi", "hi")] { + assert!(v4.contains(&format!( + "CREATE FUNCTION eql_v4_internal.{side}(r eql_v4.query_integer_range_ore)\n\ + RETURNS eql_v4_internal.ore_block_256\n\ + LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE\n\ + AS $$ SELECT eql_v4_internal.ore_block_256(jsonb_build_object('ob', r::jsonb -> '{bound}')) $$;" + )), "{side} ORE"); + assert!(v4.contains(&format!( + "CREATE FUNCTION eql_v4_internal.{side}(r eql_v4.query_integer_range_ope)\n\ + RETURNS eql_v4_internal.ope_cllw\n\ + LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE\n\ + AS $$ SELECT eql_v4_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> '{bound}')) $$;" + )), "{side} OPE"); + } + } + + #[test] + fn the_functions_file_requires_what_it_calls() { + let body = render_range_functions_file(&TEXT).unwrap(); + let requires: Vec<&str> = body + .lines() + .filter_map(|l| l.strip_prefix("-- REQUIRE: ")) + .collect(); + assert_eq!( + requires, + [ + "src/v3/schema.sql", + "src/v3/scalars/text/query_text_range_types.sql", + "src/v3/scalars/text/text_ord_ore_functions.sql", + "src/v3/scalars/text/text_search_ore_functions.sql", + "src/v3/scalars/text/text_ord_functions.sql", + "src/v3/scalars/text/text_ord_ope_functions.sql", + "src/v3/scalars/text/text_search_functions.sql", + "src/v3/sem/ore_block_256/functions.sql", + "src/v3/sem/ore_block_256/operators.sql", + "src/v3/sem/ope_cllw/functions.sql", + ] + ); + // Five text column domains carry an ordering term: five overloads. + assert_eq!( + body.matches("CREATE FUNCTION {{prefix}}.between(").count(), + 5 + ); + assert_eq!( + body.matches("CREATE FUNCTION {{prefix}}_internal.lo(") + .count(), + 2 + ); + assert_eq!( + body.matches("CREATE FUNCTION {{prefix}}_internal.hi(") + .count(), + 2 + ); + } + + /// Only the ORE `between` overloads say their index needs the + /// `ore_block_256` btree opclass, which a non-superuser install skips; + /// the OPE ones index everywhere. + #[test] + fn the_ore_overloads_name_the_opclass_they_need() { + let body = render_range_functions_file(integer()).unwrap(); + for overload in body.split("--! @brief Whether ").skip(1) { + let ore = overload.contains("_range_ore)"); + assert_eq!( + overload.contains("default btree operator class"), + ore, + "{overload}" + ); + } + } + + /// The ORE note names the family's own OPE columns and OPE range, not a + /// fixed list: only text has a `_search` domain. + #[test] + fn the_ore_note_names_the_familys_own_ope_columns() { + let integer = render_range_functions_file(integer()).unwrap(); + assert!( + integer.contains( + "use an OPE column (`public.{{prefix}}_integer_ord`, \ + `public.{{prefix}}_integer_ord_ope`)\n--! and `{{prefix}}.query_integer_range_ope`" + ), + "{integer}" + ); + assert!(!integer.contains("_search"), "{integer}"); + let text = render_range_functions_file(&TEXT).unwrap(); + assert!(text.contains("`public.{{prefix}}_text_search`"), "{text}"); + } + + /// An ORE range is disabled where the single-bound ORE domains are: the + /// file requires `ore_fallback.sql`, whose poison function it calls, and + /// adds the poison CHECK to the ORE range alone, behind the same opclass + /// check, with the OPE range as the hint. + #[test] + fn the_ore_range_is_disabled_without_the_ore_opclass() { + for f in CATALOG.iter().filter(|f| !f.range_terms().is_empty()) { + let body = render_range_types_file(f).unwrap(); + let ore = f.range_terms().contains(&Term::Ore); + assert_eq!( + body.contains("-- REQUIRE: src/v3/scalars/ore_fallback.sql"), + ore, + "{}", + f.name + ); + let v4 = render_str(&body, EqlVersion::V4).unwrap(); + let alters: Vec<&str> = v4 + .lines() + .filter(|l| l.contains("ADD CONSTRAINT eql_ore_unavailable")) + .collect(); + if !ore { + assert!(alters.is_empty(), "{}", f.name); + continue; + } + let name = format!("eql_v4.query_{}_range_ore", f.name); + assert_eq!( + alters, + [format!( + " ALTER DOMAIN {name} ADD CONSTRAINT eql_ore_unavailable" + )], + "{}", + f.name + ); + assert!( + v4.contains(&format!( + "CHECK (eql_v4_internal.ore_domain_unavailable(VALUE, '{name}', \ + 'eql_v4.query_{}_range_ope (range)')) NOT VALID;", + f.name + )), + "{v4}" + ); + assert!(v4 + .contains("AND c.opcintype = 'eql_v4_internal.ore_block_256'::pg_catalog.regtype")); + } + } + + #[test] + fn every_function_is_documented() { + for f in CATALOG.iter().filter(|f| !f.range_terms().is_empty()) { + let body = render_range_functions_file(f).unwrap(); + let functions = body.matches("\nCREATE FUNCTION ").count(); + assert_eq!( + body.matches("\n--! @brief ").count(), + functions + 1, + "{}", + f.name + ); + assert_eq!( + body.matches("\n--! @return ").count(), + functions, + "{}", + f.name + ); + } + } + + #[test] + fn the_sql_domain_names_the_v4_schema() { + assert_eq!( + range_sql_domain(integer(), Term::Ope), + "eql_v4.query_integer_range_ope" + ); + } +} diff --git a/packages/eql/crates/eql-codegen/src/render.rs b/packages/eql/crates/eql-codegen/src/render.rs new file mode 100644 index 000000000..6f39f3b01 --- /dev/null +++ b/packages/eql/crates/eql-codegen/src/render.rs @@ -0,0 +1,644 @@ +//! Renders the EQL SQL source as one EQL version. +//! +//! The SQL under `src/v3` names its schemas and its payload version by +//! placeholder, never literally, so one source can be written out under two +//! names (ADR-0002): `eql_v3` for cipherstash-client's terms and `eql_v4` for +//! Stack Encrypt's. Postgres then refuses to compare a query term of one with a +//! column of the other, at plan time. +//! +//! | placeholder | `eql_v3` | `eql_v4` | +//! |-------------------|----------|----------| +//! | `{{prefix}}` | `eql_v3` | `eql_v4` | +//! | `{{eql_version}}` | `3` | `4` | +//! +//! `{{prefix}}` is both the schema (`{{prefix}}.eq_term`) and the start of every +//! other name (`{{prefix}}_internal`, `public.{{prefix}}_text_eq`). +//! +//! Rendering is strict in both directions. An unknown or unterminated +//! placeholder is an error, and so is a literal `eql_v3` or `eql_v4` in the +//! source: a literal name would render the same in both outputs, so the `eql_v4` +//! bundle would quietly reach into `eql_v3`. +//! +//! A file belongs to every version unless it says otherwise with one line, +//! [`ONLY_DIRECTIVE`] and a version number: `-- ONLY EQL VERSION: 4`. That is +//! how a surface EQL v4 has and EQL v3 must not (the range query domains and +//! `between`, ADR-0009 decision 7) shares the one source tree: the build +//! renders a file only for the version it belongs to ([`belongs_to`]), and +//! [`render_str`] refuses to render it as any other. + +use std::fmt; +use std::fs; +use std::io; +use std::path::{Component, Path, PathBuf}; + +/// The schema-and-name prefix placeholder. +pub const PREFIX: &str = "{{prefix}}"; + +/// The payload-version placeholder. +pub const EQL_VERSION: &str = "{{eql_version}}"; + +/// The start of the line that confines a source file to one EQL version: +/// `-- ONLY EQL VERSION: 4`. At most one per file; a file without one belongs +/// to every version. The number is the payload version ([`EqlVersion::number`]), +/// not the schema name, because the source may not name a schema literally. +pub const ONLY_DIRECTIVE: &str = "-- ONLY EQL VERSION:"; + +/// An EQL version the source can be rendered as. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum EqlVersion { + /// `eql_v3`: payloads and terms written by cipherstash-client. + V3, + /// `eql_v4`: payloads and terms written by Stack Encrypt. + V4, +} + +impl EqlVersion { + /// Every version, in release order. + pub const ALL: [EqlVersion; 2] = [EqlVersion::V3, EqlVersion::V4]; + + /// The payload version, as the domain CHECKs compare it: `"3"` or `"4"`. + pub fn number(self) -> &'static str { + match self { + EqlVersion::V3 => "3", + EqlVersion::V4 => "4", + } + } + + /// The schema and name prefix: `eql_v3` or `eql_v4`. + pub fn prefix(self) -> &'static str { + match self { + EqlVersion::V3 => "eql_v3", + EqlVersion::V4 => "eql_v4", + } + } +} + +impl std::str::FromStr for EqlVersion { + type Err = String; + + fn from_str(s: &str) -> Result { + EqlVersion::ALL + .into_iter() + .find(|v| v.number() == s) + .ok_or_else(|| format!("unknown EQL version {s:?} (expected 3 or 4)")) + } +} + +/// Why a source could not be rendered. `line` is 1-based. +#[derive(Debug, PartialEq, Eq)] +pub enum RenderError { + /// `{{name}}` where `name` is not a placeholder this renderer knows. + UnknownPlaceholder { line: usize, name: String }, + /// `{{` with no closing `}}` on the same line. + Unterminated { line: usize }, + /// A literal `eql_v3` or `eql_v4` where a placeholder belongs. + LiteralName { line: usize, literal: &'static str }, + /// An [`ONLY_DIRECTIVE`] line that does not name a version. + BadOnlyDirective { line: usize, value: String }, + /// A second [`ONLY_DIRECTIVE`] line. + DuplicateOnlyDirective { line: usize }, + /// A file confined to another version, rendered as this one. + OtherVersion { + line: usize, + only: EqlVersion, + version: EqlVersion, + }, +} + +impl fmt::Display for RenderError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + RenderError::UnknownPlaceholder { line, name } => write!( + f, + "line {line}: unknown placeholder {{{{{name}}}}} (expected {PREFIX} or {EQL_VERSION})" + ), + RenderError::Unterminated { line } => { + write!(f, "line {line}: `{{{{` with no closing `}}}}`") + } + RenderError::LiteralName { line, literal } => write!( + f, + "line {line}: literal `{literal}`; write {PREFIX} in its place, in comments too, \ + so the name follows the EQL version (`{literal}_internal` is \ + `{PREFIX}_internal`)" + ), + RenderError::BadOnlyDirective { line, value } => write!( + f, + "line {line}: `{ONLY_DIRECTIVE}{value}` names no EQL version (expected \ + `{ONLY_DIRECTIVE} 3` or `{ONLY_DIRECTIVE} 4`)" + ), + RenderError::DuplicateOnlyDirective { line } => { + write!(f, "line {line}: a second `{ONLY_DIRECTIVE}` line") + } + RenderError::OtherVersion { + line, + only, + version, + } => write!( + f, + "line {line}: this file belongs to {} only and cannot be rendered as {}", + only.prefix(), + version.prefix() + ), + } + } +} + +impl std::error::Error for RenderError {} + +/// The one version `src` is confined to by its [`ONLY_DIRECTIVE`] line, with +/// the line's number, or `None` when it belongs to every version. +fn only_version(src: &str) -> Result, RenderError> { + let mut found = None; + for (i, line) in src.lines().enumerate() { + let Some(value) = line.strip_prefix(ONLY_DIRECTIVE) else { + continue; + }; + let lineno = i + 1; + if found.is_some() { + return Err(RenderError::DuplicateOnlyDirective { line: lineno }); + } + let version = value + .strip_prefix(' ') + .and_then(|v| v.trim_end().parse::().ok()) + .ok_or_else(|| RenderError::BadOnlyDirective { + line: lineno, + value: value.to_string(), + })?; + found = Some((lineno, version)); + } + Ok(found) +} + +/// Whether `src` belongs to `version`: true unless an [`ONLY_DIRECTIVE`] line +/// confines it to another. The build asks this of every ordered file before +/// rendering a version's bundle, so a file confined to EQL v4 never reaches +/// the EQL v3 installer. +pub fn belongs_to(src: &str, version: EqlVersion) -> Result { + Ok(only_version(src)?.is_none_or(|(_, only)| only == version)) +} + +/// The files of an install order that belong to `version`, in the order +/// given: every `(path, source)` but one confined to another version. +/// +/// The kept order must stay closed under `-- REQUIRE:`: a kept file that +/// requires a dropped one would install before (or without) what it +/// calls, and nothing later can tell, since the symbol-order gate matches +/// names without overloads. So a kept file requiring a dropped one is +/// refused, every such edge listed. +/// +/// # Errors +/// +/// A malformed directive in any file, as [`belongs_to`] reports it with the +/// file's path; or every edge from a kept file to a dropped one. +pub fn select(sources: &[(String, String)], version: EqlVersion) -> Result, String> { + let mut kept = Vec::new(); + let mut dropped = std::collections::BTreeSet::new(); + for (path, src) in sources { + match belongs_to(src, version) { + Ok(true) => kept.push((path.as_str(), src.as_str())), + Ok(false) => { + dropped.insert(path.as_str()); + } + Err(e) => return Err(format!("{path}: {e}")), + } + } + let broken: Vec = kept + .iter() + .flat_map(|(path, src)| { + crate::ordering::requires_of(src) + .into_iter() + .filter(|target| dropped.contains(target.as_str())) + .map(move |target| format!(" {path} requires {target}")) + }) + .collect(); + if !broken.is_empty() { + return Err(format!( + "these files belong to {} but require a file confined to another version:\n{}", + version.prefix(), + broken.join("\n") + )); + } + Ok(kept.into_iter().map(|(path, _)| path).collect()) +} + +/// Render one source text as `version`. A source confined to another version +/// by its [`ONLY_DIRECTIVE`] line is refused ([`RenderError::OtherVersion`]). +pub fn render_str(src: &str, version: EqlVersion) -> Result { + if let Some((line, only)) = only_version(src)? { + if only != version { + return Err(RenderError::OtherVersion { + line, + only, + version, + }); + } + } + let mut out = String::with_capacity(src.len()); + for (i, line) in src.split_inclusive('\n').enumerate() { + let lineno = i + 1; + for v in EqlVersion::ALL { + if contains_name(line, v.prefix()) { + return Err(RenderError::LiteralName { + line: lineno, + literal: v.prefix(), + }); + } + } + let mut rest = line; + while let Some(open) = rest.find("{{") { + out.push_str(&rest[..open]); + let after = &rest[open + 2..]; + let close = after + .find("}}") + .ok_or(RenderError::Unterminated { line: lineno })?; + match &after[..close] { + "prefix" => out.push_str(version.prefix()), + "eql_version" => out.push_str(version.number()), + other => { + return Err(RenderError::UnknownPlaceholder { + line: lineno, + name: other.to_string(), + }) + } + } + rest = &after[close + 2..]; + } + out.push_str(rest); + } + Ok(out) +} + +/// Whether `line` names `prefix` as a name, rather than as the start of a +/// longer version (`eql_v30`). Comments count: they are rendered into both +/// bundles and into the docs, so a literal there is wrong in one of them. +fn contains_name(line: &str, prefix: &str) -> bool { + line.match_indices(prefix).any(|(at, _)| { + !line[at + prefix.len()..] + .bytes() + .next() + .is_some_and(|b| b.is_ascii_digit()) + }) +} + +/// Why a file could not be rendered. +#[derive(Debug)] +pub enum RenderFileError { + Io { + path: PathBuf, + source: io::Error, + }, + Render { + path: PathBuf, + source: RenderError, + }, + /// A file path that is absolute or climbs out with `..`. `out.join` would + /// put its output outside `out`, or over the source itself. + NotRelative { + path: PathBuf, + }, +} + +impl fmt::Display for RenderFileError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + RenderFileError::Io { path, source } => write!(f, "{}: {source}", path.display()), + RenderFileError::Render { path, source } => { + write!(f, "{}: {source}", path.display()) + } + RenderFileError::NotRelative { path } => write!( + f, + "{}: not a relative path inside the source root", + path.display() + ), + } + } +} + +impl std::error::Error for RenderFileError {} + +/// Render each of `files` (relative to `root`) as `version`, writing it to the +/// same relative path under `out`. Every file is rendered before any is +/// written, so a source error leaves `out` as it was. A path that is absolute +/// or contains `..` is refused, since its output would land outside `out`. +pub fn render_files( + root: &Path, + files: &[PathBuf], + out: &Path, + version: EqlVersion, +) -> Result<(), RenderFileError> { + let mut rendered = Vec::with_capacity(files.len()); + for rel in files { + if !rel + .components() + .all(|c| matches!(c, Component::Normal(_) | Component::CurDir)) + { + return Err(RenderFileError::NotRelative { path: rel.clone() }); + } + let path = root.join(rel); + let src = fs::read_to_string(&path).map_err(|source| RenderFileError::Io { + path: path.clone(), + source, + })?; + let body = render_str(&src, version).map_err(|source| RenderFileError::Render { + path: path.clone(), + source, + })?; + rendered.push((out.join(rel), body)); + } + for (dest, body) in rendered { + if let Some(parent) = dest.parent() { + fs::create_dir_all(parent).map_err(|source| RenderFileError::Io { + path: parent.to_path_buf(), + source, + })?; + } + fs::write(&dest, body).map_err(|source| RenderFileError::Io { path: dest, source })?; + } + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + + const SRC: &str = "CREATE DOMAIN public.{{prefix}}_text_eq AS jsonb\n \ + CHECK (VALUE->>'v' = '{{eql_version}}');\n\ + SELECT {{prefix}}_internal.f({{prefix}}.g());\n"; + + #[test] + fn renders_v3() { + assert_eq!( + render_str(SRC, EqlVersion::V3).unwrap(), + "CREATE DOMAIN public.eql_v3_text_eq AS jsonb\n \ + CHECK (VALUE->>'v' = '3');\n\ + SELECT eql_v3_internal.f(eql_v3.g());\n" + ); + } + + #[test] + fn renders_v4() { + assert_eq!( + render_str(SRC, EqlVersion::V4).unwrap(), + "CREATE DOMAIN public.eql_v4_text_eq AS jsonb\n \ + CHECK (VALUE->>'v' = '4');\n\ + SELECT eql_v4_internal.f(eql_v4.g());\n" + ); + } + + #[test] + fn text_without_placeholders_is_unchanged() { + let src = "SELECT '{}'::jsonb, '{\"a\":1}', $$ { } $$;\n-- eql_v2 provenance\nno newline"; + assert_eq!(render_str(src, EqlVersion::V4).unwrap(), src); + } + + #[test] + fn rejects_literal_names() { + for (src, literal) in [ + ("x\nSELECT eql_v3.f();\n", "eql_v3"), + ("x\n-- eql_v4_internal\n", "eql_v4"), + ] { + assert_eq!( + render_str(src, EqlVersion::V3), + Err(RenderError::LiteralName { line: 2, literal }) + ); + } + } + + #[test] + fn a_longer_version_is_not_a_literal_name() { + let src = "SELECT eql_v30_foo, eql_v41;\n"; + assert_eq!(render_str(src, EqlVersion::V3).unwrap(), src); + assert_eq!( + render_str("eql_v30 eql_v3\n", EqlVersion::V3), + Err(RenderError::LiteralName { + line: 1, + literal: "eql_v3" + }) + ); + } + + #[test] + fn rejects_unknown_placeholder() { + assert_eq!( + render_str("{{prefix}}\n{{ prefix }}\n", EqlVersion::V3), + Err(RenderError::UnknownPlaceholder { + line: 2, + name: " prefix ".to_string() + }) + ); + } + + #[test] + fn rejects_unterminated_placeholder() { + assert_eq!( + render_str("ok\n{{prefix\n}}\n", EqlVersion::V3), + Err(RenderError::Unterminated { line: 2 }) + ); + } + + const V4_ONLY: &str = "-- AUTOMATICALLY GENERATED FILE.\n\ + -- ONLY EQL VERSION: 4\n\ + SELECT {{prefix}}.between();\n"; + + #[test] + fn a_file_without_the_directive_belongs_to_every_version() { + for v in EqlVersion::ALL { + assert_eq!(belongs_to(SRC, v), Ok(true)); + } + } + + #[test] + fn a_confined_file_belongs_to_its_version_alone_and_renders_only_as_it() { + assert_eq!(belongs_to(V4_ONLY, EqlVersion::V4), Ok(true)); + assert_eq!(belongs_to(V4_ONLY, EqlVersion::V3), Ok(false)); + assert_eq!( + render_str(V4_ONLY, EqlVersion::V4).unwrap(), + "-- AUTOMATICALLY GENERATED FILE.\n\ + -- ONLY EQL VERSION: 4\n\ + SELECT eql_v4.between();\n" + ); + let err = render_str(V4_ONLY, EqlVersion::V3).unwrap_err(); + assert_eq!( + err, + RenderError::OtherVersion { + line: 2, + only: EqlVersion::V4, + version: EqlVersion::V3 + } + ); + assert_eq!( + err.to_string(), + "line 2: this file belongs to eql_v4 only and cannot be rendered as eql_v3" + ); + // Trailing whitespace is tolerated; the version is the number. + assert_eq!( + belongs_to("-- ONLY EQL VERSION: 3 \n", EqlVersion::V3), + Ok(true) + ); + } + + fn sources(files: &[(&str, &str)]) -> Vec<(String, String)> { + files + .iter() + .map(|(p, s)| (p.to_string(), s.to_string())) + .collect() + } + + #[test] + fn select_keeps_a_versions_files_in_order() { + let files = sources(&[ + ("src/v3/a.sql", SRC), + ("src/v3/range.sql", V4_ONLY), + ("src/v3/b.sql", "-- REQUIRE: src/v3/a.sql\nSELECT 1;\n"), + ]); + assert_eq!( + select(&files, EqlVersion::V4).unwrap(), + ["src/v3/a.sql", "src/v3/range.sql", "src/v3/b.sql"] + ); + assert_eq!( + select(&files, EqlVersion::V3).unwrap(), + ["src/v3/a.sql", "src/v3/b.sql"] + ); + } + + /// A kept file that requires a dropped one would leave the version's + /// order without what it calls: refused, naming the edge. + #[test] + fn select_refuses_a_kept_file_requiring_a_dropped_one() { + let files = sources(&[ + ("src/v3/range.sql", V4_ONLY), + ("src/v3/b.sql", "-- REQUIRE: src/v3/range.sql\nSELECT 1;\n"), + ]); + assert!(select(&files, EqlVersion::V4).is_ok()); + let err = select(&files, EqlVersion::V3).unwrap_err(); + assert!( + err.contains("src/v3/b.sql requires src/v3/range.sql"), + "{err}" + ); + assert!(err.contains("belong to eql_v3"), "{err}"); + } + + #[test] + fn a_malformed_or_repeated_directive_is_refused() { + for (src, value) in [ + ("x\n-- ONLY EQL VERSION: 2\n", " 2"), + ("x\n-- ONLY EQL VERSION:4\n", "4"), + ("x\n-- ONLY EQL VERSION: v4\n", " v4"), + ("x\n-- ONLY EQL VERSION:\n", ""), + ] { + let err = belongs_to(src, EqlVersion::V4).unwrap_err(); + assert_eq!( + err, + RenderError::BadOnlyDirective { + line: 2, + value: value.to_string() + } + ); + assert!(err.to_string().starts_with("line 2: "), "{err}"); + assert_eq!(render_str(src, EqlVersion::V4), Err(err)); + } + let twice = "-- ONLY EQL VERSION: 4\n-- ONLY EQL VERSION: 4\n"; + assert_eq!( + belongs_to(twice, EqlVersion::V4), + Err(RenderError::DuplicateOnlyDirective { line: 2 }) + ); + assert_eq!( + RenderError::DuplicateOnlyDirective { line: 2 }.to_string(), + "line 2: a second `-- ONLY EQL VERSION:` line" + ); + // Prose that mentions the directive mid-line is not a directive. + assert_eq!( + belongs_to("--! see `-- ONLY EQL VERSION: 4`\n", EqlVersion::V3), + Ok(true) + ); + } + + #[test] + fn parses_versions() { + assert_eq!("3".parse(), Ok(EqlVersion::V3)); + assert_eq!("4".parse(), Ok(EqlVersion::V4)); + assert!("2".parse::().is_err()); + } + + /// A scratch directory removed on drop, so a failed assertion does not + /// leave it behind for a later run with the same pid to find. + struct Scratch(PathBuf); + + impl Scratch { + fn new(name: &str) -> Self { + let dir = std::env::temp_dir().join(format!("{name}-{}", std::process::id())); + let _ = fs::remove_dir_all(&dir); + Scratch(dir) + } + } + + impl Drop for Scratch { + fn drop(&mut self) { + let _ = fs::remove_dir_all(&self.0); + } + } + + #[test] + fn render_files_writes_nothing_when_any_file_fails() { + let scratch = Scratch::new("eql-render"); + let dir = &scratch.0; + let root = dir.join("root"); + let out = dir.join("out"); + fs::create_dir_all(root.join("src/v3")).unwrap(); + fs::write(root.join("src/v3/a.sql"), "SELECT {{prefix}}.f();\n").unwrap(); + fs::write(root.join("src/v3/b.sql"), "SELECT eql_v3.f();\n").unwrap(); + + let files = [PathBuf::from("src/v3/a.sql"), PathBuf::from("src/v3/b.sql")]; + let err = render_files(&root, &files, &out, EqlVersion::V4).unwrap_err(); + assert!(err.to_string().contains("b.sql"), "{err}"); + assert!(!out.exists()); + + render_files(&root, &files[..1], &out, EqlVersion::V4).unwrap(); + assert_eq!( + fs::read_to_string(out.join("src/v3/a.sql")).unwrap(), + "SELECT eql_v4.f();\n" + ); + } + + #[test] + fn render_files_refuses_a_file_confined_to_the_other_version() { + let scratch = Scratch::new("eql-render-only"); + let dir = &scratch.0; + let root = dir.join("root"); + let out = dir.join("out"); + fs::create_dir_all(root.join("src/v3")).unwrap(); + fs::write(root.join("src/v3/range.sql"), V4_ONLY).unwrap(); + let files = [PathBuf::from("src/v3/range.sql")]; + + let err = render_files(&root, &files, &out, EqlVersion::V3).unwrap_err(); + assert!(err.to_string().contains("belongs to eql_v4 only"), "{err}"); + assert!(!out.exists()); + render_files(&root, &files, &out, EqlVersion::V4).unwrap(); + assert!(out.join("src/v3/range.sql").exists()); + } + + #[test] + fn render_files_refuses_paths_outside_out() { + let scratch = Scratch::new("eql-render-abs"); + let dir = &scratch.0; + let root = dir.join("root"); + let out = dir.join("out"); + fs::create_dir_all(root.join("src")).unwrap(); + let src = root.join("src/a.sql"); + fs::write(&src, "SELECT {{prefix}}.f();\n").unwrap(); + + for rel in [src.clone(), PathBuf::from("src/../src/a.sql")] { + let err = + render_files(&root, std::slice::from_ref(&rel), &out, EqlVersion::V4).unwrap_err(); + assert!( + matches!(&err, RenderFileError::NotRelative { path } if *path == rel), + "{err}" + ); + } + assert_eq!( + fs::read_to_string(&src).unwrap(), + "SELECT {{prefix}}.f();\n" + ); + assert!(!out.exists()); + } +} diff --git a/packages/eql/crates/eql-codegen/src/targets.rs b/packages/eql/crates/eql-codegen/src/targets.rs index 959a71a86..c8fe66c67 100644 --- a/packages/eql/crates/eql-codegen/src/targets.rs +++ b/packages/eql/crates/eql-codegen/src/targets.rs @@ -1,9 +1,11 @@ //! The target-dispatch emitter: renders `eql_domains::CATALOG` to the -//! committed `crates/eql-bindings/src/v3/targets.rs` — the table of EQL +//! committed `crates/eql-bindings/src/v4/targets.rs` — the table of EQL //! types a Stack Encrypt data plan may name as a field target, and the //! by-name dispatch that runs a named type's own Rust plan. Generated beside -//! `inventory.rs` by the same mechanism ([`crate::bindings`]), and gated to -//! the `stack-encrypt` feature by the hand-written `v3/mod.rs`. +//! the v4 family modules by the same mechanism ([`crate::bindings`]), and +//! under the `targets` feature, inside `v4`. +//! Stack Encrypt produces EQL v4 only (ADR-0002), so every target is an +//! `eql_v4_*` domain. //! //! The table is the stack-encrypt view of the catalog: for every stored //! domain, the type's name in every language (`TextEq`), its family and @@ -16,18 +18,23 @@ //! the derive, and [`target_gap`] is tested to agree with //! [`encryption_gap`](crate::bindings::encryption_gap) on every domain. //! -//! The reasons a type is not producible are the plan's -//! (`docs/plans/2026-10-04-plan-builder.md`, "EQL types"): every family but -//! text has no specified plaintext encoding; match and OPE terms are derived -//! but no EQL type is built from them; EQL's ORE term is block ORE where the -//! engine derives CLLW ORE; and the JSON index is a new engine operation. +//! The reasons a type is not producible: eql-bindings names no Rust +//! plaintext type for the family; the engine derives no order term for a +//! date, timestamp or decimal; EQL's ORE term is block ORE where the engine +//! derives CLLW ORE (#1132); a +//! `TextSearch` query carries a match term that short text cannot make +//! (#1131); and the JSON index is a new engine operation (#1060). use proc_macro2::TokenStream; use quote::{format_ident, quote}; use eql_domains::{Domain, DomainFamily, Shape, Term}; -use crate::bindings::{encryption_gap, format_rs, stored_payload_domains}; +use crate::bindings::{encryption_gap, format_rs, plaintext_of, stored_payload_domains}; +use crate::render::EqlVersion; + +/// The version every target is produced into. +const TARGET_VERSION: EqlVersion = EqlVersion::V4; /// The `IndexSpec::key()` a catalog term rides under in a plan — the /// `"eq"` / `"match"` / `"ore"` / `"ope"` strings of stack-encrypt's data @@ -48,47 +55,18 @@ pub fn index_key(term: Term) -> &'static str { /// payload keys. const JSON_INDEX_KEY: &str = "json"; -/// The plaintext a family's domains are produced from, as a vitaminc -/// `ValueKind` name (what a plan field's `"type"` key spells) and the Rust -/// type the generated dispatch names. `None` while the family's plaintext -/// encoding for the stack-encrypt producer profile is unspecified, which is -/// every family but text today. +/// The plaintext a family's domains are produced from: see +/// [`bindings::plaintext_of`](crate::bindings::plaintext_of). pub fn plaintext(family: &DomainFamily) -> Option<(&'static str, &'static str)> { plaintext_of(family.name) } -/// [`plaintext`], by family name: what a rendered row carries. -fn plaintext_of(family: &str) -> Option<(&'static str, &'static str)> { - (family == "text").then_some(("string", "String")) -} - /// Why the engine cannot produce a stored domain's EQL type today, or -/// `None` when it can. `None` exactly when the domain carries the -/// `stack-encrypt` derives ([`encryption_gap`]), because the dispatch runs -/// the derived plan; the reasons are the plan's, keyed on catalog facts so -/// a domain added tomorrow gets an answer. +/// `None` when it can: exactly when the v4 domain carries the +/// `stack-encrypt` derives, because the dispatch runs the derived plan, so +/// the one source of reasons is [`encryption_gap`]. pub fn target_gap(family: &DomainFamily, domain: &Domain) -> Option<&'static str> { - encryption_gap(family, domain)?; - Some(if matches!(domain.shape, Shape::SteVec) { - "the JSON index is a new operation in the engine" - } else if family.name != "text" { - "how this family encodes a plaintext for the stack-encrypt producer profile is not \ - specified; only the text family's encoding is" - } else if domain.terms.contains(&Term::Ore) { - "EQL stores a block ORE term and the engine derives a CLLW ORE term; the two are \ - different algorithms" - } else if domain - .terms - .iter() - .any(|t| matches!(t, Term::Bloom | Term::Ope)) - { - "the engine derives match and OPE terms, but no EQL type is built from them yet" - } else if domain.terms.is_empty() { - "the storage-only text domain follows once TextEq is proven end to end in PostgreSQL" - } else { - "an equality-only text domain derives the same way TextEq does; it is not listed in \ - ENCRYPTION_DOMAINS yet" - }) + encryption_gap(TARGET_VERSION, family, domain) } /// One row of the generated table, computed from the catalog: what both @@ -139,8 +117,9 @@ fn row(family: &'static DomainFamily, domain: &'static Domain) -> Row { let query = if is_stevec { // The containment needle is the document's query form. Its struct // is the hand-written `SteVecQuery`; its domain is the family's - // `query` domain (`eql_v3.query_json`), read from the catalog so - // the name is spelled once. + // `query` domain (`eql_v4.query_json`), read from the catalog so + // the name is spelled once. v4 has no compiled SteVec types yet, so + // these rows are never producible. family .domains .iter() @@ -148,7 +127,11 @@ fn row(family: &'static DomainFamily, domain: &'static Domain) -> Row { .map(|needle| { ( needle.rust_struct_name(family.name), - format!("eql_v3.{}", needle.full_name(family.name)), + format!( + "{}.{}", + TARGET_VERSION.prefix(), + needle.full_name(family.name) + ), ) }) } else if domain.terms.is_empty() { @@ -156,7 +139,11 @@ fn row(family: &'static DomainFamily, domain: &'static Domain) -> Row { } else { Some(( format!("{}Query", domain.struct_ident(family.name)), - format!("eql_v3.{}", domain.query_name(family.name)), + format!( + "{}.{}", + TARGET_VERSION.prefix(), + domain.query_name(family.name) + ), )) }; Row { @@ -164,7 +151,11 @@ fn row(family: &'static DomainFamily, domain: &'static Domain) -> Row { family: family.name, suffix: suffix(domain), plaintext: plaintext(family).map(|(kind, _)| kind), - sql_domain: format!("public.{}", domain.sql_typname(family.name)), + sql_domain: format!( + "public.{}_{}", + TARGET_VERSION.prefix(), + domain.full_name(family.name) + ), indexes, query, reason: target_gap(family, domain), @@ -178,7 +169,7 @@ fn option_str(value: Option<&str>) -> TokenStream { } } -/// Render the generated `crates/eql-bindings/src/v3/targets.rs`. +/// Render the generated `crates/eql-bindings/src/v4/targets.rs`. pub fn render_targets_rs() -> String { render_targets_from(&rows()) } @@ -226,7 +217,8 @@ fn render_targets_from(rows: &[Row]) -> String { let ty = format_ident!("{strukt}"); let (_, rust) = plaintext_of(r.family).expect("a producible family has a specified plaintext"); - let source = format_ident!("{rust}"); + // Named by its last segment: the file imports every plaintext path. + let source = format_ident!("{}", rust.rsplit("::").next().unwrap_or(rust)); (name.clone(), quote!(super::#module::#ty), quote!(#source)) }; let encrypt_arms: TokenStream = producible @@ -253,6 +245,22 @@ fn render_targets_from(rows: &[Row]) -> String { Some(quote! { #name => run_target::<#ty, #source, K>(#name, keyset, column, plaintext), }) }) .collect(); + // One `use` per plaintext a producible type names by path (`String` is + // in the prelude), so the arms stay short enough to read. + let mut imports: Vec<&str> = producible + .iter() + .filter_map(|r| plaintext_of(r.family).map(|(_, rust)| rust)) + .filter(|rust| rust.contains("::")) + .collect(); + imports.sort_unstable(); + imports.dedup(); + let imports: TokenStream = imports + .iter() + .map(|rust| { + let path: syn::Path = syn::parse_str(rust).expect("plaintext is a type path"); + quote!(use #path;) + }) + .collect(); let helpers = if producible.is_empty() { quote!() } else { @@ -260,7 +268,7 @@ fn render_targets_from(rows: &[Row]) -> String { }; let mod_doc = " The EQL types a Stack Encrypt data plan may name as a field target — \ - every stored v3 domain type in eql-domains::CATALOG order, as data a \ + every stored EQL v4 domain type in eql-domains::CATALOG order, as data a \ guest serializes (`TARGETS`), with the by-name dispatch that runs a \ producible type's own Rust plan. Generated from the catalog; the \ descriptor type, the errors and the public entry points stay \ @@ -270,8 +278,9 @@ fn render_targets_from(rows: &[Row]) -> String { let file = quote! { #![doc = #mod_doc] - use vitaminc_aead_value::FfiValue; + use stack_encrypt::dynamic::ValueFrame; + #imports use crate::encryption::targets::{#helpers refuse, refuse_query, Opener, Target, TargetError}; use crate::Identifier; use stack_encrypt::{KeysetCipher, NonEmpty, Pending}; @@ -291,7 +300,7 @@ fn render_targets_from(rows: &[Row]) -> String { name: &str, keyset: &'a KeysetCipher<'_, K>, column: NonEmpty, - plaintext: FfiValue, + plaintext: ValueFrame, ) -> Result, K>, TargetError> { match name { #encrypt_arms @@ -306,7 +315,7 @@ fn render_targets_from(rows: &[Row]) -> String { opener: Opener<'a, K>, column: NonEmpty, stored: &[u8], - ) -> Result, TargetError> { + ) -> Result, TargetError> { match name { #decrypt_arms _ => Err(refuse(name)), @@ -320,7 +329,7 @@ fn render_targets_from(rows: &[Row]) -> String { name: &str, keyset: &'a KeysetCipher<'_, K>, column: NonEmpty, - plaintext: FfiValue, + plaintext: ValueFrame, ) -> Result, K>, TargetError> { match name { #query_arms @@ -347,7 +356,7 @@ mod tests { let full = domain.full_name(family.name); assert_eq!( target_gap(family, domain).is_none(), - encryption_gap(family, domain).is_none(), + encryption_gap(TARGET_VERSION, family, domain).is_none(), "{full}: producible and derived must agree" ); if target_gap(family, domain).is_none() { @@ -365,63 +374,74 @@ mod tests { ); } - /// Every reason is the plan's reason for that domain, selected by the - /// catalog fact that applies: a wrong branch order would hand the ORE - /// reason to `text_search` or the encoding reason to a text domain. + /// A target's reason is its v4 domain's derive reason: one source, so + /// the table and the derives cannot disagree about why. #[test] - fn every_unproducible_target_has_the_plan_reason_for_its_domain() { + fn every_unproducible_target_has_its_derive_reason() { for (family, domain) in stored_payload_domains() { - let full = domain.full_name(family.name); - let Some(reason) = target_gap(family, domain) else { - continue; - }; - let expected = if matches!(domain.shape, Shape::SteVec) { - "JSON index" - } else if family.name != "text" { - "encodes a plaintext" - } else if domain.terms.contains(&Term::Ore) { - "block ORE" - } else if domain - .terms - .iter() - .any(|t| matches!(t, Term::Bloom | Term::Ope)) - { - "match and OPE terms" - } else { - assert!( - domain.terms.is_empty(), - "{full}: an hm-only text domain other than eq is not in the catalog" - ); - "storage-only text domain" - }; - assert!(reason.contains(expected), "{full}: {reason}"); + assert_eq!( + target_gap(family, domain), + encryption_gap(TARGET_VERSION, family, domain), + "{}", + domain.full_name(family.name) + ); } - // Spelled out for the four plan rows, so the table reads without - // the derivation above. + // Spelled out, so the table reads without the derivation. + let gap = |family: &eql_domains::DomainFamily, name: &str| { + target_gap(family, family.domain_by_name(name).expect("domain")) + }; let text = eql_domains::TEXT; - let by_name = |name: &str| text.domain_by_name(name).expect("text domain"); - assert!(target_gap(&text, by_name("ord_ore")) - .unwrap() - .contains("CLLW")); - assert!(target_gap(&text, by_name("search_ore")) - .unwrap() - .contains("CLLW")); - assert!(target_gap(&text, by_name("match")) - .unwrap() - .contains("no EQL type")); - assert!(target_gap(&text, by_name("ord")) - .unwrap() - .contains("no EQL type")); - assert!(target_gap(&text, by_name("ord_ope")) - .unwrap() - .contains("no EQL type")); - assert!(target_gap(&text, by_name("search")) - .unwrap() - .contains("no EQL type")); + for producible in ["", "eq", "match", "ord", "ord_ope"] { + assert!(gap(&text, producible).is_none(), "text {producible:?}"); + } assert!( - target_gap(&text, by_name("eq")).is_none(), - "TextEq is producible" + gap(&text, "search").unwrap().contains("match term"), + "TextSearch waits on how a query leaves out its match term" ); + for block_ore in ["ord_ore", "search_ore"] { + assert!( + gap(&text, block_ore).unwrap().contains("block ORE"), + "{block_ore}" + ); + } + assert!(gap(&text, "match").is_none(), "TextMatch is producible"); + let family = |name: &str| { + eql_domains::CATALOG + .iter() + .find(|f| f.name == name) + .expect("family") + }; + for family_name in ["integer", "smallint", "bigint", "real", "double"] { + let family = family(family_name); + assert!(gap(family, "").is_none(), "{family_name}"); + for producible in ["eq", "ord", "ord_ope"] { + assert!( + gap(family, producible).is_none(), + "{family_name} {producible}" + ); + } + assert!( + gap(family, "ord_ore").unwrap().contains("block ORE"), + "{family_name}" + ); + } + // A date, a timestamp and a decimal are stored and compared for + // equality; every ordered domain of theirs waits for an order term, + // block ORE included, which waits for that first. + for family_name in ["date", "timestamp", "numeric"] { + let family = family(family_name); + assert!(gap(family, "").is_none(), "{family_name}"); + assert!(gap(family, "eq").is_none(), "{family_name}Eq is producible"); + for ordered in ["ord", "ord_ope", "ord_ore"] { + assert!( + gap(family, ordered) + .unwrap() + .contains("no order term for a date, timestamp or decimal"), + "{family_name} {ordered}" + ); + } + } + assert!(gap(family("json"), "").unwrap().contains("tree of leaves")); } #[test] @@ -466,9 +486,10 @@ mod tests { assert!(out.contains("name: \"SteVecDocument\"")); assert!(out.contains("indexes: &[\"json\"]")); assert!(out.contains("query: Some(\"SteVecQuery\")")); - assert!(out.contains("query_sql_domain: Some(\"eql_v3.query_json\")")); - assert!(out.contains("sql_domain: \"public.eql_v3_text_eq\"")); - assert!(out.contains("query_sql_domain: Some(\"eql_v3.query_text_eq\")")); + assert!(out.contains("query_sql_domain: Some(\"eql_v4.query_json\")")); + assert!(out.contains("sql_domain: \"public.eql_v4_text_eq\"")); + assert!(out.contains("query_sql_domain: Some(\"eql_v4.query_text_eq\")")); + assert!(!out.contains("eql_v3"), "every target is an eql_v4 domain"); // Exactly the producible types have dispatch arms, in all three // dispatches, and the query dispatch names the query twin. for (family, domain) in ENCRYPTION_DOMAINS.iter().map(|(f, d)| { @@ -480,47 +501,64 @@ mod tests { }) { let name = domain.rust_struct_name(family.name); let module = family.name; + let (_, plaintext) = plaintext_of(family.name).expect("a derived family's plaintext"); + let plaintext = plaintext.rsplit("::").next().unwrap(); let arm = |helper: &str, ty: &str| { format!( - "\"{name}\" => {{ {helper}::(\"{name}\", " + "\"{name}\" => {{ {helper}::(\"{name}\", " ) }; let flat_arm = |helper: &str, ty: &str| { - format!("\"{name}\" => {helper}::(\"{name}\", ") + format!( + "\"{name}\" => {helper}::(\"{name}\", " + ) }; + // rustfmt breaks long arms at different points, so compare with + // all whitespace gone. + let tight: String = out.split_whitespace().collect(); let count = |helper: &str, ty: &str| { - out.matches(&arm(helper, ty)).count() + out.matches(&flat_arm(helper, ty)).count() + let strip = |p: String| p.split_whitespace().collect::(); + tight.matches(&strip(arm(helper, ty))).count() + + tight.matches(&strip(flat_arm(helper, ty))).count() }; assert_eq!(count("run_target", &name), 1, "{name}: one encrypt arm"); assert_eq!(count("open_target", &name), 1, "{name}: one decrypt arm"); assert_eq!( count("run_target", &format!("{name}Query")), - 1, - "{name}: one query arm" + usize::from(!domain.terms.is_empty()), + "{name}: a query arm exactly when it has a query twin" ); } // No unproducible type has an arm: the only `=>` arms are the // producible ones and the three fall-throughs. + let with_twin = ENCRYPTION_DOMAINS + .iter() + .filter(|(f, d)| { + let family = eql_domains::CATALOG.iter().find(|x| x.name == *f).unwrap(); + !family.domain_by_name(d).unwrap().terms.is_empty() + }) + .count(); let arms = out.matches("\" => ").count(); - assert_eq!(arms, ENCRYPTION_DOMAINS.len() * 3, "arms: {out}"); + assert_eq!( + arms, + ENCRYPTION_DOMAINS.len() * 2 + with_twin, + "arms: {out}" + ); assert_eq!(out.matches("_ => Err(refuse(name))").count(), 2); assert_eq!(out.matches("_ => Err(refuse_query(name))").count(), 1); } - /// A producible type with no query twin — a storage-only domain, once - /// its derive lands — renders encrypt and decrypt arms and no query arm, - /// rather than aborting the generator: the query dispatch's fall-through - /// refuses it as answering no query. Not in the catalog today, so the - /// row is flipped by hand. + /// A producible type with no query twin — the storage-only `Text` — + /// renders encrypt and decrypt arms and no query arm: the query + /// dispatch's fall-through refuses it as answering no query. #[test] fn a_producible_type_without_a_query_twin_gets_no_query_arm() { - let mut rows = rows(); + let rows = rows(); let text = rows - .iter_mut() + .iter() .find(|r| r.name == "Text") .expect("the storage-only text domain"); - assert!(text.query.is_none() && text.reason.is_some()); - text.reason = None; + assert!(text.query.is_none() && text.reason.is_none()); let out: String = render_targets_from(&rows) .split_whitespace() .collect::>() @@ -542,10 +580,5 @@ mod tests { !out.contains("TextQuery"), "no query arm for a type with no twin: {out}" ); - assert_eq!( - out.matches("\" => ").count(), - (ENCRYPTION_DOMAINS.len() + 1) * 3 - 1, - "every producible type has three arms but the twinless one, which has two" - ); } } diff --git a/packages/eql/crates/eql-codegen/templates/ore_fallback.sql.j2 b/packages/eql/crates/eql-codegen/templates/ore_fallback.sql.j2 index ce27234cf..5c349bff7 100644 --- a/packages/eql/crates/eql-codegen/templates/ore_fallback.sql.j2 +++ b/packages/eql/crates/eql-codegen/templates/ore_fallback.sql.j2 @@ -8,7 +8,7 @@ --! --! Runs after the DO block in src/v3/sem/ore_block_256/operator_class.sql, --! which ATTEMPTS to create the default btree operator class for ---! eql_v3_internal.ore_block_256 and skips it on insufficient_privilege +--! {{ internal_schema }}.ore_block_256 and skips it on insufficient_privilege --! (CREATE OPERATOR CLASS requires superuser; managed platforms — cloud --! Supabase and most hosted Postgres — run the installer as a non-superuser --! role). When the class was created, this file is a no-op. diff --git a/packages/eql/crates/eql-codegen/templates/query_types.sql.j2 b/packages/eql/crates/eql-codegen/templates/query_types.sql.j2 index 2dee7bf01..eb93b0266 100644 --- a/packages/eql/crates/eql-codegen/templates/query_types.sql.j2 +++ b/packages/eql/crates/eql-codegen/templates/query_types.sql.j2 @@ -33,7 +33,7 @@ BEGIN AND jsonb_typeof(VALUE -> '{{ k }}') = 'array' AND jsonb_array_length(VALUE -> '{{ k }}') > 0 {%- endfor %} - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{ eql_version }}' ); END IF; diff --git a/packages/eql/crates/eql-codegen/templates/range_functions.sql.j2 b/packages/eql/crates/eql-codegen/templates/range_functions.sql.j2 new file mode 100644 index 000000000..a0fa8a0ac --- /dev/null +++ b/packages/eql/crates/eql-codegen/templates/range_functions.sql.j2 @@ -0,0 +1,62 @@ +-- AUTOMATICALLY GENERATED FILE. +{{ only_directive }} +{% for r in requires -%} +-- REQUIRE: {{ r }} +{% endfor %} +--! @file v3/scalars/{{ family_name }}/query_{{ family_name }}_range_functions.sql +--! @brief The bound accessors and `{{ schema }}.between` for {{ family_name }}'s range query domains. +--! @note EQL version {{ eql_version }} only, like the range domains themselves. +{% for a in accessors %} +--! @brief The {{ a.side }} bound of a {{ schema }}.{{ a.range }}, as a {{ a.term_label }} term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{ schema }}.between`'s body calls it, so it is not part of +--! the public `{{ schema }}` surface. +--! +--! @param r {{ schema }}.{{ a.range }} Range query operand +--! @return {{ a.returns }} The {{ a.side }} bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{ schema }}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{ internal_schema }}.{{ a.function_name }}(r {{ schema }}.{{ a.range }}) +RETURNS {{ a.returns }} +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{ a.body }} $$; +{% endfor %} +{%- for b in betweens %} +--! @brief Whether a {{ b.column }} value lies in a range, both bounds included. +--! +--! True when `{{ internal_schema }}.lo(r) <= {{ schema }}.{{ b.extractor }}(a) <= {{ internal_schema }}.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{ schema }}.between(col, $1::{{ schema }}.{{ b.range }})`. +--! +--! @param a {{ b.column }} Encrypted column value +--! @param r {{ schema }}.{{ b.range }} Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{ schema }}.{{ b.extractor }}(a)`, which a btree index on that expression +--! serves as one range scan.{% if b.ore %} For this ORE range that index needs the +--! default btree operator class on {{ internal_schema }}.ore_block_256, which the +--! installer creates only with superuser privileges. Without it (on Supabase, +--! for instance) the installer disables the ORE column domains and this ORE range, +--! so use an OPE column ({{ b.ope_columns }}) +--! and {{ b.ope_range }}, which index everywhere.{% endif %} +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{ schema }}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{ schema }}.{{ b.range }}`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{ schema }}.between(a {{ b.column }}, r {{ schema }}.{{ b.range }}) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{ schema }}.{{ b.extractor }}(a) >= {{ internal_schema }}.lo(r) AND {{ schema }}.{{ b.extractor }}(a) <= {{ internal_schema }}.hi(r) $$; +{% endfor -%} diff --git a/packages/eql/crates/eql-codegen/templates/range_types.sql.j2 b/packages/eql/crates/eql-codegen/templates/range_types.sql.j2 new file mode 100644 index 000000000..82259afc1 --- /dev/null +++ b/packages/eql/crates/eql-codegen/templates/range_types.sql.j2 @@ -0,0 +1,85 @@ +-- AUTOMATICALLY GENERATED FILE. +{{ only_directive }} +{% for r in requires -%} +-- REQUIRE: {{ r }} +{% endfor %} +--! @file v3/scalars/{{ family_name }}/query_{{ family_name }}_range_types.sql +--! @brief Range query-operand domains for {{ family_name }}: the operand of `{{ schema }}.between`. +--! @note A range holds both bounds of one `BETWEEN` as one value: +--! `{"v": {{ eql_version }}, "i": {...}, "lo": , "hi": }`. Each bound is the +--! single-bound query domain's `ob` (ORE) or `op` (OPE) value, in a +--! `{v, i, lo, hi}` envelope. Both bounds are included. There is one +--! range domain per ordering term the family stores (ADR-0009, +--! decisions 7 and 8). +--! @note Cast the range parameter to its exact range domain +--! (`$1::{{ schema }}.query_{{ family_name }}_range_ore`). An uncast `$1`, a `jsonb` +--! parameter, or a range of another term or family fails with 42725 +--! ("function ... is not unique"); see `{{ schema }}.between`. +--! @note EQL version {{ eql_version }} only: the `-- ONLY EQL VERSION:` line above keeps this +--! file out of every other version's installer. +--! @note Like every query operand, a range lives in `{{ schema }}`, not `public`, +--! and holds no ciphertext `c`. A range whose low bound is above its +--! high bound matches no row, as with SQL `BETWEEN`; the SQL does not +--! reorder the bounds.{% if ore_ranges %} +--! @note On an install without the ORE operator class (a non-superuser +--! install, on Supabase for instance), the ORE range domain is disabled +--! as the single-bound ORE domains are: a value cast to it raises +--! `feature_not_supported`, naming the OPE range. See +--! `v3/scalars/ore_fallback.sql`.{% endif %} + +DO $$ +BEGIN +{%- for d in domains %} + --! @brief Range query-operand domain {{ schema }}.{{ d.name }} (two {{ d.term_label }} bounds; no `c`). + IF NOT EXISTS ( + SELECT 1 FROM pg_type + WHERE typname = '{{ d.typname }}' AND typnamespace = '{{ schema }}'::regnamespace + ) THEN + CREATE DOMAIN {{ schema }}.{{ d.name }} AS jsonb + CHECK ( + jsonb_typeof(VALUE) = 'object' + {%- for k in d.keys %} + AND VALUE ? '{{ k }}' + {%- endfor %} + AND NOT (VALUE ? 'c') + {%- for c in d.bound_checks %} + AND {{ c }} + {%- endfor %} + -- `"v": null` makes the comparison NULL, and a CHECK that is NULL + -- passes, so COALESCE refuses it. A NULL range still passes (no row + -- matches it). The comparison keeps the one form the v4 isolation + -- gate accepts. + AND COALESCE(VALUE->>'v' = '{{ eql_version }}', VALUE IS NULL) + ); + END IF; + + COMMENT ON DOMAIN {{ schema }}.{{ d.name }} IS '{{ d.comment }}'; +{% endfor -%} +END +$$; +{%- if ore_ranges %} + +-- Without the default btree operator class on {{ internal_schema }}.ore_block_256 +-- (the installer skips it on insufficient_privilege), ore_fallback.sql has +-- created {{ internal_schema }}.ore_domain_unavailable and poisoned the +-- single-bound ORE domains. It cannot reach this ORE range, which exists in +-- EQL v4 only, so the same NOT VALID poison CHECK is added here. +DO $do$ +BEGIN + IF EXISTS ( + SELECT 1 + FROM pg_catalog.pg_opclass c + JOIN pg_catalog.pg_am am ON am.oid = c.opcmethod + WHERE am.amname = 'btree' + AND c.opcdefault + AND c.opcintype = '{{ internal_schema }}.ore_block_256'::pg_catalog.regtype + ) THEN + RETURN; + END IF; +{% for e in ore_ranges %} + ALTER DOMAIN {{ e.name }} ADD CONSTRAINT eql_ore_unavailable + CHECK ({{ internal_schema }}.ore_domain_unavailable(VALUE, '{{ e.name_literal }}', '{{ e.alternatives }}')) NOT VALID; +{%- endfor %} +END; +$do$; +{%- endif %} diff --git a/packages/eql/crates/eql-codegen/templates/types.sql.j2 b/packages/eql/crates/eql-codegen/templates/types.sql.j2 index cc854121c..82a0d5085 100644 --- a/packages/eql/crates/eql-codegen/templates/types.sql.j2 +++ b/packages/eql/crates/eql-codegen/templates/types.sql.j2 @@ -22,7 +22,7 @@ BEGIN AND jsonb_typeof(VALUE -> '{{ k }}') = 'array' AND jsonb_array_length(VALUE -> '{{ k }}') > 0 {%- endfor %} - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{ eql_version }}' ); END IF; diff --git a/packages/eql/crates/eql-codegen/tests/bindings_parity.rs b/packages/eql/crates/eql-codegen/tests/bindings_parity.rs index bc84ea39b..078357457 100644 --- a/packages/eql/crates/eql-codegen/tests/bindings_parity.rs +++ b/packages/eql/crates/eql-codegen/tests/bindings_parity.rs @@ -37,8 +37,8 @@ fn tempdir(tag: &str) -> TempDir { TempDir(p) } -/// Relative path (from repo root / generator out-root) of the v3 bindings dir. -const V3_BINDINGS_DIR: &str = "crates/eql-bindings/src/v3"; +/// Relative paths (from repo root / generator out-root) of the bindings dirs. +const BINDINGS_DIRS: [&str; 2] = ["crates/eql-bindings/src/v3", "crates/eql-bindings/src/v4"]; /// Generate the bindings into `out`, then assert each written file is /// byte-for-byte identical to the committed copy under `repo_root()`. @@ -72,7 +72,7 @@ fn rust_bindings_match_committed_files() { } /// The committed marker-bearing (`// @generated`) `.rs` file SET under -/// `crates/eql-bindings/src/v3` must equal the set the generator emits. The +/// `crates/eql-bindings/src/v3` and `src/v4` must equal the set the generator emits. The /// per-file parity test above only iterates the freshly-generated `written` /// set, so an ORPHANED committed generated file — a `.rs` left behind /// after a catalog family rename/removal — is never visited and passes `cargo @@ -91,16 +91,23 @@ fn committed_binding_set_has_no_orphans() { let generated: BTreeSet = written .iter() - .map(|p| p.file_name().unwrap().to_str().unwrap().to_string()) + .map(|p| { + let rel = p.strip_prefix(out.path()).expect("written under out-root"); + rel.to_str().unwrap().to_string() + }) .collect(); - let dir = root.join(V3_BINDINGS_DIR); - let committed: BTreeSet = fs::read_dir(&dir) - .unwrap() - .filter_map(|e| e.ok().map(|e| e.path())) - .filter(|p| p.extension().and_then(|x| x.to_str()) == Some("rs")) - .filter(|p| is_generated(p, GeneratedKind::Rust).expect("read committed binding")) - .map(|p| p.file_name().unwrap().to_str().unwrap().to_string()) + let committed: BTreeSet = BINDINGS_DIRS + .iter() + .flat_map(|dir| { + fs::read_dir(root.join(dir)) + .unwrap() + .filter_map(|e| e.ok().map(|e| e.path())) + .filter(|p| p.extension().and_then(|x| x.to_str()) == Some("rs")) + .filter(|p| is_generated(p, GeneratedKind::Rust).expect("read committed binding")) + .map(|p| p.strip_prefix(&root).unwrap().to_str().unwrap().to_string()) + .collect::>() + }) .collect(); assert_eq!( @@ -124,14 +131,18 @@ fn generate_bindings_is_deterministic_across_runs() { eql_codegen::bindings::generate_bindings(b.path()).expect("generate bindings b"); let collect = |root: &Path| -> Vec<(String, String)> { - let base = root.join(V3_BINDINGS_DIR); - let mut files: Vec<(String, String)> = fs::read_dir(&base) - .unwrap() - .filter_map(|e| e.ok().map(|e| e.path())) - .filter(|p| p.extension().and_then(|x| x.to_str()) == Some("rs")) - .map(|p| { - let name = p.file_name().unwrap().to_str().unwrap().to_string(); - (name, fs::read_to_string(&p).unwrap()) + let mut files: Vec<(String, String)> = BINDINGS_DIRS + .iter() + .flat_map(|dir| { + fs::read_dir(root.join(dir)) + .unwrap() + .filter_map(|e| e.ok().map(|e| e.path())) + .filter(|p| p.extension().and_then(|x| x.to_str()) == Some("rs")) + .map(|p| { + let name = p.strip_prefix(root).unwrap().to_str().unwrap().to_string(); + (name, fs::read_to_string(&p).unwrap()) + }) + .collect::>() }) .collect(); files.sort(); diff --git a/packages/eql/crates/eql-codegen/tests/cli.rs b/packages/eql/crates/eql-codegen/tests/cli.rs index 4299ca989..5e9f6abd0 100644 --- a/packages/eql/crates/eql-codegen/tests/cli.rs +++ b/packages/eql/crates/eql-codegen/tests/cli.rs @@ -50,7 +50,12 @@ fn bindings_subcommand_succeeds_and_reports_count() { String::from_utf8_lossy(&out.stderr) ); let stdout = String::from_utf8_lossy(&out.stdout); - let expected = eql_domains::scalar_families().count() + 5; + // v3: scalar families + json_storage + payload + query_payload + + // inventory. v4: every family with a scalar domain + targets + inventory. + let expected = eql_domains::scalar_families().count() + + 4 + + eql_domains::families_with_scalar_domains().count() + + 2; assert!( stdout.contains(&format!("bindings: ok ({expected} files)")), "expected 'bindings: ok ({expected} files)' in stdout, got:\n{stdout}" @@ -65,25 +70,32 @@ fn bindings_subcommand_succeeds_and_reports_count() { ); } -/// `list-schemas` exits 0 and prints the owned schemas, public first, one per -/// line. This is the Rust side of the schema-split parity gate -/// (`mise run test:schemas:parity`), so the exact stdout is pinned here. +/// `list-schemas` exits 0 and prints the owned schemas, rendered, public first, +/// one per line (v3 by default). This is the Rust side of the schema-split +/// parity gate (`mise run test:schemas:parity`), so the exact stdout is pinned +/// here. #[test] fn list_schemas_subcommand_prints_owned_schemas() { - let out = Command::new(bin()) - .arg("list-schemas") - .output() - .expect("run eql-codegen list-schemas"); - assert!( - out.status.success(), - "list-schemas should exit 0; stderr: {}", - String::from_utf8_lossy(&out.stderr) - ); - let stdout = String::from_utf8_lossy(&out.stdout); - assert_eq!( - stdout, "eql_v3\neql_v3_internal\n", - "list-schemas must print the public schema first, then the internal schema" - ); + for (args, expected) in [ + (&["list-schemas"][..], "eql_v3\neql_v3_internal\n"), + (&["list-schemas", "3"][..], "eql_v3\neql_v3_internal\n"), + (&["list-schemas", "4"][..], "eql_v4\neql_v4_internal\n"), + ] { + let out = Command::new(bin()) + .args(args) + .output() + .expect("run eql-codegen list-schemas"); + assert!( + out.status.success(), + "{args:?} should exit 0; stderr: {}", + String::from_utf8_lossy(&out.stderr) + ); + assert_eq!( + String::from_utf8_lossy(&out.stdout), + expected, + "{args:?} must print the public schema first, then the internal schema" + ); + } } /// `order` exits 0 and prints the real surface's install order, one repo-relative @@ -152,6 +164,62 @@ fn order_subcommand_fails_on_a_dangling_require() { ); } +/// `select` prints, in the order given, the files that belong to a version, +/// dropping one confined to the other version. `tasks/build.sh` builds each +/// bundle's file list with it, so stdout is paths only. +#[test] +fn select_subcommand_drops_files_confined_to_the_other_version() { + let root = tempdir(); + let shared = root.0.join("shared.sql"); + let v4_only = root.0.join("range.sql"); + std::fs::write(&shared, "SELECT {{prefix}}.f();\n").unwrap(); + std::fs::write( + &v4_only, + "-- AUTOMATICALLY GENERATED FILE.\n-- ONLY EQL VERSION: 4\nSELECT 1;\n", + ) + .unwrap(); + let run = |version: &str, files: &[&std::path::Path]| { + Command::new(bin()) + .arg("select") + .arg(version) + .args(files) + .output() + .expect("run eql-codegen select") + }; + + let out = run("4", &[&v4_only, &shared]); + assert!(out.status.success()); + assert_eq!( + String::from_utf8_lossy(&out.stdout), + format!("{}\n{}\n", v4_only.display(), shared.display()) + ); + let out = run("3", &[&v4_only, &shared]); + assert!(out.status.success()); + assert_eq!( + String::from_utf8_lossy(&out.stdout), + format!("{}\n", shared.display()) + ); + + // Selecting nothing is an error, not an empty bundle. + let out = run("3", &[&v4_only]); + assert!(!out.status.success()); + assert!(out.stdout.is_empty()); + assert!(String::from_utf8_lossy(&out.stderr).contains("chose no file")); + + // A malformed directive or a missing file fails, naming the file. + let bad = root.0.join("bad.sql"); + std::fs::write(&bad, "-- ONLY EQL VERSION: five\n").unwrap(); + for file in [bad.as_path(), root.0.join("missing.sql").as_path()] { + let out = run("4", &[&shared, file]); + assert!(!out.status.success(), "{}", file.display()); + assert!(out.stdout.is_empty()); + assert!(String::from_utf8_lossy(&out.stderr).contains(&*file.to_string_lossy())); + } + + let out = run("5", &[&shared]); + assert_eq!(out.status.code(), Some(2)); +} + /// An unrecognised argument prints usage and exits 2 (the `ExitCode::from(2)` /// fall-through in `main.rs`). #[test] diff --git a/packages/eql/crates/eql-domains/src/lib.rs b/packages/eql/crates/eql-domains/src/lib.rs index a4507ad6b..8f3f67ee1 100644 --- a/packages/eql/crates/eql-domains/src/lib.rs +++ b/packages/eql/crates/eql-domains/src/lib.rs @@ -44,6 +44,22 @@ pub use fixtures::{ /// drift between the SQL and the canonical types. pub const ENVELOPE_KEYS: &[&str] = &["v", "i", "c"]; +/// The keys a range query domain carries its two bounds under, low then +/// high: `{"v": 4, "i": {…}, "lo": , "hi": }`. Each bound is the +/// single-bound query domain's `ob` (ORE) or `op` (OPE) value, in a +/// `{v, i, lo, hi}` envelope. Inclusive at both ends. +/// +/// Stack Encrypt does not write this envelope yet. Its `RangeQuery` has no +/// serialized form, the data path's `Operand::Range { lo, hi }` carries raw +/// term bytes, and `query_term` refuses a range on an EQL target. When the +/// ordered EQL types become producible, the engine will need to build this +/// envelope from the two bounds' terms. +/// +/// Cross-schema contract data like [`ENVELOPE_KEYS`]: `eql-codegen` builds +/// the range domain CHECKs and accessors from it, and the bindings name +/// their fields from it. Range domains exist in EQL v4 only. +pub const RANGE_BOUND_KEYS: [&str; 2] = ["lo", "hi"]; + /// The version prefix every PUBLIC-SCHEMA EQL type name carries: /// `public.eql_v3_integer_eq`, `public.eql_v3_json`, …. The prefix /// keeps EQL domains from shadowing PostgreSQL built-in type names diff --git a/packages/eql/crates/eql-domains/src/spec.rs b/packages/eql/crates/eql-domains/src/spec.rs index d48ad53de..da5f10e53 100644 --- a/packages/eql/crates/eql-domains/src/spec.rs +++ b/packages/eql/crates/eql-domains/src/spec.rs @@ -4,7 +4,7 @@ //! (no `ord` domain). //! Definitions for [`DomainFamily`] and [`Domain`] live in `lib.rs`. -use crate::{Domain, DomainFamily}; +use crate::{Domain, DomainFamily, Term}; impl Domain { /// The full (unqualified) domain name for this domain under `family_name`: @@ -166,6 +166,79 @@ impl DomainFamily { pub fn is_scalar(&self) -> bool { self.domains.iter().all(|d| d.is_scalar()) } + + /// The ordering terms this family stores, each once, in catalog order: + /// one range query domain per entry (ADR-0009 decision 8, one query + /// domain per (family, term)). `[Ore, Ope]` for every ordered family + /// today (`_ord_ore` precedes `_ord`), empty for a family with no + /// ordering domain (`boolean`, `json`). + /// + /// Range domains are an EQL v4 surface: `eql-codegen` renders them into + /// the v4 bundle only. The catalog names them; it does not decide which + /// bundle carries them. + pub fn range_terms(&self) -> Vec { + let mut out: Vec = Vec::new(); + for d in self.domains.iter().filter(|d| d.is_scalar()) { + for &t in d.terms { + if t.range_suffix().is_some() && !out.contains(&t) { + out.push(t); + } + } + } + out + } + + /// The unqualified name of this family's range query domain for the + /// ordering term `term`: `query_integer_range_ore`. Lives beside the + /// family's single-bound query domains (`query_integer_ord_ore`), in the + /// versioned schema. + /// + /// # Panics + /// + /// For a term with no ordering ([`Term::range_suffix`] is `None`): no + /// range domain carries it. + pub fn range_query_name(&self, term: Term) -> String { + format!("query_{}_{}", self.name, range_suffix(term)) + } + + /// The PascalCase binding identifier of the range query domain for + /// `term`: `IntegerRangeOreQuery`, the query-twin convention + /// (`IntegerOrdOreQuery`) applied to the range domain. + /// + /// # Panics + /// + /// As [`Self::range_query_name`]. + pub fn range_struct_ident(&self, term: Term) -> String { + let stem: String = format!("{}_{}", self.name, range_suffix(term)) + .split('_') + .filter(|s| !s.is_empty()) + .map(capitalize) + .collect(); + format!("{stem}Query") + } + + /// The stored scalar domains a range over `term` applies to, in catalog + /// order: every one that carries the term. `between(column, range)` has + /// one overload per domain listed. For `integer` and `Ope`, both `_ord` + /// and `_ord_ope`; for `text` and `Ore`, `_ord_ore` and `_search_ore`. + /// + /// Scalar domains only, deliberately for now: a JSON document's entry + /// (`json_entry`) carries the OPE term and compares against + /// `query__ord` with `<` and `>`, but has no `between` overload, so a + /// range over a JSON path is still two predicates. It waits for EQL v4's + /// SteVec bindings, since nothing produces a v4 document yet. + pub fn range_columns(&self, term: Term) -> Vec<&'static Domain> { + self.domains + .iter() + .filter(|d| d.is_scalar() && d.terms.contains(&term)) + .collect() + } +} + +/// [`Term::range_suffix`], refusing a term that has none. +fn range_suffix(term: Term) -> &'static str { + term.range_suffix() + .unwrap_or_else(|| panic!("{term:?} has no ordering, so no range query domain")) } #[cfg(test)] @@ -266,6 +339,73 @@ mod tests { assert_eq!(JSON.domains[3].rust_struct_name(JSON.name), "Json"); } + #[test] + fn every_ordered_family_has_one_range_domain_per_ordering_term() { + use crate::{BOOLEAN, CATALOG, JSON, TEXT}; + let integer = CATALOG.iter().find(|f| f.name == "integer").unwrap(); + assert_eq!(integer.range_terms(), [Term::Ore, Term::Ope]); + assert_eq!(TEXT.range_terms(), [Term::Ore, Term::Ope]); + assert!(BOOLEAN.range_terms().is_empty()); + assert!(JSON.range_terms().is_empty()); + // Every family with an ordering domain has both, and no family has + // a range term it does not store. + for f in CATALOG { + let stored: Vec = f + .domains + .iter() + .flat_map(|d| d.terms.iter().copied()) + .filter(|t| t.provides_ordering()) + .collect(); + for t in f.range_terms() { + assert!(stored.contains(&t), "{}: {t:?}", f.name); + assert!(!f.range_columns(t).is_empty(), "{}: {t:?}", f.name); + } + assert_eq!(f.range_terms().is_empty(), stored.is_empty(), "{}", f.name); + } + } + + #[test] + fn range_domains_follow_the_query_twin_naming() { + use crate::TEXT; + let integer = crate::CATALOG.iter().find(|f| f.name == "integer").unwrap(); + assert_eq!( + integer.range_query_name(Term::Ore), + "query_integer_range_ore" + ); + assert_eq!( + integer.range_query_name(Term::Ope), + "query_integer_range_ope" + ); + assert_eq!( + integer.range_struct_ident(Term::Ore), + "IntegerRangeOreQuery" + ); + assert_eq!(TEXT.range_struct_ident(Term::Ope), "TextRangeOpeQuery"); + } + + #[test] + fn a_range_applies_to_every_stored_domain_carrying_its_term() { + use crate::TEXT; + let names = |terms: Vec<&Domain>| terms.iter().map(|d| d.name).collect::>(); + let integer = crate::CATALOG.iter().find(|f| f.name == "integer").unwrap(); + assert_eq!(names(integer.range_columns(Term::Ore)), ["ord_ore"]); + assert_eq!(names(integer.range_columns(Term::Ope)), ["ord", "ord_ope"]); + assert_eq!( + names(TEXT.range_columns(Term::Ore)), + ["ord_ore", "search_ore"] + ); + assert_eq!( + names(TEXT.range_columns(Term::Ope)), + ["ord", "ord_ope", "search"] + ); + } + + #[test] + #[should_panic(expected = "has no ordering")] + fn a_term_with_no_ordering_has_no_range_domain() { + crate::TEXT.range_query_name(Term::Hm); + } + #[test] fn is_eq_only_is_false_for_the_non_scalar_json_family() { // `is_eq_only` describes the flat-scalar shape (storage + `_eq`, no diff --git a/packages/eql/crates/eql-domains/src/term.rs b/packages/eql/crates/eql-domains/src/term.rs index 64184cfc6..ea96331f8 100644 --- a/packages/eql/crates/eql-domains/src/term.rs +++ b/packages/eql/crates/eql-domains/src/term.rs @@ -109,6 +109,21 @@ impl Term { matches!(self, Term::Ore | Term::Ope) } + /// The suffix of the range query domain that carries a `Between` over + /// this term, or `None` for a term with no ordering: `range_ore` for + /// block ORE, `range_ope` for CLLW OPE. A family has one range domain + /// per ordering term it stores (ADR-0009 decisions 7 and 8), named + /// `query__` by + /// [`DomainFamily::range_query_name`](crate::DomainFamily::range_query_name). + /// `Some` exactly when [`Term::provides_ordering`] is true. + pub const fn range_suffix(self) -> Option<&'static str> { + match self { + Term::Ore => Some("range_ore"), + Term::Ope => Some("range_ope"), + Term::Hm | Term::Bloom => None, + } + } + /// JSON key whose payload must be a NON-EMPTY array for this term to be /// well-formed, or `None` if the term imposes no such structural rule. The /// ORE term (`ob`) is an array of block terms; an empty array (`ob: []`) is @@ -232,6 +247,17 @@ mod tests { assert_eq!(Term::Ope.binding_newtype(), "OpeCllw"); } + #[test] + fn range_suffix_names_each_ordering_term_and_nothing_else() { + assert_eq!(Term::Ore.range_suffix(), Some("range_ore")); + assert_eq!(Term::Ope.range_suffix(), Some("range_ope")); + assert_eq!(Term::Hm.range_suffix(), None); + assert_eq!(Term::Bloom.range_suffix(), None); + for t in [Term::Hm, Term::Ore, Term::Bloom, Term::Ope] { + assert_eq!(t.range_suffix().is_some(), t.provides_ordering(), "{t:?}"); + } + } + #[test] fn payload_terms_is_one_field_per_json_key_in_order() { let keys: Vec<&str> = Term::payload_terms(&[Term::Hm, Term::Ore]) diff --git a/packages/eql/docs/reference/adding-a-scalar-encrypted-domain-type.md b/packages/eql/docs/reference/adding-a-scalar-encrypted-domain-type.md index 79f7fad25..da7e425bf 100644 --- a/packages/eql/docs/reference/adding-a-scalar-encrypted-domain-type.md +++ b/packages/eql/docs/reference/adding-a-scalar-encrypted-domain-type.md @@ -756,14 +756,18 @@ lists, headers, or cleans it; it must declare its own `-- REQUIRE:` edges (usually to `_types.sql` and whichever generated function or operator file it extends). Use it for cross-domain casts, helper functions, or type-specific constraints. Unlike the generated siblings, **`_extensions.sql` IS -committed.** (Neither `integer` nor `smallint` ships one today.) +committed.** (Neither `integer` nor `smallint` ships one today.) Like every +file under `src/v3`, it names schemas and the payload version by placeholder: +`{{prefix}}.eq_term`, `public.{{prefix}}_integer_eq`, +`VALUE->>'v' = '{{eql_version}}'`. The build rejects a literal `eql_v3`. See +"Schema and version placeholders" in `AGENTS.md`. `tasks/pin_search_path_v3.sql` describes the fallback marker for inline-critical extension functions that take no domain argument and so escape the structural skip: ```sql -COMMENT ON FUNCTION eql_v3.my_helper(...) IS 'eql-inline-critical: ...'; +COMMENT ON FUNCTION {{prefix}}.my_helper(...) IS 'eql-inline-critical: ...'; ``` The generator never emits this marker; every function it produces takes a domain diff --git a/packages/eql/docs/reference/eql-functions.md b/packages/eql/docs/reference/eql-functions.md index 4945843df..d65245783 100644 --- a/packages/eql/docs/reference/eql-functions.md +++ b/packages/eql/docs/reference/eql-functions.md @@ -10,6 +10,7 @@ A reference for the functions and operators EQL exposes for querying encrypted d - [Function Equivalents](#function-equivalents) - [Index Term Extraction](#index-term-extraction) - [Encrypted JSON (`public.eql_v3_json_search`)](#encrypted-json-publiceql_v3_json_search) +- [Range queries in EQL v4: `eql_v4.between`](#range-queries-in-eql-v4-eql_v4between) - [Aggregate Functions](#aggregate-functions) - [Diagnostics](#diagnostics) @@ -131,6 +132,46 @@ The full encrypted-JSONB function surface — containment, `->` / `->>`, `eql_v3 --- +## Range queries in EQL v4: `eql_v4.between` + +EQL v4 is the same SQL installed as the `eql_v4` schema, for values written by Stack Encrypt (`release/cipherstash-encrypt-v4.sql`). Everything above applies to it with `eql_v4` in place of `eql_v3`. It also has one thing EQL v3 does not: a range query that is **one operand**, so a statement cannot pair the low bound of one query with the high bound of another. + +Every ordered family has a **range query domain** per ordering term, beside its single-bound query domains: + +| Range domain | Bounds | Column domains it applies to | +|---|---|---| +| `eql_v4.query__range_ore` | two block-ORE terms (`ob` arrays) | `public.eql_v4__ord_ore`, `public.eql_v4_text_search_ore` | +| `eql_v4.query__range_ope` | two CLLW-OPE terms (`op` hex strings) | `public.eql_v4__ord`, `public.eql_v4__ord_ope`, `public.eql_v4_text_search` | + +`` is any ordered family: `integer`, `smallint`, `bigint`, `date`, `timestamp`, `numeric`, `text`, `real`, `double`. A range value is `{"v": 4, "i": {...}, "lo": , "hi": }`: each bound is the single-bound query domain's `ob` (ORE) or `op` (OPE) value, in a `{v, i, lo, hi}` envelope, with no ciphertext `c`. Stack Encrypt does not build this envelope yet; it will when the ordered EQL types become producible. + +```sql +-- true when lo <= column <= hi, both bounds included +eql_v4.between(a public.eql_v4_integer_ord_ore, r eql_v4.query_integer_range_ore) RETURNS boolean +eql_v4.between(a public.eql_v4_integer_ord, r eql_v4.query_integer_range_ope) RETURNS boolean +eql_v4.between(a public.eql_v4_integer_ord_ope, r eql_v4.query_integer_range_ope) RETURNS boolean + +``` + +`between` reads each bound with an internal accessor, `eql_v4_internal.lo(r)` and `eql_v4_internal.hi(r)`, which return the bound as the column's order term type. They are not part of the public surface. + +**Example**, on an OPE column, which indexes on every install: + +```sql +CREATE INDEX ON users USING btree (eql_v4.ord_term(age)); + +SELECT * FROM users WHERE eql_v4.between(age, $1::eql_v4.query_integer_range_ope); +``` + +- `eql_v4.between` is an inlinable SQL function, so the planner sees `ord_term(age) >= lo AND ord_term(age) <= hi`, and a btree on the column's order term serves it as one range scan: `eql_v4.ord_term(col)` for an OPE column (`_ord`, `_ord_ope`, and `_search` for text), `eql_v4.ord_term_ore(col)` for an ORE one (`_ord_ore`, and `_search_ore` for text). +- **An ORE column needs the `eql_v4_internal.ore_block_256` btree operator class**, for its index and so for an ORE range scan. The installer creates that class only when it runs with superuser privileges. Otherwise (on Supabase and other managed roles) it skips it and disables the ORE column domains and the ORE range domains: a value cast to `_ord_ore` or `_search_ore` raises `feature_not_supported`, naming the OPE and equality alternatives, and a value cast to a `query__range_ore` domain raises the same error, naming the family's `_range_ope` domain. On such an install, use an OPE column and its `_range_ope` domain, which need nothing more. +- Always write it schema-qualified. `BETWEEN` is an SQL keyword, so a bare `between(...)` does not parse. +- **Always cast the range parameter to its exact range domain**, as in `$1::eql_v4.query_integer_range_ore`. PostgreSQL resolves a function's domain arguments as their base type, `jsonb`, and every `between` overload takes jsonb domains. So an uncast `$1`, a `jsonb` parameter, or a range of the wrong term (an OPE range on an `_ord_ore` column) or the wrong family matches several overloads, and the statement fails with SQLSTATE 42725 (`function eql_v4.between(...) is not unique`) when it is parsed, before it runs. This differs from the single-bound operators: `col < $1` resolves an untyped `$1`. +- A `NULL` range matches no row. So does a range whose low bound is above its high bound, as with SQL `BETWEEN`; the SQL does not reorder the bounds. +- The `eql_bindings::v4` Rust types (`IntegerRangeOreQuery`, …) and the Go `encrypt/eql` types of the same names hold a range value, so it binds as one parameter. + +--- + ## Aggregate Functions ### `eql_v3.min()` / `eql_v3.max()` (per-domain) diff --git a/packages/eql/mise.toml b/packages/eql/mise.toml index 64fc8a851..128ab2fcb 100644 --- a/packages/eql/mise.toml +++ b/packages/eql/mise.toml @@ -66,6 +66,8 @@ description = "Clean release" run = """ rm -f release/cipherstash-encrypt-uninstall.sql rm -f release/cipherstash-encrypt.sql + rm -f release/cipherstash-encrypt-v4-uninstall.sql + rm -f release/cipherstash-encrypt-v4.sql """ [tasks."release:prepare_bindings_assets"] @@ -233,7 +235,9 @@ run = "bash tasks/schemas-parity.sh" [tasks."install-hooks"] description = "Point git at the committed hooks in tasks/githooks (run once per clone) so commits touching the catalog/generated surfaces are drift-gated locally" dir = "{{config_root}}" -run = "git config core.hooksPath tasks/githooks" +# Git resolves a relative core.hooksPath against the root of the working tree, +# not this directory, so prefix the path from the root to this package. +run = 'git config core.hooksPath "$(git rev-parse --show-prefix)tasks/githooks"' [tasks."test:codegen"] description = "Run the encrypted-domain catalog + generator tests (no database required)" @@ -248,14 +252,26 @@ depends = ["build"] dir = "{{config_root}}" run = """ bash tasks/test/symbol_order_selftest.sh -bash tasks/test/verify_symbol_order_v3.sh src/deps-ordered-v3.txt +bash tasks/test/verify_symbol_order_v3.sh build/render/eql_v3/deps-ordered.txt +""" + +[tasks."test:v4_isolation"] +description = "Assert the eql_v4 bundle names nothing from eql_v3, and self-test that check (DB-free)" +depends = ["build"] +dir = "{{config_root}}" +run = """ +bash tasks/test/v4_isolation_selftest.sh +bash tasks/test/verify_no_v3_in_v4.sh """ [tasks."test:installer_complete"] -description = "Assert the installer contains every ordered src/v3 file's body (DB-free)" +description = "Assert the v3 and v4 installers each contain every ordered src/v3 file's body (DB-free)" depends = ["build"] dir = "{{config_root}}" -run = "bash tasks/test/verify_installer_complete.sh src/deps-ordered-v3.txt release/cipherstash-encrypt.sql" +run = """ +bash tasks/test/verify_installer_complete.sh build/render/eql_v3/deps-ordered.txt release/cipherstash-encrypt.sql build/render/eql_v3 +bash tasks/test/verify_installer_complete.sh build/render/eql_v4/deps-ordered.txt release/cipherstash-encrypt-v4.sql build/render/eql_v4 +""" [tasks."test:build_ordering_helpers"] description = "Unit tests for tasks/build/ordering.sh strip_require_lines (DB-free)" @@ -294,14 +310,20 @@ run = """ # on purpose. `--locked`: this is a CHECK, and the EQL lockfile is the one the # lockstep bump moves (see "Working on EQL" in the root AGENTS.md). set -euo pipefail +# Both feature sets: the typed types alone, as a Rust program builds them, +# and with the by-name dispatch, as the Go guest does. cargo test --locked -p eql-bindings --features stack-encrypt +cargo test --locked -p eql-bindings --features targets cargo test --locked -p eql-encryption-tests cargo clippy --locked -p eql-bindings -p eql-encryption-tests --all-features --all-targets -- -D warnings +# The typed set alone, linted on its own: a lint that fires only without +# `targets` (an import only the dispatch uses) is invisible to the line above. +cargo clippy --locked -p eql-bindings --features stack-encrypt --all-targets -- -D warnings """ [tasks."test:encryption:postgres"] -description = "Install the EQL bundle built from the tree into the database EQL_TEST_DATABASE_URL names and run the stack-encrypt PostgreSQL test against it (fresh encryption, fake KMS)" -# `build` writes release/cipherstash-encrypt.sql from the SQL in the tree. The +description = "Install the EQL v4 bundle built from the tree into the database EQL_TEST_DATABASE_URL names and run the PostgreSQL tests against it: stack-encrypt values (fresh encryption, fake KMS), and the range query domains and eql_v4.between" +# `build` writes release/cipherstash-encrypt-v4.sql from the SQL in the tree. The # copy under crates/eql-bindings/sql is the RELEASED bundle, rewritten only by # the lockstep version bump, so a test that installs it cannot see a SQL edit # made in the same pull request. @@ -313,23 +335,27 @@ run = """ # different databases. psql accepts a libpq conninfo string as its dbname. set -euo pipefail : "${EQL_TEST_DATABASE_URL:?set EQL_TEST_DATABASE_URL to a libpq connection string for a disposable PostgreSQL}" -psql "$EQL_TEST_DATABASE_URL" -v ON_ERROR_STOP=1 -f release/cipherstash-encrypt.sql +# Stack Encrypt writes EQL v4 only (ADR-0002), so the test runs against the v4 bundle. +psql "$EQL_TEST_DATABASE_URL" -v ON_ERROR_STOP=1 -f release/cipherstash-encrypt-v4.sql # `--ignored` selects by attribute, and cargo exits 0 on an empty selection, so # a test that loses its `#[ignore]` or is renamed would leave this task passing # on nothing. List what the filter selects before running it. -listing=$(cargo test --locked -p eql-encryption-tests --test text_eq -- --ignored --list | sed -n 's/: test$//p') -[ -n "$listing" ] || { echo "error: '--ignored' selects no test in text_eq; the PostgreSQL test has gone missing." >&2; exit 1; } -cargo test --locked -p eql-encryption-tests --test text_eq -- --ignored +for suite in text_eq v4_types v4_order v4_date_time_numeric v4_range; do + listing=$(cargo test --locked -p eql-encryption-tests --test "$suite" -- --ignored --list | sed -n 's/: test$//p') + [ -n "$listing" ] || { echo "error: '--ignored' selects no test in $suite; the PostgreSQL test has gone missing." >&2; exit 1; } + cargo test --locked -p eql-encryption-tests --test "$suite" -- --ignored +done """ [tasks."check:encryption:wasi"] -description = "Compile eql-bindings with the stack-encrypt feature for wasm32-wasip1 (no HTTP), as the Go guest builds it" +description = "Compile eql-bindings for wasm32-wasip1 (no HTTP): the typed stack-encrypt set alone, and with the targets feature as the Go guest builds it" dir = "{{config_root}}" run = """ #!/usr/bin/env bash set -euo pipefail rustup target add wasm32-wasip1 cargo check --locked -p eql-bindings --features stack-encrypt --target wasm32-wasip1 +cargo check --locked -p eql-bindings --features targets --target wasm32-wasip1 """ [tasks."types:generate"] @@ -353,22 +379,25 @@ tmp="$(mktemp -d)" # the ts-rs/schemars derives below need the generated structs on disk to # compile, so (unlike the TS/JSON, which export to a temp dir and swap on # success) they cannot be temp-swapped. To keep the task atomic-on-failure, -# snapshot the whole src/v3 tree (generated + hand-written) up front; if the +# snapshot the whole src/v3 and src/v4 trees (generated + hand-written) up front; if the # regen or the cargo test that follows fails or is interrupted, the trap # restores the snapshot so the working tree is left exactly as it was — never # fresh structs against stale committed TS/JSON that an automated commit could # capture. The snapshot is a filesystem copy (not `git checkout`) so a dev's # legitimate uncommitted edits survive a failed run. v3="crates/eql-bindings/src/v3" +v4="crates/eql-bindings/src/v4" bindings="crates/eql-bindings/bindings" schema="crates/eql-bindings/schema" cp -R "$v3" "$tmp/v3-snapshot" +cp -R "$v4" "$tmp/v4-snapshot" cp -R "$bindings" "$tmp/bindings-snapshot" cp -R "$schema" "$tmp/schema-snapshot" ok=0 trap 'if [ "$ok" != 1 ]; then - rm -rf "$v3" "$bindings" "$schema" + rm -rf "$v3" "$v4" "$bindings" "$schema" mv "$tmp/v3-snapshot" "$v3" + mv "$tmp/v4-snapshot" "$v4" mv "$tmp/bindings-snapshot" "$bindings" mv "$tmp/schema-snapshot" "$schema" fi @@ -396,12 +425,12 @@ set -euo pipefail # runs in contexts (test-eql.yml's Rust job, the pre-commit hook) that # provision mise tools but not pnpm/node_modules. node packages/eql/scripts/sync-generated.mjs -git diff --exit-code -- crates/eql-bindings/src/v3 crates/eql-bindings/bindings crates/eql-bindings/schema packages/eql/src/generated ../../languages/golang/encrypt/eql/eql_gen.go || { +git diff --exit-code -- crates/eql-bindings/src/v3 crates/eql-bindings/src/v4 crates/eql-bindings/bindings crates/eql-bindings/schema packages/eql/src/generated ../../languages/golang/encrypt/eql/eql_gen.go || { echo "eql-bindings generated Rust/TS/JSON, the Go package encrypt/eql or @cipherstash/eql package output is stale — run 'mise run types:generate' and 'mise run typescript:generate' and commit the result" >&2 exit 1 } # git diff is blind to brand-new files; untracked output is stale too. -untracked=$(git ls-files --others --exclude-standard -- crates/eql-bindings/src/v3 crates/eql-bindings/bindings crates/eql-bindings/schema packages/eql/src/generated ../../languages/golang/encrypt/eql/eql_gen.go) +untracked=$(git ls-files --others --exclude-standard -- crates/eql-bindings/src/v3 crates/eql-bindings/src/v4 crates/eql-bindings/bindings crates/eql-bindings/schema packages/eql/src/generated ../../languages/golang/encrypt/eql/eql_gen.go) if [ -n "$untracked" ]; then echo "eql-bindings has uncommitted generated files:" >&2 echo "$untracked" >&2 diff --git a/packages/eql/src/v3/aggregates.sql b/packages/eql/src/v3/aggregates.sql index 93402386f..c7f45c64c 100644 --- a/packages/eql/src/v3/aggregates.sql +++ b/packages/eql/src/v3/aggregates.sql @@ -3,7 +3,7 @@ --! @file v3/aggregates.sql --! @brief Aggregates for grouping and deduplicating encrypted values. --! ---! Provides `eql_v3.grouped_value` — the aggregate you need to run a `GROUP BY` +--! Provides `{{prefix}}.grouped_value` — the aggregate you need to run a `GROUP BY` --! over an encrypted column and still get the encrypted value back. --! --! ## Grouping encrypted values @@ -11,13 +11,13 @@ --! Encryption in EQL is non-deterministic: encrypting the same value twice gives --! two different ciphertexts. So you cannot group rows by comparing the stored --! ciphertext. Instead you group by the column's *equality term*, ---! `eql_v3.eq_term(col)` — a deterministic keyed hash that is identical for equal +--! `{{prefix}}.eq_term(col)` — a deterministic keyed hash that is identical for equal --! plaintexts. Counting how many rows share each encrypted value looks like this --! (the term itself is opaque, so there is no reason to select it): --! --! SELECT count(*) --! FROM users ---! GROUP BY eql_v3.eq_term(email); +--! GROUP BY {{prefix}}.eq_term(email); --! --! The equality term is opaque, though — you usually want the encrypted value --! itself back so your application can decrypt it. Adding the column to the @@ -25,17 +25,17 @@ --! --! SELECT email, count(*) -- email is not in GROUP BY --! FROM users ---! GROUP BY eql_v3.eq_term(email); +--! GROUP BY {{prefix}}.eq_term(email); --! -- ERROR: column "email" must appear in the GROUP BY clause or be used in --! -- an aggregate function --! --! Every row in a group is an encryption of the same plaintext, so any one of ---! them represents the group. `eql_v3.grouped_value` is the aggregate that hands +--! them represents the group. `{{prefix}}.grouped_value` is the aggregate that hands --! one back: --! ---! SELECT eql_v3.grouped_value(email) AS email, count(*) +--! SELECT {{prefix}}.grouped_value(email) AS email, count(*) --! FROM users ---! GROUP BY eql_v3.eq_term(email); +--! GROUP BY {{prefix}}.eq_term(email); --! --! ## Deduplicating without an aggregate --! @@ -43,11 +43,11 @@ --! `count`), you do not need `grouped_value` — use `DISTINCT ON` on the equality --! term, which lets you project the column directly: --! ---! SELECT DISTINCT ON (eql_v3.eq_term(email)) email +--! SELECT DISTINCT ON ({{prefix}}.eq_term(email)) email --! FROM users ---! ORDER BY eql_v3.eq_term(email); +--! ORDER BY {{prefix}}.eq_term(email); --! ---! Deduplicate on `eql_v3.eq_term(col)`, never on the column itself: a plain +--! Deduplicate on `{{prefix}}.eq_term(col)`, never on the column itself: a plain --! `SELECT DISTINCT email` compares the raw ciphertext, so two encryptions of the --! same value are NOT collapsed. --! @@ -75,8 +75,8 @@ --! @param value jsonb New value from the current row. --! @return jsonb The running state (first non-null value). --! ---! @see eql_v3.grouped_value -CREATE FUNCTION eql_v3_internal.grouped_value_sfunc(state jsonb, value jsonb) +--! @see {{prefix}}.grouped_value +CREATE FUNCTION {{prefix}}_internal.grouped_value_sfunc(state jsonb, value jsonb) RETURNS jsonb LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public @@ -90,9 +90,9 @@ $$; --! --! Returns the first non-null value encountered within a `GROUP BY` group. Its --! primary use is projecting an encrypted column while grouping by that column's ---! equality term (`GROUP BY eql_v3.eq_term(col)`), where PostgreSQL will not let +--! equality term (`GROUP BY {{prefix}}.eq_term(col)`), where PostgreSQL will not let --! you `SELECT col` directly — see the file header for the worked example. ---! Accepts any eql_v3 encrypted-domain value (each is a jsonb-backed domain) and +--! Accepts any {{prefix}} encrypted-domain value (each is a jsonb-backed domain) and --! returns it unchanged, performing no decryption or comparison. `PARALLEL SAFE` --! with a combine function, so it works under partial/parallel aggregation on --! large `GROUP BY` workloads. @@ -107,22 +107,22 @@ $$; --! matches the eql_v2 original. --! --! Group encrypted rows by encrypted equality and project the encrypted ---! column. GROUP BY eql_v3.eq_term(...) groups by the HMAC equality term; +--! column. GROUP BY {{prefix}}.eq_term(...) groups by the HMAC equality term; --! grouped_value(...) returns a representative ciphertext for each group so --! PostgreSQL does not reject the bare column reference. --! --! @code{.sql} ---! SELECT eql_v3.grouped_value(encrypted_foo) AS encrypted_foo, +--! SELECT {{prefix}}.grouped_value(encrypted_foo) AS encrypted_foo, --! count(*) --! FROM some_table ---! GROUP BY eql_v3.eq_term(encrypted_foo); +--! GROUP BY {{prefix}}.eq_term(encrypted_foo); --! @endcode --! ---! @see eql_v3_internal.grouped_value_sfunc ---! @see eql_v3.eq_term -CREATE AGGREGATE eql_v3.grouped_value(jsonb) ( - sfunc = eql_v3_internal.grouped_value_sfunc, +--! @see {{prefix}}_internal.grouped_value_sfunc +--! @see {{prefix}}.eq_term +CREATE AGGREGATE {{prefix}}.grouped_value(jsonb) ( + sfunc = {{prefix}}_internal.grouped_value_sfunc, stype = jsonb, - combinefunc = eql_v3_internal.grouped_value_sfunc, + combinefunc = {{prefix}}_internal.grouped_value_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/common.sql b/packages/eql/src/v3/common.sql index a81ea3724..56c0edc33 100644 --- a/packages/eql/src/v3/common.sql +++ b/packages/eql/src/v3/common.sql @@ -1,9 +1,9 @@ -- REQUIRE: src/v3/schema.sql --! @file v3/common.sql ---! @brief Common utility functions for the self-contained eql_v3 surface. +--! @brief Common utility functions for the self-contained {{prefix}} surface. --! ---! Forked from src/common.sql (design D7) so the eql_v3 ORE constructor owns the +--! Forked from src/common.sql (design D7) so the {{prefix}} ORE constructor owns the --! one transitive helper it needs without reaching into another schema. The --! eql_v2 original is unchanged. @@ -29,7 +29,7 @@ --! raised) — both callers only ever pass an array or JSON null (`val->'ob'`), --! so the divergence stays unreachable in practice; JSON null and empty --! array still return NULL exactly as before. -CREATE FUNCTION eql_v3_internal.jsonb_array_to_bytea_array(val jsonb) +CREATE FUNCTION {{prefix}}_internal.jsonb_array_to_bytea_array(val jsonb) RETURNS bytea[] IMMUTABLE AS $$ @@ -53,5 +53,5 @@ $$ LANGUAGE plpgsql; --! It takes a bare `jsonb` arg (not a jsonb-backed encrypted DOMAIN), so the --! structural skip in tasks/pin_search_path_v3.sql does not recognise it; --! this marker is the documented manual opt-in. -COMMENT ON FUNCTION eql_v3_internal.jsonb_array_to_bytea_array(jsonb) IS +COMMENT ON FUNCTION {{prefix}}_internal.jsonb_array_to_bytea_array(jsonb) IS 'eql-inline-critical: per-encrypted-value ORE opclass-path helper; must stay unpinned (SET search_path adds per-call overhead)'; diff --git a/packages/eql/src/v3/crypto.sql b/packages/eql/src/v3/crypto.sql index bd99b1627..24e0662f2 100644 --- a/packages/eql/src/v3/crypto.sql +++ b/packages/eql/src/v3/crypto.sql @@ -1,11 +1,11 @@ -- REQUIRE: src/v3/schema.sql --! @file v3/crypto.sql ---! @brief PostgreSQL pgcrypto extension enablement (eql_v3 fork) +--! @brief PostgreSQL pgcrypto extension enablement ({{prefix}} fork) --! ---! Forked from src/crypto.sql (design D8) so the entire eql_v3 dependency +--! Forked from src/crypto.sql (design D8) so the entire {{prefix}} dependency --! closure lives under src/v3/. Enables the pgcrypto extension which provides ---! cryptographic functions used by the eql_v3 ORE comparison path. +--! cryptographic functions used by the {{prefix}} ORE comparison path. --! --! Installs pgcrypto into the `extensions` schema (Supabase convention) to --! avoid the `extension_in_public` lint. Every EQL function that uses pgcrypto diff --git a/packages/eql/src/v3/json/aggregates.sql b/packages/eql/src/v3/json/aggregates.sql index 1d4d9ad86..50621e353 100644 --- a/packages/eql/src/v3/json/aggregates.sql +++ b/packages/eql/src/v3/json/aggregates.sql @@ -3,11 +3,11 @@ -- REQUIRE: src/v3/sem/ope_cllw/types.sql --! @file v3/json/aggregates.sql ---! @brief min / max aggregates over public.eql_v3_json_entry. +--! @brief min / max aggregates over public.{{prefix}}_json_entry. --! --! SteVec document entries extracted at a selector (`doc -> 'sel'`) order by --! their CLLW OPE (`op`) term, so the extremum is picked by comparing ---! `eql_v3.ord_term(entry)` rather than the scalar Block-ORE `ord_term` the +--! `{{prefix}}.ord_term(entry)` rather than the scalar Block-ORE `ord_term` the --! generated scalar ord aggregates use. The ope_cllw bytea domain orders under --! native byte comparison, so `<` / `>` on the extracted terms needs no custom --! comparator. Same STRICT + PARALLEL SAFE shape as the generated scalar @@ -18,9 +18,9 @@ --! `LANGUAGE plpgsql` with the pinned `search_path` — a `LANGUAGE sql` body would --! be inlinable and the planner could elide it. --! ---! @note **Only `op`-carrying entries are orderable.** `eql_v3.ord_term(entry)` +--! @note **Only `op`-carrying entries are orderable.** `{{prefix}}.ord_term(entry)` --! returns NULL when an entry has no `op` (CLLW OPE) term — the same entries a ---! `eql_v3.ord_term` btree NULL-filters from range scans. The state functions +--! `{{prefix}}.ord_term` btree NULL-filters from range scans. The state functions --! therefore IGNORE `op`-less entries (they never become or survive as the --! extremum), so `min`/`max` is well-defined over a mix of `op`-carrying and --! `op`-less entries and is not corrupted by an `op`-less seed. A naive @@ -29,26 +29,26 @@ --! row is `op`-less. An all-`op`-less input has no orderable extremum and --! returns the (arbitrary) STRICT seed. ---! @brief State function for min on public.eql_v3_json_entry. +--! @brief State function for min on public.{{prefix}}_json_entry. --! --! Keeps whichever orderable entry has the lesser CLLW OPE term. STRICT, so SQL --! NULL entries are skipped by the aggregate machinery; `op`-less (non-orderable) --! entries are skipped explicitly (see the @note on this file). --! ---! @param state public.eql_v3_json_entry Running extremum. ---! @param value public.eql_v3_json_entry Candidate entry. ---! @return public.eql_v3_json_entry The lesser orderable entry by `ord_term`. -CREATE FUNCTION eql_v3_internal.jsonb_entry_min_sfunc( - state public.eql_v3_json_entry, - value public.eql_v3_json_entry +--! @param state public.{{prefix}}_json_entry Running extremum. +--! @param value public.{{prefix}}_json_entry Candidate entry. +--! @return public.{{prefix}}_json_entry The lesser orderable entry by `ord_term`. +CREATE FUNCTION {{prefix}}_internal.jsonb_entry_min_sfunc( + state public.{{prefix}}_json_entry, + value public.{{prefix}}_json_entry ) -RETURNS public.eql_v3_json_entry +RETURNS public.{{prefix}}_json_entry LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ DECLARE - value_ope eql_v3_internal.ope_cllw := eql_v3.ord_term(value); - state_ope eql_v3_internal.ope_cllw := eql_v3.ord_term(state); + value_ope {{prefix}}_internal.ope_cllw := {{prefix}}.ord_term(value); + state_ope {{prefix}}_internal.ope_cllw := {{prefix}}.ord_term(state); BEGIN -- A non-orderable (op-less) candidate never replaces the running extremum. IF value_ope IS NULL THEN @@ -63,35 +63,35 @@ BEGIN END; $$; ---! @brief min aggregate over public.eql_v3_json_entry. ---! @param input public.eql_v3_json_entry ---! @return public.eql_v3_json_entry The entry with the smallest CLLW OPE term. -CREATE AGGREGATE eql_v3.min(public.eql_v3_json_entry) ( - sfunc = eql_v3_internal.jsonb_entry_min_sfunc, - stype = public.eql_v3_json_entry, - combinefunc = eql_v3_internal.jsonb_entry_min_sfunc, +--! @brief min aggregate over public.{{prefix}}_json_entry. +--! @param input public.{{prefix}}_json_entry +--! @return public.{{prefix}}_json_entry The entry with the smallest CLLW OPE term. +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_json_entry) ( + sfunc = {{prefix}}_internal.jsonb_entry_min_sfunc, + stype = public.{{prefix}}_json_entry, + combinefunc = {{prefix}}_internal.jsonb_entry_min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_json_entry. +--! @brief State function for max on public.{{prefix}}_json_entry. --! --! Keeps whichever orderable entry has the greater CLLW OPE term. `op`-less --! entries are skipped, mirroring `jsonb_entry_min_sfunc` (see the file @note). --! ---! @param state public.eql_v3_json_entry Running extremum. ---! @param value public.eql_v3_json_entry Candidate entry. ---! @return public.eql_v3_json_entry The greater orderable entry by `ord_term`. -CREATE FUNCTION eql_v3_internal.jsonb_entry_max_sfunc( - state public.eql_v3_json_entry, - value public.eql_v3_json_entry +--! @param state public.{{prefix}}_json_entry Running extremum. +--! @param value public.{{prefix}}_json_entry Candidate entry. +--! @return public.{{prefix}}_json_entry The greater orderable entry by `ord_term`. +CREATE FUNCTION {{prefix}}_internal.jsonb_entry_max_sfunc( + state public.{{prefix}}_json_entry, + value public.{{prefix}}_json_entry ) -RETURNS public.eql_v3_json_entry +RETURNS public.{{prefix}}_json_entry LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ DECLARE - value_ope eql_v3_internal.ope_cllw := eql_v3.ord_term(value); - state_ope eql_v3_internal.ope_cllw := eql_v3.ord_term(state); + value_ope {{prefix}}_internal.ope_cllw := {{prefix}}.ord_term(value); + state_ope {{prefix}}_internal.ope_cllw := {{prefix}}.ord_term(state); BEGIN -- A non-orderable (op-less) candidate never replaces the running extremum. IF value_ope IS NULL THEN @@ -106,12 +106,12 @@ BEGIN END; $$; ---! @brief max aggregate over public.eql_v3_json_entry. ---! @param input public.eql_v3_json_entry ---! @return public.eql_v3_json_entry The entry with the largest CLLW OPE term. -CREATE AGGREGATE eql_v3.max(public.eql_v3_json_entry) ( - sfunc = eql_v3_internal.jsonb_entry_max_sfunc, - stype = public.eql_v3_json_entry, - combinefunc = eql_v3_internal.jsonb_entry_max_sfunc, +--! @brief max aggregate over public.{{prefix}}_json_entry. +--! @param input public.{{prefix}}_json_entry +--! @return public.{{prefix}}_json_entry The entry with the largest CLLW OPE term. +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_json_entry) ( + sfunc = {{prefix}}_internal.jsonb_entry_max_sfunc, + stype = public.{{prefix}}_json_entry, + combinefunc = {{prefix}}_internal.jsonb_entry_max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/json/blockers.sql b/packages/eql/src/v3/json/blockers.sql index 935bc3105..cd9ee7b01 100644 --- a/packages/eql/src/v3/json/blockers.sql +++ b/packages/eql/src/v3/json/blockers.sql @@ -3,10 +3,10 @@ -- REQUIRE: src/v3/scalars/functions.sql --! @file v3/json/blockers.sql ---! @brief Native-jsonb firewall for public.eql_v3_json_search. +--! @brief Native-jsonb firewall for public.{{prefix}}_json_search. --! ---! public.eql_v3_json_search SUPPORTS @> <@ -> ->> (see operators.sql). Comparisons ---! Ordered comparisons < <= > >= are supported on public.eql_v3_json_entry; +--! public.{{prefix}}_json_search SUPPORTS @> <@ -> ->> (see operators.sql). Comparisons +--! Ordered comparisons < <= > >= are supported on public.{{prefix}}_json_entry; --! entry equality = <> is blocked because path entries carry no exact value --! selector. Root-document comparisons are also blocked. --! Every OTHER native jsonb operator reachable via domain fallback against the @@ -16,7 +16,7 @@ --! --! Each blocker is LANGUAGE plpgsql (NEVER STRICT — a STRICT blocker would let --! PostgreSQL skip the body and return NULL on a NULL argument, bypassing the ---! exception) and delegates to the shared eql_v3.encrypted_domain_unsupported_* +--! exception) and delegates to the shared {{prefix}}.encrypted_domain_unsupported_* --! helpers. Each blocker's RETURNS type matches the native operator it shadows --! (#> -> jsonb, #>> -> text, - / #- / || -> jsonb; the rest are boolean) so a --! composed expression resolves and the body raises 'operator not supported', @@ -25,417 +25,417 @@ --! so the firewall fires. --! @brief Blocker: ? (key/element exists). ---! @param a public.eql_v3_json_search Left operand (encrypted payload). +--! @param a public.{{prefix}}_json_search Left operand (encrypted payload). --! @param b text Native RHS operand. --! @return boolean Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_exists(a public.eql_v3_json_search, b text) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_exists(a public.{{prefix}}_json_search, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_bool('public.eql_v3_json_search', '?'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_bool('public.{{prefix}}_json_search', '?'); END; $$ LANGUAGE plpgsql; CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal.jsonb_blocked_exists, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_exists, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = text ); --! @brief Blocker: ?| (any key exists). ---! @param a public.eql_v3_json_search Left operand (encrypted payload). +--! @param a public.{{prefix}}_json_search Left operand (encrypted payload). --! @param b text[] Native RHS operand. --! @return boolean Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_exists_any(a public.eql_v3_json_search, b text[]) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_exists_any(a public.{{prefix}}_json_search, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_bool('public.eql_v3_json_search', '?|'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_bool('public.{{prefix}}_json_search', '?|'); END; $$ LANGUAGE plpgsql; CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal.jsonb_blocked_exists_any, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_exists_any, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = text[] ); --! @brief Blocker: ?& (all keys exist). ---! @param a public.eql_v3_json_search Left operand (encrypted payload). +--! @param a public.{{prefix}}_json_search Left operand (encrypted payload). --! @param b text[] Native RHS operand. --! @return boolean Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_exists_all(a public.eql_v3_json_search, b text[]) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_exists_all(a public.{{prefix}}_json_search, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_bool('public.eql_v3_json_search', '?&'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_bool('public.{{prefix}}_json_search', '?&'); END; $$ LANGUAGE plpgsql; CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal.jsonb_blocked_exists_all, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_exists_all, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = text[] ); --! @brief Blocker: @? (jsonpath exists). ---! @param a public.eql_v3_json_search Left operand (encrypted payload). +--! @param a public.{{prefix}}_json_search Left operand (encrypted payload). --! @param b jsonpath Native RHS operand. --! @return boolean Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_jsonpath_exists(a public.eql_v3_json_search, b jsonpath) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_jsonpath_exists(a public.{{prefix}}_json_search, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_bool('public.eql_v3_json_search', '@?'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_bool('public.{{prefix}}_json_search', '@?'); END; $$ LANGUAGE plpgsql; CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal.jsonb_blocked_jsonpath_exists, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_jsonpath_exists, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = jsonpath ); --! @brief Blocker: @@ (jsonpath predicate). ---! @param a public.eql_v3_json_search Left operand (encrypted payload). +--! @param a public.{{prefix}}_json_search Left operand (encrypted payload). --! @param b jsonpath Native RHS operand. --! @return boolean Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_jsonpath_match(a public.eql_v3_json_search, b jsonpath) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_jsonpath_match(a public.{{prefix}}_json_search, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_bool('public.eql_v3_json_search', '@@'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_bool('public.{{prefix}}_json_search', '@@'); END; $$ LANGUAGE plpgsql; CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal.jsonb_blocked_jsonpath_match, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_jsonpath_match, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = jsonpath ); --! @brief Blocker: #> (path extract, native returns jsonb). ---! @param a public.eql_v3_json_search Left operand (encrypted payload). +--! @param a public.{{prefix}}_json_search Left operand (encrypted payload). --! @param b text[] Native RHS operand. --! @return jsonb Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_path_extract(a public.eql_v3_json_search, b text[]) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_path_extract(a public.{{prefix}}_json_search, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_jsonb('public.eql_v3_json_search', '#>'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_jsonb('public.{{prefix}}_json_search', '#>'); END; $$ LANGUAGE plpgsql; CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal.jsonb_blocked_path_extract, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_path_extract, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = text[] ); --! @brief Blocker: #>> (path extract as text). ---! @param a public.eql_v3_json_search Left operand (encrypted payload). +--! @param a public.{{prefix}}_json_search Left operand (encrypted payload). --! @param b text[] Native RHS operand. --! @return text Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_path_extract_text(a public.eql_v3_json_search, b text[]) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_path_extract_text(a public.{{prefix}}_json_search, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_text('public.eql_v3_json_search', '#>>'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_text('public.{{prefix}}_json_search', '#>>'); END; $$ LANGUAGE plpgsql; CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal.jsonb_blocked_path_extract_text, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_path_extract_text, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = text[] ); --! @brief Blocker: - (delete key, text RHS; native returns jsonb). ---! @param a public.eql_v3_json_search Left operand (encrypted payload). +--! @param a public.{{prefix}}_json_search Left operand (encrypted payload). --! @param b text Native RHS operand. --! @return jsonb Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_delete_text(a public.eql_v3_json_search, b text) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_delete_text(a public.{{prefix}}_json_search, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_jsonb('public.eql_v3_json_search', '-'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_jsonb('public.{{prefix}}_json_search', '-'); END; $$ LANGUAGE plpgsql; CREATE OPERATOR - ( - FUNCTION = eql_v3_internal.jsonb_blocked_delete_text, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_delete_text, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = text ); --! @brief Blocker: - (delete index, integer RHS). ---! @param a public.eql_v3_json_search Left operand (encrypted payload). +--! @param a public.{{prefix}}_json_search Left operand (encrypted payload). --! @param b integer Native RHS operand. --! @return jsonb Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_delete_int(a public.eql_v3_json_search, b integer) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_delete_int(a public.{{prefix}}_json_search, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_jsonb('public.eql_v3_json_search', '-'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_jsonb('public.{{prefix}}_json_search', '-'); END; $$ LANGUAGE plpgsql; CREATE OPERATOR - ( - FUNCTION = eql_v3_internal.jsonb_blocked_delete_int, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_delete_int, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = integer ); --! @brief Blocker: - (delete keys, text[] RHS). ---! @param a public.eql_v3_json_search Left operand (encrypted payload). +--! @param a public.{{prefix}}_json_search Left operand (encrypted payload). --! @param b text[] Native RHS operand. --! @return jsonb Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_delete_array(a public.eql_v3_json_search, b text[]) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_delete_array(a public.{{prefix}}_json_search, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_jsonb('public.eql_v3_json_search', '-'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_jsonb('public.{{prefix}}_json_search', '-'); END; $$ LANGUAGE plpgsql; CREATE OPERATOR - ( - FUNCTION = eql_v3_internal.jsonb_blocked_delete_array, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_delete_array, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = text[] ); --! @brief Blocker: #- (delete at path). ---! @param a public.eql_v3_json_search Left operand (encrypted payload). +--! @param a public.{{prefix}}_json_search Left operand (encrypted payload). --! @param b text[] Native RHS operand. --! @return jsonb Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_delete_path(a public.eql_v3_json_search, b text[]) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_delete_path(a public.{{prefix}}_json_search, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_jsonb('public.eql_v3_json_search', '#-'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_jsonb('public.{{prefix}}_json_search', '#-'); END; $$ LANGUAGE plpgsql; CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal.jsonb_blocked_delete_path, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_delete_path, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = text[] ); --! @brief Blocker: || (concatenate, encrypted on the left). ---! @param a public.eql_v3_json_search Left operand (encrypted payload). +--! @param a public.{{prefix}}_json_search Left operand (encrypted payload). --! @param b jsonb Native RHS operand. --! @return jsonb Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_concat(a public.eql_v3_json_search, b jsonb) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_concat(a public.{{prefix}}_json_search, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_jsonb('public.eql_v3_json_search', '||'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_jsonb('public.{{prefix}}_json_search', '||'); END; $$ LANGUAGE plpgsql; CREATE OPERATOR || ( - FUNCTION = eql_v3_internal.jsonb_blocked_concat, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_concat, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = jsonb ); --! @brief Blocker: || (concatenate, encrypted on the right). --! @param a jsonb Native LHS operand. ---! @param b public.eql_v3_json_search Right operand (encrypted payload). +--! @param b public.{{prefix}}_json_search Right operand (encrypted payload). --! @return jsonb Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_concat_rhs(a jsonb, b public.eql_v3_json_search) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_concat_rhs(a jsonb, b public.{{prefix}}_json_search) RETURNS jsonb IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_jsonb('public.eql_v3_json_search', '||'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_jsonb('public.{{prefix}}_json_search', '||'); END; $$ LANGUAGE plpgsql; CREATE OPERATOR || ( - FUNCTION = eql_v3_internal.jsonb_blocked_concat_rhs, + FUNCTION = {{prefix}}_internal.jsonb_blocked_concat_rhs, LEFTARG = jsonb, - RIGHTARG = public.eql_v3_json_search + RIGHTARG = public.{{prefix}}_json_search ); ------------------------------------------------------------------------------ -- Root-document comparison blockers. ------------------------------------------------------------------------------ ---! @brief Blocker: root public.eql_v3_json_search document comparisons. ---! @param a public.eql_v3_json_search Left operand (encrypted payload). ---! @param b public.eql_v3_json_search Right operand (encrypted payload). +--! @brief Blocker: root public.{{prefix}}_json_search document comparisons. +--! @param a public.{{prefix}}_json_search Left operand (encrypted payload). +--! @param b public.{{prefix}}_json_search Right operand (encrypted payload). --! @return boolean Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_compare_json_json(a public.eql_v3_json_search, b public.eql_v3_json_search) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_compare_json_json(a public.{{prefix}}_json_search, b public.{{prefix}}_json_search) RETURNS boolean IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_bool('public.eql_v3_json_search', 'comparison'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_bool('public.{{prefix}}_json_search', 'comparison'); END; $$ LANGUAGE plpgsql; ---! @brief Blocker: root public.eql_v3_json_search-to-jsonb comparisons. ---! @param a public.eql_v3_json_search Left operand (encrypted payload). +--! @brief Blocker: root public.{{prefix}}_json_search-to-jsonb comparisons. +--! @param a public.{{prefix}}_json_search Left operand (encrypted payload). --! @param b jsonb Native RHS operand. --! @return boolean Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_compare_json_jsonb(a public.eql_v3_json_search, b jsonb) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_compare_json_jsonb(a public.{{prefix}}_json_search, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_bool('public.eql_v3_json_search', 'comparison'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_bool('public.{{prefix}}_json_search', 'comparison'); END; $$ LANGUAGE plpgsql; ---! @brief Blocker: root jsonb-to-public.eql_v3_json_search comparisons. +--! @brief Blocker: root jsonb-to-public.{{prefix}}_json_search comparisons. --! @param a jsonb Native LHS operand. ---! @param b public.eql_v3_json_search Right operand (encrypted payload). +--! @param b public.{{prefix}}_json_search Right operand (encrypted payload). --! @return boolean Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_compare_jsonb_json(a jsonb, b public.eql_v3_json_search) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_compare_jsonb_json(a jsonb, b public.{{prefix}}_json_search) RETURNS boolean IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_bool('public.eql_v3_json_search', 'comparison'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_bool('public.{{prefix}}_json_search', 'comparison'); END; $$ LANGUAGE plpgsql; CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.jsonb_blocked_compare_json_json, - LEFTARG = public.eql_v3_json_search, - RIGHTARG = public.eql_v3_json_search + FUNCTION = {{prefix}}_internal.jsonb_blocked_compare_json_json, + LEFTARG = public.{{prefix}}_json_search, + RIGHTARG = public.{{prefix}}_json_search ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.jsonb_blocked_compare_json_jsonb, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_compare_json_jsonb, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = jsonb ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.jsonb_blocked_compare_jsonb_json, + FUNCTION = {{prefix}}_internal.jsonb_blocked_compare_jsonb_json, LEFTARG = jsonb, - RIGHTARG = public.eql_v3_json_search + RIGHTARG = public.{{prefix}}_json_search ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.jsonb_blocked_compare_json_json, - LEFTARG = public.eql_v3_json_search, - RIGHTARG = public.eql_v3_json_search + FUNCTION = {{prefix}}_internal.jsonb_blocked_compare_json_json, + LEFTARG = public.{{prefix}}_json_search, + RIGHTARG = public.{{prefix}}_json_search ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.jsonb_blocked_compare_json_jsonb, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_compare_json_jsonb, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = jsonb ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.jsonb_blocked_compare_jsonb_json, + FUNCTION = {{prefix}}_internal.jsonb_blocked_compare_jsonb_json, LEFTARG = jsonb, - RIGHTARG = public.eql_v3_json_search + RIGHTARG = public.{{prefix}}_json_search ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.jsonb_blocked_compare_json_json, - LEFTARG = public.eql_v3_json_search, - RIGHTARG = public.eql_v3_json_search + FUNCTION = {{prefix}}_internal.jsonb_blocked_compare_json_json, + LEFTARG = public.{{prefix}}_json_search, + RIGHTARG = public.{{prefix}}_json_search ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.jsonb_blocked_compare_json_jsonb, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_compare_json_jsonb, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.jsonb_blocked_compare_jsonb_json, + FUNCTION = {{prefix}}_internal.jsonb_blocked_compare_jsonb_json, LEFTARG = jsonb, - RIGHTARG = public.eql_v3_json_search + RIGHTARG = public.{{prefix}}_json_search ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.jsonb_blocked_compare_json_json, - LEFTARG = public.eql_v3_json_search, - RIGHTARG = public.eql_v3_json_search + FUNCTION = {{prefix}}_internal.jsonb_blocked_compare_json_json, + LEFTARG = public.{{prefix}}_json_search, + RIGHTARG = public.{{prefix}}_json_search ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.jsonb_blocked_compare_json_jsonb, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_compare_json_jsonb, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.jsonb_blocked_compare_jsonb_json, + FUNCTION = {{prefix}}_internal.jsonb_blocked_compare_jsonb_json, LEFTARG = jsonb, - RIGHTARG = public.eql_v3_json_search + RIGHTARG = public.{{prefix}}_json_search ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.jsonb_blocked_compare_json_json, - LEFTARG = public.eql_v3_json_search, - RIGHTARG = public.eql_v3_json_search + FUNCTION = {{prefix}}_internal.jsonb_blocked_compare_json_json, + LEFTARG = public.{{prefix}}_json_search, + RIGHTARG = public.{{prefix}}_json_search ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.jsonb_blocked_compare_json_jsonb, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_compare_json_jsonb, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.jsonb_blocked_compare_jsonb_json, + FUNCTION = {{prefix}}_internal.jsonb_blocked_compare_jsonb_json, LEFTARG = jsonb, - RIGHTARG = public.eql_v3_json_search + RIGHTARG = public.{{prefix}}_json_search ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.jsonb_blocked_compare_json_json, - LEFTARG = public.eql_v3_json_search, - RIGHTARG = public.eql_v3_json_search + FUNCTION = {{prefix}}_internal.jsonb_blocked_compare_json_json, + LEFTARG = public.{{prefix}}_json_search, + RIGHTARG = public.{{prefix}}_json_search ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.jsonb_blocked_compare_json_jsonb, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_compare_json_jsonb, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.jsonb_blocked_compare_jsonb_json, + FUNCTION = {{prefix}}_internal.jsonb_blocked_compare_jsonb_json, LEFTARG = jsonb, - RIGHTARG = public.eql_v3_json_search + RIGHTARG = public.{{prefix}}_json_search ); ------------------------------------------------------------------------------ @@ -443,46 +443,46 @@ CREATE OPERATOR >= ( ------------------------------------------------------------------------------ --! @brief Block document containment against an extracted path entry. ---! @param a public.eql_v3_json_search Encrypted document. ---! @param b public.eql_v3_json_entry Extracted path entry. +--! @param a public.{{prefix}}_json_search Encrypted document. +--! @param b public.{{prefix}}_json_entry Extracted path entry. --! @return boolean Never returns; always raises 'operator not supported'. --! @note An extracted path entry carries no value selector, so this signature --! cannot express exact equality. It is explicitly claimed to prevent --! PostgreSQL flattening both domains to native jsonb containment. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_contains_entry(a public.eql_v3_json_search, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_contains_entry(a public.{{prefix}}_json_search, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_bool('public.eql_v3_json_search', '@>'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_bool('public.{{prefix}}_json_search', '@>'); END; $$ LANGUAGE plpgsql; CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.jsonb_blocked_contains_entry, - LEFTARG = public.eql_v3_json_search, - RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.jsonb_blocked_contains_entry, + LEFTARG = public.{{prefix}}_json_search, + RIGHTARG = public.{{prefix}}_json_entry ); --! @brief Block reverse containment from an extracted path entry. ---! @param a public.eql_v3_json_entry Extracted path entry. ---! @param b public.eql_v3_json_search Encrypted document. +--! @param a public.{{prefix}}_json_entry Extracted path entry. +--! @param b public.{{prefix}}_json_search Encrypted document. --! @return boolean Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_entry_contained(a public.eql_v3_json_entry, b public.eql_v3_json_search) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_entry_contained(a public.{{prefix}}_json_entry, b public.{{prefix}}_json_search) RETURNS boolean IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_bool('public.eql_v3_json_entry', '<@'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_bool('public.{{prefix}}_json_entry', '<@'); END; $$ LANGUAGE plpgsql; CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.jsonb_blocked_entry_contained, - LEFTARG = public.eql_v3_json_entry, - RIGHTARG = public.eql_v3_json_search + FUNCTION = {{prefix}}_internal.jsonb_blocked_entry_contained, + LEFTARG = public.{{prefix}}_json_entry, + RIGHTARG = public.{{prefix}}_json_search ); ------------------------------------------------------------------------------ @@ -490,81 +490,81 @@ CREATE OPERATOR <@ ( ------------------------------------------------------------------------------ --! @brief Blocker: @> with encrypted root document and native jsonb. ---! @param a public.eql_v3_json_search Left operand (encrypted payload). +--! @param a public.{{prefix}}_json_search Left operand (encrypted payload). --! @param b jsonb Native RHS operand. --! @return boolean Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_contains_json_jsonb(a public.eql_v3_json_search, b jsonb) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_contains_json_jsonb(a public.{{prefix}}_json_search, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_bool('public.eql_v3_json_search', '@>'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_bool('public.{{prefix}}_json_search', '@>'); END; $$ LANGUAGE plpgsql; --! @brief Blocker: @> with native jsonb and encrypted root document. --! @param a jsonb Native LHS operand. ---! @param b public.eql_v3_json_search Right operand (encrypted payload). +--! @param b public.{{prefix}}_json_search Right operand (encrypted payload). --! @return boolean Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_contains_jsonb_json(a jsonb, b public.eql_v3_json_search) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_contains_jsonb_json(a jsonb, b public.{{prefix}}_json_search) RETURNS boolean IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_bool('public.eql_v3_json_search', '@>'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_bool('public.{{prefix}}_json_search', '@>'); END; $$ LANGUAGE plpgsql; --! @brief Blocker: <@ with encrypted root document and native jsonb. ---! @param a public.eql_v3_json_search Left operand (encrypted payload). +--! @param a public.{{prefix}}_json_search Left operand (encrypted payload). --! @param b jsonb Native RHS operand. --! @return boolean Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_contained_json_jsonb(a public.eql_v3_json_search, b jsonb) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_contained_json_jsonb(a public.{{prefix}}_json_search, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_bool('public.eql_v3_json_search', '<@'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_bool('public.{{prefix}}_json_search', '<@'); END; $$ LANGUAGE plpgsql; --! @brief Blocker: <@ with native jsonb and encrypted root document. --! @param a jsonb Native LHS operand. ---! @param b public.eql_v3_json_search Right operand (encrypted payload). +--! @param b public.{{prefix}}_json_search Right operand (encrypted payload). --! @return boolean Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3_internal.jsonb_blocked_contained_jsonb_json(a jsonb, b public.eql_v3_json_search) +CREATE FUNCTION {{prefix}}_internal.jsonb_blocked_contained_jsonb_json(a jsonb, b public.{{prefix}}_json_search) RETURNS boolean IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_bool('public.eql_v3_json_search', '<@'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_bool('public.{{prefix}}_json_search', '<@'); END; $$ LANGUAGE plpgsql; CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.jsonb_blocked_contains_json_jsonb, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_contains_json_jsonb, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.jsonb_blocked_contains_jsonb_json, + FUNCTION = {{prefix}}_internal.jsonb_blocked_contains_jsonb_json, LEFTARG = jsonb, - RIGHTARG = public.eql_v3_json_search + RIGHTARG = public.{{prefix}}_json_search ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.jsonb_blocked_contained_json_jsonb, - LEFTARG = public.eql_v3_json_search, + FUNCTION = {{prefix}}_internal.jsonb_blocked_contained_json_jsonb, + LEFTARG = public.{{prefix}}_json_search, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.jsonb_blocked_contained_jsonb_json, + FUNCTION = {{prefix}}_internal.jsonb_blocked_contained_jsonb_json, LEFTARG = jsonb, - RIGHTARG = public.eql_v3_json_search + RIGHTARG = public.{{prefix}}_json_search ); diff --git a/packages/eql/src/v3/json/functions.sql b/packages/eql/src/v3/json/functions.sql index fa8acdc2f..d8ba0e59c 100644 --- a/packages/eql/src/v3/json/functions.sql +++ b/packages/eql/src/v3/json/functions.sql @@ -5,14 +5,14 @@ --! @file v3/json/functions.sql --! @brief Extractors, containment engine, and path/array functions for the ---! eql_v3 encrypted-JSONB (SteVec) surface. +--! {{prefix}} encrypted-JSONB (SteVec) surface. --! --! `selector` parameters here are *encrypted-side* selector hashes — the --! deterministic hash the crypto layer emits in the `s` field of each sv --! element. Plaintext JSONPaths are never accepted at runtime. ------------------------------------------------------------------------------ --- Envelope helpers (eql_v3 owns these; jsonb-only) +-- Envelope helpers ({{prefix}} owns these; jsonb-only) ------------------------------------------------------------------------------ --! @brief Extract envelope metadata (i, v, h) from a raw jsonb encrypted value. @@ -20,7 +20,7 @@ --! `h` is the document's key header — hoisted once to the envelope because --! every sv entry encrypts under the document's single data key. Grafting it --! here (the same `meta_data(val) || entry` concat that already grafts `i`/`v`) ---! is what keeps an extracted `public.eql_v3_json_entry` self-contained +--! is what keeps an extracted `public.{{prefix}}_json_entry` self-contained --! decryptable: decryption needs the header plus the entry's own `s` (the --! nonce source) and `c` (the raw AEAD output). `jsonb_strip_nulls` drops the --! keys entirely on payloads that lack them (e.g. a raw scalar envelope has @@ -28,7 +28,7 @@ --! --! @param val jsonb encrypted EQL payload --! @return jsonb Metadata object with `i`, `v`, and (for documents) `h`. -CREATE FUNCTION eql_v3.meta_data(val jsonb) +CREATE FUNCTION {{prefix}}.meta_data(val jsonb) RETURNS jsonb IMMUTABLE STRICT PARALLEL SAFE LANGUAGE SQL @@ -38,7 +38,7 @@ AS $$ ); $$; -COMMENT ON FUNCTION eql_v3.meta_data(jsonb) IS +COMMENT ON FUNCTION {{prefix}}.meta_data(jsonb) IS 'eql-inline-critical: raw-jsonb envelope helper used by v3 jsonb wrappers; must stay inlinable (unpinned search_path)'; --! @brief Extract ciphertext (c) from a raw jsonb encrypted value. @@ -48,9 +48,9 @@ COMMENT ON FUNCTION eql_v3.meta_data(jsonb) IS --! @note On the SteVec surface an entry's `c` is raw AEAD output and is NOT --! decryptable on its own: the decryption unit is the entry — its `s` --! (nonce source), `c`, and the document key header `h` (grafted onto ---! extracted entries by `->`; see eql_v3.meta_data). Scalar payloads' +--! extracted entries by `->`; see {{prefix}}.meta_data). Scalar payloads' --! `c` remains a self-describing encrypted record. -CREATE FUNCTION eql_v3.ciphertext(val jsonb) +CREATE FUNCTION {{prefix}}.ciphertext(val jsonb) RETURNS text IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public @@ -71,7 +71,7 @@ $$ LANGUAGE plpgsql; --! @param val jsonb encrypted EQL payload --! @return text The selector value. --! @throws Exception if `s` is absent. -CREATE FUNCTION eql_v3.selector(val jsonb) +CREATE FUNCTION {{prefix}}.selector(val jsonb) RETURNS text IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public @@ -86,9 +86,9 @@ $$ LANGUAGE plpgsql; --! @brief Extract selector (s) from a ste_vec entry. The DOMAIN CHECK --! guarantees `s` is present, so this is a simple field access. ---! @param entry public.eql_v3_json_entry +--! @param entry public.{{prefix}}_json_entry --! @return text The selector value. -CREATE FUNCTION eql_v3.selector(entry public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.selector(entry public.{{prefix}}_json_entry) RETURNS text LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ @@ -116,30 +116,30 @@ $$; --! that deliberately need encoded OPE-equivalence buckets. `hm` is retired — --! entries no longer carry it. --! ---! @param entry public.eql_v3_json_entry +--! @param entry public.{{prefix}}_json_entry --! @return bytea Decoded `op` bytes (NULL if the entry has no `op`, or is NULL). -CREATE FUNCTION eql_v3.ope_term(entry public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.ope_term(entry public.{{prefix}}_json_entry) RETURNS bytea LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ SELECT decode(entry ->> 'op', 'hex') $$; ---! @brief Deprecated compatibility alias for eql_v3.ope_term(json_entry). ---! @deprecated Use eql_v3.ope_term for raw OPE-equivalence inspection, or ---! eql_v3.ord_term for ordered comparisons. This term is not an +--! @brief Deprecated compatibility alias for {{prefix}}.ope_term(json_entry). +--! @deprecated Use {{prefix}}.ope_term for raw OPE-equivalence inspection, or +--! {{prefix}}.ord_term for ordered comparisons. This term is not an --! exact equality representation. ---! @param entry public.eql_v3_json_entry +--! @param entry public.{{prefix}}_json_entry --! @return bytea Decoded `op` bytes (NULL when the entry has no `op`). -CREATE FUNCTION eql_v3.eq_term(entry public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.eq_term(entry public.{{prefix}}_json_entry) RETURNS bytea LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3.ope_term(entry) + SELECT {{prefix}}.ope_term(entry) $$; -COMMENT ON FUNCTION eql_v3.eq_term(public.eql_v3_json_entry) IS - 'DEPRECATED: use eql_v3.ope_term(json_entry); OPE bytes are not exact equality terms'; +COMMENT ON FUNCTION {{prefix}}.eq_term(public.{{prefix}}_json_entry) IS + 'DEPRECATED: use {{prefix}}.ope_term(json_entry); OPE bytes are not exact equality terms'; ------------------------------------------------------------------------------ -- CLLW OPE per-entry overload (converged with the scalar ord_term) @@ -148,24 +148,24 @@ COMMENT ON FUNCTION eql_v3.eq_term(public.eql_v3_json_entry) IS --! @brief Extract the CLLW OPE index term from a ste_vec entry. --! --! An sv-element `op` term is only ever present on an sv element, never at a ---! root encrypted value, so the typed overload accepts public.eql_v3_json_entry — ---! the jsonb_entry twin of the generated scalar `eql_v3.ord_term` +--! root encrypted value, so the typed overload accepts public.{{prefix}}_json_entry — +--! the jsonb_entry twin of the generated scalar `{{prefix}}.ord_term` --! extractors. Returns SQL NULL when `op` is absent (the strict `->>` / --! `decode` chain propagates it), so btree NULL-filters such rows from range ---! queries. The returned eql_v3_internal.ope_cllw is a bytea domain: it orders +--! queries. The returned {{prefix}}_internal.ope_cllw is a bytea domain: it orders --! under native byte comparison with the DEFAULT btree opclass, so a ---! functional index on `eql_v3.ord_term(col -> 'selector')` engages +--! functional index on `{{prefix}}.ord_term(col -> 'selector')` engages --! structurally with no custom operator class (Supabase/managed-Postgres --! safe). --! ---! @param entry public.eql_v3_json_entry ---! @return eql_v3_internal.ope_cllw Hex-decoded CLLW OPE term, or NULL when +--! @param entry public.{{prefix}}_json_entry +--! @return {{prefix}}_internal.ope_cllw Hex-decoded CLLW OPE term, or NULL when --! `op` is absent. -CREATE FUNCTION eql_v3.ord_term(entry public.eql_v3_json_entry) - RETURNS eql_v3_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(entry public.{{prefix}}_json_entry) + RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3_internal.ope_cllw(entry::jsonb) + SELECT {{prefix}}_internal.ope_cllw(entry::jsonb) $$; ------------------------------------------------------------------------------ @@ -179,7 +179,7 @@ $$; --! --! @param val jsonb encrypted EQL payload --! @return jsonb[] Array of sv elements. -CREATE FUNCTION eql_v3.ste_vec(val jsonb) +CREATE FUNCTION {{prefix}}.ste_vec(val jsonb) RETURNS jsonb[] IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public @@ -205,7 +205,7 @@ $$ LANGUAGE plpgsql; --! @brief Check if a jsonb payload is marked as an sv array (`a` flag true). --! @param val jsonb encrypted EQL payload --! @return boolean True if `a` is present and true. -CREATE FUNCTION eql_v3_internal.is_ste_vec_array(val jsonb) +CREATE FUNCTION {{prefix}}_internal.is_ste_vec_array(val jsonb) RETURNS boolean IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public @@ -231,7 +231,7 @@ $$ LANGUAGE plpgsql; --! --! @param val jsonb encrypted EQL payload --! @return jsonb[] Array of objects with only deterministic fields. -CREATE FUNCTION eql_v3.jsonb_array(val jsonb) +CREATE FUNCTION {{prefix}}.jsonb_array(val jsonb) RETURNS jsonb[] IMMUTABLE STRICT PARALLEL SAFE LANGUAGE SQL @@ -247,7 +247,7 @@ AS $$ ); $$; -COMMENT ON FUNCTION eql_v3.jsonb_array(jsonb) IS +COMMENT ON FUNCTION {{prefix}}.jsonb_array(jsonb) IS 'eql-inline-critical: raw-jsonb deterministic-field array helper; must stay inlinable (unpinned search_path)'; ------------------------------------------------------------------------------ @@ -261,19 +261,19 @@ COMMENT ON FUNCTION eql_v3.jsonb_array(jsonb) IS --! @note Public raw-`jsonb[]` containment helper over the extracted --! deterministic fields — the function-form entrypoint for containment on --! platforms without operator support (Supabase/PostgREST). The typed ---! `public.eql_v3_json_search` `@>` operator does NOT call this function — it binds to ---! `eql_v3.jsonb_document_contains` instead — but both agree on the result (a +--! `public.{{prefix}}_json_search` `@>` operator does NOT call this function — it binds to +--! `{{prefix}}.jsonb_document_contains` instead — but both agree on the result (a --! parity test pins this). Also the documented GIN index expression ---! (`eql_v3.jsonb_array(col)`); see docs/reference/database-indexes.md. -CREATE FUNCTION eql_v3.jsonb_contains(a jsonb, b jsonb) +--! (`{{prefix}}.jsonb_array(col)`); see docs/reference/database-indexes.md. +CREATE FUNCTION {{prefix}}.jsonb_contains(a jsonb, b jsonb) RETURNS boolean IMMUTABLE STRICT PARALLEL SAFE LANGUAGE SQL AS $$ - SELECT eql_v3.jsonb_array(a) @> eql_v3.jsonb_array(b); + SELECT {{prefix}}.jsonb_array(a) @> {{prefix}}.jsonb_array(b); $$; -COMMENT ON FUNCTION eql_v3.jsonb_contains(jsonb, jsonb) IS +COMMENT ON FUNCTION {{prefix}}.jsonb_contains(jsonb, jsonb) IS 'eql-inline-critical: raw-jsonb containment helper; must stay inlinable (unpinned search_path)'; --! @brief GIN-indexable "is contained by" check. @@ -282,17 +282,17 @@ COMMENT ON FUNCTION eql_v3.jsonb_contains(jsonb, jsonb) IS --! @return boolean True if all elements of a are contained in b. --! @note Public raw-`jsonb[]` reverse-containment helper — the function-form --! entrypoint for `<@` on platforms without operator support. The typed ---! `public.eql_v3_json_search` `<@` operator binds to `eql_v3.jsonb_document_contains` instead, +--! `public.{{prefix}}_json_search` `<@` operator binds to `{{prefix}}.jsonb_document_contains` instead, --! but both agree on the result. -CREATE FUNCTION eql_v3.jsonb_contained_by(a jsonb, b jsonb) +CREATE FUNCTION {{prefix}}.jsonb_contained_by(a jsonb, b jsonb) RETURNS boolean IMMUTABLE STRICT PARALLEL SAFE LANGUAGE SQL AS $$ - SELECT eql_v3.jsonb_array(a) <@ eql_v3.jsonb_array(b); + SELECT {{prefix}}.jsonb_array(a) <@ {{prefix}}.jsonb_array(b); $$; -COMMENT ON FUNCTION eql_v3.jsonb_contained_by(jsonb, jsonb) IS +COMMENT ON FUNCTION {{prefix}}.jsonb_contained_by(jsonb, jsonb) IS 'eql-inline-critical: raw-jsonb contained-by helper; must stay inlinable (unpinned search_path)'; --! @brief Check if an sv array contains a specific sv element. @@ -311,7 +311,7 @@ COMMENT ON FUNCTION eql_v3.jsonb_contained_by(jsonb, jsonb) IS --! @param a jsonb[] sv array to search within. --! @param b jsonb sv element to search for. --! @return boolean True if b's selector is present in any element of a. -CREATE FUNCTION eql_v3.jsonb_document_contains(a jsonb[], b jsonb) +CREATE FUNCTION {{prefix}}.jsonb_document_contains(a jsonb[], b jsonb) RETURNS boolean IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public @@ -324,7 +324,7 @@ AS $$ FOR idx IN 1..array_length(a, 1) LOOP _a := a[idx]; - result := result OR (eql_v3.selector(_a) = eql_v3.selector(b)); + result := result OR ({{prefix}}.selector(_a) = {{prefix}}.selector(b)); EXIT WHEN result; END LOOP; @@ -337,48 +337,48 @@ $$ LANGUAGE plpgsql; --! Empty b is always contained. Each element of b must have its selector --! present in some element of a (selector-subset containment). --! ---! @param a public.eql_v3_json_search Container. ---! @param b public.eql_v3_json_search Elements to find. +--! @param a public.{{prefix}}_json_search Container. +--! @param b public.{{prefix}}_json_search Elements to find. --! @return boolean True if all elements of b are contained in a. ---! @see eql_v3.jsonb_document_contains(jsonb[], jsonb) -CREATE FUNCTION eql_v3.jsonb_document_contains(a public.eql_v3_json_search, b public.eql_v3_json_search) +--! @see {{prefix}}.jsonb_document_contains(jsonb[], jsonb) +CREATE FUNCTION {{prefix}}.jsonb_document_contains(a public.{{prefix}}_json_search, b public.{{prefix}}_json_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3.to_ste_vec_query(a)::jsonb - @> eql_v3.to_ste_vec_query(b)::jsonb + SELECT {{prefix}}.to_ste_vec_query(a)::jsonb + @> {{prefix}}.to_ste_vec_query(b)::jsonb $$; --! @cond deprecated_compatibility --! @brief Deprecated compatibility alias for jsonb_document_contains(jsonb[], jsonb). ---! @deprecated Use eql_v3.jsonb_document_contains(jsonb[], jsonb). +--! @deprecated Use {{prefix}}.jsonb_document_contains(jsonb[], jsonb). --! @param a jsonb[] sv array to search within. --! @param b jsonb sv element to search for. --! @return boolean True if b's selector is present in any element of a. -CREATE FUNCTION eql_v3.ste_vec_contains(a jsonb[], b jsonb) +CREATE FUNCTION {{prefix}}.ste_vec_contains(a jsonb[], b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3.jsonb_document_contains(a, b) + SELECT {{prefix}}.jsonb_document_contains(a, b) $$; -COMMENT ON FUNCTION eql_v3.ste_vec_contains(jsonb[], jsonb) IS - 'DEPRECATED: use eql_v3.jsonb_document_contains(jsonb[], jsonb)'; +COMMENT ON FUNCTION {{prefix}}.ste_vec_contains(jsonb[], jsonb) IS + 'DEPRECATED: use {{prefix}}.jsonb_document_contains(jsonb[], jsonb)'; --! @brief Deprecated compatibility alias for jsonb_document_contains(json_search, json_search). ---! @deprecated Use eql_v3.jsonb_document_contains(public.eql_v3_json_search, public.eql_v3_json_search). ---! @param a public.eql_v3_json_search Container. ---! @param b public.eql_v3_json_search Elements to find. +--! @deprecated Use {{prefix}}.jsonb_document_contains(public.{{prefix}}_json_search, public.{{prefix}}_json_search). +--! @param a public.{{prefix}}_json_search Container. +--! @param b public.{{prefix}}_json_search Elements to find. --! @return boolean True if all elements of b are contained in a. -CREATE FUNCTION eql_v3.ste_vec_contains(a public.eql_v3_json_search, b public.eql_v3_json_search) +CREATE FUNCTION {{prefix}}.ste_vec_contains(a public.{{prefix}}_json_search, b public.{{prefix}}_json_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3.jsonb_document_contains(a, b) + SELECT {{prefix}}.jsonb_document_contains(a, b) $$; -COMMENT ON FUNCTION eql_v3.ste_vec_contains(public.eql_v3_json_search, public.eql_v3_json_search) IS - 'DEPRECATED: use eql_v3.jsonb_document_contains(json_search, json_search)'; +COMMENT ON FUNCTION {{prefix}}.ste_vec_contains(public.{{prefix}}_json_search, public.{{prefix}}_json_search) IS + 'DEPRECATED: use {{prefix}}.jsonb_document_contains(json_search, json_search)'; --! @endcond ------------------------------------------------------------------------------ @@ -389,30 +389,30 @@ COMMENT ON FUNCTION eql_v3.ste_vec_contains(public.eql_v3_json_search, public.eq --! --! Returns one jsonb_entry row per matching encrypted element. Returns empty --! set on no match. It deliberately does not wrap multiple matches as an ---! public.eql_v3_json_search document, because the root document domain requires an `sv` ---! array and single leaves belong to public.eql_v3_json_entry. +--! public.{{prefix}}_json_search document, because the root document domain requires an `sv` +--! array and single leaves belong to public.{{prefix}}_json_entry. --! --! @param val jsonb encrypted EQL payload with `sv`. --! @param selector text Selector hash (`s` value). ---! @return SETOF public.eql_v3_json_entry Matching encrypted entries. ---! @see eql_v3.jsonb_path_query_first -CREATE FUNCTION eql_v3.jsonb_path_query(val jsonb, selector text) - RETURNS SETOF public.eql_v3_json_entry +--! @return SETOF public.{{prefix}}_json_entry Matching encrypted entries. +--! @see {{prefix}}.jsonb_path_query_first +CREATE FUNCTION {{prefix}}.jsonb_path_query(val jsonb, selector text) + RETURNS SETOF public.{{prefix}}_json_entry LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT (eql_v3.meta_data(val) || elem)::public.eql_v3_json_entry + SELECT ({{prefix}}.meta_data(val) || elem)::public.{{prefix}}_json_entry FROM jsonb_array_elements(val -> 'sv') elem WHERE elem ->> 's' = selector $$; -COMMENT ON FUNCTION eql_v3.jsonb_path_query(jsonb, text) IS +COMMENT ON FUNCTION {{prefix}}.jsonb_path_query(jsonb, text) IS 'eql-inline-critical: raw-jsonb path query helper; must stay inlinable (unpinned search_path)'; --! @brief Check if a selector path exists in encrypted JSONB. --! @param val jsonb encrypted EQL payload. --! @param selector text Selector hash to test. --! @return boolean True if a matching element exists. -CREATE FUNCTION eql_v3.jsonb_path_exists(val jsonb, selector text) +CREATE FUNCTION {{prefix}}.jsonb_path_exists(val jsonb, selector text) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ @@ -422,24 +422,24 @@ AS $$ ); $$; -COMMENT ON FUNCTION eql_v3.jsonb_path_exists(jsonb, text) IS +COMMENT ON FUNCTION {{prefix}}.jsonb_path_exists(jsonb, text) IS 'eql-inline-critical: raw-jsonb path exists helper; must stay inlinable (unpinned search_path)'; --! @brief Get the first sv element matching `selector`, or NULL. --! @param val jsonb encrypted EQL payload. --! @param selector text Selector hash to match. ---! @return public.eql_v3_json_entry First matching element or NULL. -CREATE FUNCTION eql_v3.jsonb_path_query_first(val jsonb, selector text) - RETURNS public.eql_v3_json_entry +--! @return public.{{prefix}}_json_entry First matching element or NULL. +CREATE FUNCTION {{prefix}}.jsonb_path_query_first(val jsonb, selector text) + RETURNS public.{{prefix}}_json_entry LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT (eql_v3.meta_data(val) || elem)::public.eql_v3_json_entry + SELECT ({{prefix}}.meta_data(val) || elem)::public.{{prefix}}_json_entry FROM jsonb_array_elements(val -> 'sv') elem WHERE elem ->> 's' = selector LIMIT 1 $$; -COMMENT ON FUNCTION eql_v3.jsonb_path_query_first(jsonb, text) IS +COMMENT ON FUNCTION {{prefix}}.jsonb_path_query_first(jsonb, text) IS 'eql-inline-critical: raw-jsonb path first helper; must stay inlinable (unpinned search_path)'; ------------------------------------------------------------------------------ @@ -450,7 +450,7 @@ COMMENT ON FUNCTION eql_v3.jsonb_path_query_first(jsonb, text) IS --! @param val jsonb encrypted EQL payload (must have `a` flag true). --! @return integer Number of elements. --! @throws Exception 'cannot get array length of a non-array' if not an array. -CREATE FUNCTION eql_v3.jsonb_array_length(val jsonb) +CREATE FUNCTION {{prefix}}.jsonb_array_length(val jsonb) RETURNS integer IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public @@ -458,8 +458,8 @@ AS $$ DECLARE sv jsonb[]; BEGIN - IF eql_v3_internal.is_ste_vec_array(val) THEN - sv := eql_v3.ste_vec(val); + IF {{prefix}}_internal.is_ste_vec_array(val) THEN + sv := {{prefix}}.ste_vec(val); RETURN array_length(sv, 1); END IF; @@ -469,10 +469,10 @@ $$ LANGUAGE plpgsql; --! @brief Extract elements of an encrypted JSONB array as rows. --! @param val jsonb encrypted EQL payload (must have `a` flag true). ---! @return SETOF public.eql_v3_json_entry One row per element (metadata preserved). +--! @return SETOF public.{{prefix}}_json_entry One row per element (metadata preserved). --! @throws Exception 'cannot extract elements from non-array' if not an array. -CREATE FUNCTION eql_v3.jsonb_array_elements(val jsonb) - RETURNS SETOF public.eql_v3_json_entry +CREATE FUNCTION {{prefix}}.jsonb_array_elements(val jsonb) + RETURNS SETOF public.{{prefix}}_json_entry IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -481,25 +481,25 @@ AS $$ meta jsonb; item jsonb; BEGIN - IF NOT eql_v3_internal.is_ste_vec_array(val) THEN + IF NOT {{prefix}}_internal.is_ste_vec_array(val) THEN RAISE 'cannot extract elements from non-array'; END IF; - meta := eql_v3.meta_data(val); - sv := eql_v3.ste_vec(val); + meta := {{prefix}}.meta_data(val); + sv := {{prefix}}.ste_vec(val); FOR idx IN 1..array_length(sv, 1) LOOP item = sv[idx]; - RETURN NEXT (meta || item)::public.eql_v3_json_entry; + RETURN NEXT (meta || item)::public.{{prefix}}_json_entry; END LOOP; RETURN; END; $$ LANGUAGE plpgsql; --- NOTE: `eql_v3.jsonb_array_elements_text` (SETOF bare per-element ciphertext +-- NOTE: `{{prefix}}.jsonb_array_elements_text` (SETOF bare per-element ciphertext -- text) was removed with the envelope wire format: an sv entry's `c` is raw -- AEAD output whose nonce derives from the entry's `s`, so a bare ciphertext -- stream is not decryptable and the function had no remaining correct use. --- Use `eql_v3.jsonb_array_elements` — its entry rows carry `s`, `c`, and the +-- Use `{{prefix}}.jsonb_array_elements` — its entry rows carry `s`, `c`, and the -- grafted document key header `h`, the complete decryption unit. diff --git a/packages/eql/src/v3/json/operators.sql b/packages/eql/src/v3/json/operators.sql index eddf1e753..e520f47f3 100644 --- a/packages/eql/src/v3/json/operators.sql +++ b/packages/eql/src/v3/json/operators.sql @@ -5,7 +5,7 @@ -- REQUIRE: src/v3/sem/ope_cllw/types.sql --! @file v3/json/operators.sql ---! @brief Operators on public.eql_v3_json_search and public.eql_v3_json_entry. +--! @brief Operators on public.{{prefix}}_json_search and public.{{prefix}}_json_entry. ------------------------------------------------------------------------------ -- -> field accessor (returns jsonb_entry) @@ -15,67 +15,67 @@ --! --! Returns the sv entry whose `s` equals @p selector, with root `i`/`v` merged --! in. Inlinable: range predicates reduce structurally through ---! `eql_v3.ord_term(col -> 'sel')` and match a functional btree index on that +--! `{{prefix}}.ord_term(col -> 'sel')` and match a functional btree index on that --! expression. Exact equality is document containment on a value selector. --! --! @warning The selector operand MUST carry a known type — a text-typed --! parameter (`$1`, the Proxy interface) or an explicit cast (`col -> 'sel'::%text`). --! A bare untyped literal (`col -> 'sel'`) resolves to the NATIVE `jsonb -> %text` --! operator and silently returns native jsonb semantics (a root-key lookup, ---! typically NULL), NOT this operator: PostgreSQL reduces the `public.eql_v3_json_search` +--! typically NULL), NOT this operator: PostgreSQL reduces the `public.{{prefix}}_json_search` --! domain to its base type `jsonb` when resolving an unknown-typed RHS, and the --! native base-type operator wins the exact-match tiebreak. This is intrinsic to --! the domain type-kind and applies to the native-jsonb blockers too. See --! the "Typed operands" caveat in docs/reference/json-support.md. --! ---! @param e public.eql_v3_json_search Root encrypted payload. +--! @param e public.{{prefix}}_json_search Root encrypted payload. --! @param selector text Selector hash. ---! @return public.eql_v3_json_entry Matching entry merged with root meta, or NULL. -CREATE FUNCTION eql_v3."->"(e public.eql_v3_json_search, selector text) - RETURNS public.eql_v3_json_entry +--! @return public.{{prefix}}_json_entry Matching entry merged with root meta, or NULL. +CREATE FUNCTION {{prefix}}."->"(e public.{{prefix}}_json_search, selector text) + RETURNS public.{{prefix}}_json_entry LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ SELECT ( - eql_v3.meta_data(e) || + {{prefix}}.meta_data(e) || jsonb_path_query_first( e, '$.sv[*] ? (@.s == $sel)'::jsonpath, jsonb_build_object('sel', selector) ) - )::public.eql_v3_json_entry + )::public.{{prefix}}_json_entry $$; CREATE OPERATOR ->( - FUNCTION=eql_v3."->", - LEFTARG=public.eql_v3_json_search, + FUNCTION={{prefix}}."->", + LEFTARG=public.{{prefix}}_json_search, RIGHTARG=text ); --! @brief -> operator with integer array index (0-based, JSONB convention). ---! @param e public.eql_v3_json_search Encrypted sv-array payload. +--! @param e public.{{prefix}}_json_search Encrypted sv-array payload. --! @param selector integer Array index. ---! @return public.eql_v3_json_entry Matching entry merged with root meta, or NULL. -CREATE FUNCTION eql_v3."->"(e public.eql_v3_json_search, selector integer) - RETURNS public.eql_v3_json_entry +--! @return public.{{prefix}}_json_entry Matching entry merged with root meta, or NULL. +CREATE FUNCTION {{prefix}}."->"(e public.{{prefix}}_json_search, selector integer) + RETURNS public.{{prefix}}_json_entry LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ SELECT CASE - WHEN eql_v3_internal.is_ste_vec_array(e) THEN + WHEN {{prefix}}_internal.is_ste_vec_array(e) THEN -- NOTE: `e::jsonb` makes the native-jsonb traversal explicit. `'sv'` is an - -- unknown-typed literal, so `e -> 'sv'` already flattens `public.eql_v3_json_search` to + -- unknown-typed literal, so `e -> 'sv'` already flattens `public.{{prefix}}_json_search` to -- its base type and binds native `jsonb -> text` (see the @warning above) — - -- the custom `->(public.eql_v3_json_search, text)` operator does NOT capture a bare + -- the custom `->(public.{{prefix}}_json_search, text)` operator does NOT capture a bare -- untyped literal. The cast documents that intent and guards the `-> selector` - -- (integer) hop from ever resolving to the v3 `->(public.eql_v3_json_search, integer)` + -- (integer) hop from ever resolving to the v3 `->(public.{{prefix}}_json_search, integer)` -- operator instead of native array access. - (eql_v3.meta_data(e) || (e::jsonb -> 'sv' -> selector))::public.eql_v3_json_entry + ({{prefix}}.meta_data(e) || (e::jsonb -> 'sv' -> selector))::public.{{prefix}}_json_entry ELSE NULL END $$; CREATE OPERATOR ->( - FUNCTION=eql_v3."->", - LEFTARG=public.eql_v3_json_search, + FUNCTION={{prefix}}."->", + LEFTARG=public.{{prefix}}_json_search, RIGHTARG=integer ); @@ -89,37 +89,37 @@ CREATE OPERATOR ->( --! Intentional v2 parity: this serializes the entire matched jsonb_entry --! object as JSON text. It does not decrypt or return scalar plaintext like --! native `jsonb ->>`. ---! @param e public.eql_v3_json_search Encrypted payload. +--! @param e public.{{prefix}}_json_search Encrypted payload. --! @param selector text Field selector hash. --! @return text The matching entry as text. -CREATE FUNCTION eql_v3."->>"(e public.eql_v3_json_search, selector text) +CREATE FUNCTION {{prefix}}."->>"(e public.{{prefix}}_json_search, selector text) RETURNS text LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3."->"(e, selector)::jsonb::text + SELECT {{prefix}}."->"(e, selector)::jsonb::text $$; CREATE OPERATOR ->> ( - FUNCTION=eql_v3."->>", - LEFTARG=public.eql_v3_json_search, + FUNCTION={{prefix}}."->>", + LEFTARG=public.{{prefix}}_json_search, RIGHTARG=text ); --! @brief ->> operator with integer array index. Inlinable alias of --! ->(json, integer) coerced to text. ---! @param e public.eql_v3_json_search Encrypted sv-array payload. +--! @param e public.{{prefix}}_json_search Encrypted sv-array payload. --! @param selector integer Array index. --! @return text The matching entry as text. -CREATE FUNCTION eql_v3."->>"(e public.eql_v3_json_search, selector integer) +CREATE FUNCTION {{prefix}}."->>"(e public.{{prefix}}_json_search, selector integer) RETURNS text LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3."->"(e, selector)::jsonb::text + SELECT {{prefix}}."->"(e, selector)::jsonb::text $$; CREATE OPERATOR ->> ( - FUNCTION=eql_v3."->>", - LEFTARG=public.eql_v3_json_search, + FUNCTION={{prefix}}."->>", + LEFTARG=public.{{prefix}}_json_search, RIGHTARG=integer ); @@ -128,43 +128,43 @@ CREATE OPERATOR ->> ( ------------------------------------------------------------------------------ --! @brief @> contains operator (document, document). ---! @param a public.eql_v3_json_search Container. ---! @param b public.eql_v3_json_search Contained value. +--! @param a public.{{prefix}}_json_search Container. +--! @param b public.{{prefix}}_json_search Contained value. --! @return boolean True if a contains b. ---! @see eql_v3.jsonb_document_contains -CREATE FUNCTION eql_v3."@>"(a public.eql_v3_json_search, b public.eql_v3_json_search) +--! @see {{prefix}}.jsonb_document_contains +CREATE FUNCTION {{prefix}}."@>"(a public.{{prefix}}_json_search, b public.{{prefix}}_json_search) RETURNS boolean LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3.jsonb_document_contains(a, b) + SELECT {{prefix}}.jsonb_document_contains(a, b) $$; CREATE OPERATOR @>( - FUNCTION=eql_v3."@>", - LEFTARG=public.eql_v3_json_search, - RIGHTARG=public.eql_v3_json_search + FUNCTION={{prefix}}."@>", + LEFTARG=public.{{prefix}}_json_search, + RIGHTARG=public.{{prefix}}_json_search ); --! @brief @> contains operator with an query_json needle. --! ---! Inlines to native `jsonb @>` over `eql_v3.to_ste_vec_query(a)::jsonb`, so a +--! Inlines to native `jsonb @>` over `{{prefix}}.to_ste_vec_query(a)::jsonb`, so a --! functional GIN index on the same expression engages. --! ---! @param a public.eql_v3_json_search Container. ---! @param b eql_v3.query_json Query payload. +--! @param a public.{{prefix}}_json_search Container. +--! @param b {{prefix}}.query_json Query payload. --! @return boolean True if a contains b. -CREATE FUNCTION eql_v3."@>"(a public.eql_v3_json_search, b eql_v3.query_json) +CREATE FUNCTION {{prefix}}."@>"(a public.{{prefix}}_json_search, b {{prefix}}.query_json) RETURNS boolean LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3.to_ste_vec_query(a)::jsonb - @> eql_v3.to_ste_vec_query(b)::jsonb + SELECT {{prefix}}.to_ste_vec_query(a)::jsonb + @> {{prefix}}.to_ste_vec_query(b)::jsonb $$; CREATE OPERATOR @>( - FUNCTION=eql_v3."@>", - LEFTARG=public.eql_v3_json_search, - RIGHTARG=eql_v3.query_json + FUNCTION={{prefix}}."@>", + LEFTARG=public.{{prefix}}_json_search, + RIGHTARG={{prefix}}.query_json ); -- NOTE: there is deliberately NO computable `@>`(json_search, json_entry) @@ -173,7 +173,7 @@ CREATE OPERATOR @>( -- ({s,c,op?}) and carries no value selector, so it can only ever match -- structurally ("the document has a node at this path") — value-blind for -- bool/null/object/array and op-lossy for number/string. Exact field equality is --- document containment on the value selector: `col @> $1::eql_v3.query_json`, +-- document containment on the value selector: `col @> $1::{{prefix}}.query_json`, -- where a value-selector's presence in the stored document IS the exact match. -- Routing all value equality through that one exact mechanism is why the -- structural single-entry behavior (and its `<@` reverse) was blocked. @@ -183,38 +183,38 @@ CREATE OPERATOR @>( ------------------------------------------------------------------------------ --! @brief <@ contained-by operator (document, document). ---! @param a public.eql_v3_json_search Contained value. ---! @param b public.eql_v3_json_search Container. +--! @param a public.{{prefix}}_json_search Contained value. +--! @param b public.{{prefix}}_json_search Container. --! @return boolean True if a is contained by b. -CREATE FUNCTION eql_v3."<@"(a public.eql_v3_json_search, b public.eql_v3_json_search) +CREATE FUNCTION {{prefix}}."<@"(a public.{{prefix}}_json_search, b public.{{prefix}}_json_search) RETURNS boolean LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3.to_ste_vec_query(b)::jsonb - @> eql_v3.to_ste_vec_query(a)::jsonb + SELECT {{prefix}}.to_ste_vec_query(b)::jsonb + @> {{prefix}}.to_ste_vec_query(a)::jsonb $$; CREATE OPERATOR <@( - FUNCTION=eql_v3."<@", - LEFTARG=public.eql_v3_json_search, - RIGHTARG=public.eql_v3_json_search + FUNCTION={{prefix}}."<@", + LEFTARG=public.{{prefix}}_json_search, + RIGHTARG=public.{{prefix}}_json_search ); --! @brief <@ contained-by operator with an query_json LHS. ---! @param a eql_v3.query_json Query payload. ---! @param b public.eql_v3_json_search Container. +--! @param a {{prefix}}.query_json Query payload. +--! @param b public.{{prefix}}_json_search Container. --! @return boolean True if b contains a. -CREATE FUNCTION eql_v3."<@"(a eql_v3.query_json, b public.eql_v3_json_search) +CREATE FUNCTION {{prefix}}."<@"(a {{prefix}}.query_json, b public.{{prefix}}_json_search) RETURNS boolean LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3."@>"(b, a) + SELECT {{prefix}}."@>"(b, a) $$; CREATE OPERATOR <@( - FUNCTION=eql_v3."<@", - LEFTARG=eql_v3.query_json, - RIGHTARG=public.eql_v3_json_search + FUNCTION={{prefix}}."<@", + LEFTARG={{prefix}}.query_json, + RIGHTARG=public.{{prefix}}_json_search ); -- NOTE: `<@`(json_entry, json_search) is likewise a fail-loud blocker — it is @@ -230,60 +230,60 @@ CREATE OPERATOR <@( --! `bigint`/`numeric`/`text`; exact equality is document containment on a --! value-selector needle. This blocker is deliberately non-STRICT so a --! NULL operand cannot bypass the error. ---! @param a public.eql_v3_json_entry Left operand ---! @param b public.eql_v3_json_entry Right operand +--! @param a public.{{prefix}}_json_entry Left operand +--! @param b public.{{prefix}}_json_entry Right operand --! @return boolean Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3.eq(a public.eql_v3_json_entry, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_json_entry, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_bool('public.eql_v3_json_entry', '='); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_bool('public.{{prefix}}_json_entry', '='); END; $$ LANGUAGE plpgsql; CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_json_entry, - RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_json_entry, + RIGHTARG = public.{{prefix}}_json_entry ); --! @brief Block inequality between two extracted jsonb entries. ---! @param a public.eql_v3_json_entry Left operand ---! @param b public.eql_v3_json_entry Right operand +--! @param a public.{{prefix}}_json_entry Left operand +--! @param b public.{{prefix}}_json_entry Right operand --! @return boolean Never returns; always raises 'operator not supported'. -CREATE FUNCTION eql_v3.neq(a public.eql_v3_json_entry, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_json_entry, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.encrypted_domain_unsupported_bool('public.eql_v3_json_entry', '<>'); + RETURN {{prefix}}_internal.encrypted_domain_unsupported_bool('public.{{prefix}}_json_entry', '<>'); END; $$ LANGUAGE plpgsql; CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_json_entry, - RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_json_entry, + RIGHTARG = public.{{prefix}}_json_entry ); --! @brief Less-than on jsonb_entry via the CLLW OPE term (native bytea order). ---! @param a public.eql_v3_json_entry Left operand ---! @param b public.eql_v3_json_entry Right operand +--! @param a public.{{prefix}}_json_entry Left operand +--! @param b public.{{prefix}}_json_entry Right operand --! @return boolean True if a is less than b -CREATE FUNCTION eql_v3.lt(a public.eql_v3_json_entry, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) + SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_json_entry, - RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_json_entry, + RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, @@ -291,20 +291,20 @@ CREATE OPERATOR < ( ); --! @brief Less-than-or-equal on jsonb_entry via the CLLW OPE term. ---! @param a public.eql_v3_json_entry Left operand ---! @param b public.eql_v3_json_entry Right operand +--! @param a public.{{prefix}}_json_entry Left operand +--! @param b public.{{prefix}}_json_entry Right operand --! @return boolean True if a is less than or equal to b -CREATE FUNCTION eql_v3.lte(a public.eql_v3_json_entry, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) + SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_json_entry, - RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_json_entry, + RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, @@ -312,20 +312,20 @@ CREATE OPERATOR <= ( ); --! @brief Greater-than on jsonb_entry via the CLLW OPE term. ---! @param a public.eql_v3_json_entry Left operand ---! @param b public.eql_v3_json_entry Right operand +--! @param a public.{{prefix}}_json_entry Left operand +--! @param b public.{{prefix}}_json_entry Right operand --! @return boolean True if a is greater than b -CREATE FUNCTION eql_v3.gt(a public.eql_v3_json_entry, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) + SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_json_entry, - RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_json_entry, + RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, @@ -333,20 +333,20 @@ CREATE OPERATOR > ( ); --! @brief Greater-than-or-equal on jsonb_entry via the CLLW OPE term. ---! @param a public.eql_v3_json_entry Left operand ---! @param b public.eql_v3_json_entry Right operand +--! @param a public.{{prefix}}_json_entry Left operand +--! @param b public.{{prefix}}_json_entry Right operand --! @return boolean True if a is greater than or equal to b -CREATE FUNCTION eql_v3.gte(a public.eql_v3_json_entry, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) + SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_json_entry, - RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_json_entry, + RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, diff --git a/packages/eql/src/v3/json/types.sql b/packages/eql/src/v3/json/types.sql index 0bc34904b..3a676fa48 100644 --- a/packages/eql/src/v3/json/types.sql +++ b/packages/eql/src/v3/json/types.sql @@ -1,14 +1,14 @@ -- REQUIRE: src/v3/schema.sql --! @file v3/json/types.sql ---! @brief Domain types for the eql_v3 encrypted-JSONB (SteVec) surface. +--! @brief Domain types for the {{prefix}} encrypted-JSONB (SteVec) surface. --! --! Three jsonb-backed domains (none over another domain — operators resolve --! against the ultimate base type jsonb, so the native-jsonb firewall in --! blockers.sql can attach): ---! - public.eql_v3_json_search — storage/root: an EQL envelope object ({i, v, ...}). ---! - public.eql_v3_json_entry — a single sv element (returned by `->`). ---! - eql_v3.query_json — a containment needle (sv elements, no ciphertext). +--! - public.{{prefix}}_json_search — storage/root: an EQL envelope object ({i, v, ...}). +--! - public.{{prefix}}_json_entry — a single sv element (returned by `->`). +--! - {{prefix}}.query_json — a containment needle (sv elements, no ciphertext). --! @brief Validate a single SteVec entry payload. --! @internal @@ -22,8 +22,8 @@ --! a stale `hm`-bearing payload fails loudly rather than degrading to --! a value-less entry. The optional document metadata `i`, `v`, and --! `h` is accepted because selector lookup grafts it onto the entry ---! before casting to `public.eql_v3_json_entry`. -CREATE OR REPLACE FUNCTION public.eql_v3_is_valid_ste_vec_entry_payload(val jsonb) +--! before casting to `public.{{prefix}}_json_entry`. +CREATE OR REPLACE FUNCTION public.{{prefix}}_is_valid_ste_vec_entry_payload(val jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ @@ -48,12 +48,12 @@ $$; --! set of selectors — a value-selector's presence in the stored --! document IS the exact value match. --! @note plpgsql, not LANGUAGE sql (issues #353/#354): the only caller is the ---! eql_v3.query_json domain CHECK, where a SQL function can never be +--! {{prefix}}.query_json domain CHECK, where a SQL function can never be --! inlined (and the CHECK itself cannot absorb this body — it needs a --! subquery over the sv elements, which CHECK constraints forbid). plpgsql --! caches its plan across calls instead of paying the per-call SQL-function --! executor on every needle cast. -CREATE OR REPLACE FUNCTION public.eql_v3_is_valid_ste_vec_query_payload(val jsonb) +CREATE OR REPLACE FUNCTION public.{{prefix}}_is_valid_ste_vec_query_payload(val jsonb) RETURNS boolean LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE AS $$ @@ -85,21 +85,21 @@ $$; --! @internal --! @param val jsonb Candidate document payload. --! @return boolean True when `val` is an encrypted document envelope with ---! `v = 3`, `i`, a string key header `h`, an `sv` array, and valid +--! `v = {{eql_version}}`, `i`, a string key header `h`, an `sv` array, and valid --! sv entry elements. `h` carries the document's key-retrieval --! material once (every entry encrypts under the document's single --! data key; entry `c` values are raw AEAD output whose nonces are --! derived from the entries' selectors) — it is opaque to SQL and --! only ever carried/grafted, never parsed. Unknown envelope keys are --! rejected; `k` and `a` remain optional compatibility fields. -CREATE OR REPLACE FUNCTION public.eql_v3_is_valid_ste_vec_document_payload(val jsonb) +CREATE OR REPLACE FUNCTION public.{{prefix}}_is_valid_ste_vec_document_payload(val jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ SELECT COALESCE( jsonb_typeof(val) = 'object' AND val ? 'v' - AND val ->> 'v' = '3' + AND val ->> 'v' = '{{eql_version}}' AND val ? 'i' AND jsonb_typeof(val -> 'h') = 'string' AND jsonb_typeof(val -> 'sv') = 'array' @@ -109,7 +109,7 @@ AS $$ FROM jsonb_array_elements( CASE WHEN jsonb_typeof(val -> 'sv') = 'array' THEN val -> 'sv' ELSE '[]'::jsonb END ) AS elem - WHERE NOT public.eql_v3_is_valid_ste_vec_entry_payload(elem) + WHERE NOT public.{{prefix}}_is_valid_ste_vec_entry_payload(elem) ), false ) @@ -117,32 +117,32 @@ $$; --! @brief Storage/root domain for an encrypted JSONB column. --! ---! CHECK: a JSON object carrying the EQL envelope (`v = 3` version, `i` index +--! CHECK: a JSON object carrying the EQL envelope (`v = {{eql_version}}` version, `i` index --! metadata, and the key header `h`). Root `c` is intentionally NOT required — --! an sv-array root payload is `{i, v, h, sv}` with no root ciphertext (the --! root document ciphertext lives on the root sv entry). The CHECK also --! requires an `sv` array, so the domain accepts only SteVec **document** --! payloads and rejects encrypted *scalar* payloads (which carry `c`/`hm`/`ob` ---! but no `sv`) — this is what keeps `public.eql_v3_json_search` a typed +--! but no `sv`) — this is what keeps `public.{{prefix}}_json_search` a typed --! document domain rather than a generic encrypted envelope. The firewall in --! blockers.sql attaches to this domain to stop native jsonb operators from --! reaching a column value. --! --! @note Constructing from inline JSON uses the standard DOMAIN cast: ---! `'{"i":{},"v":3,"h":"...","sv":[...]}'::public.eql_v3_json_search`. +--! `'{"i":{},"v":{{eql_version}},"h":"...","sv":[...]}'::public.{{prefix}}_json_search`. DO $$ BEGIN IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_json_search' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_json_search' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_json_search AS jsonb + CREATE DOMAIN public.{{prefix}}_json_search AS jsonb CHECK ( - public.eql_v3_is_valid_ste_vec_document_payload(VALUE) + public.{{prefix}}_is_valid_ste_vec_document_payload(VALUE) ); END IF; - COMMENT ON DOMAIN public.eql_v3_json_search IS 'EQL encrypted JSONB searchable document (containment)'; + COMMENT ON DOMAIN public.{{prefix}}_json_search IS 'EQL encrypted JSONB searchable document (containment)'; END $$; @@ -154,8 +154,8 @@ $$; --! (value-inclusive selectors) and non-orderable path entries are term-less --! `{s, c}`: exact matching is selector presence, so there is no per-value --! equality term (`hm` is retired and rejected). This is the type returned by ---! `->` and accepted by the per-entry extractors `eql_v3.ope_term` / ---! `eql_v3.ord_term`. The deprecated `eq_term(json_entry)` name aliases +--! `->` and accepted by the per-entry extractors `{{prefix}}.ope_term` / +--! `{{prefix}}.ord_term`. The deprecated `eq_term(json_entry)` name aliases --! `ope_term`. The optional array marker `a` and root `i`/`v`/`h` --! metadata merged in by `->` are the only additional fields accepted. --! @@ -163,7 +163,7 @@ $$; --! --! @internal --! Implementation note (issue #354): the CHECK is an INLINE expression, not a ---! call to `public.eql_v3_is_valid_ste_vec_entry_payload` — domain +--! call to `public.{{prefix}}_is_valid_ste_vec_entry_payload` — domain --! constraints cannot inline SQL functions, so the function-call form paid --! the per-call SQL-function executor (~18 µs) on EVERY cast: the needle --! cast in every field_eq query (+19% end-to-end vs v2, the entire measured @@ -178,9 +178,9 @@ DO $$ BEGIN IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_json_entry' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_json_entry' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_json_entry AS jsonb + CREATE DOMAIN public.{{prefix}}_json_entry AS jsonb CHECK ( VALUE IS NULL OR COALESCE( @@ -196,7 +196,7 @@ BEGIN ); END IF; - COMMENT ON DOMAIN public.eql_v3_json_entry IS 'EQL encrypted JSONB leaf entry (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_json_entry IS 'EQL encrypted JSONB leaf entry (equality, ordering)'; END $$; @@ -210,36 +210,36 @@ $$; --! casting and matching every row via bare `jsonb @>`. --! --! @note Construct from inline JSON via the DOMAIN cast: ---! `'{"sv":[{"s":""}]}'::eql_v3.query_json`. ---! @see eql_v3.to_ste_vec_query +--! `'{"sv":[{"s":""}]}'::{{prefix}}.query_json`. +--! @see {{prefix}}.to_ste_vec_query --! --! @internal --! Implementation note (issue #354): this CHECK CANNOT be inlined like ---! public.eql_v3_json_entry's — validating the sv elements requires a subquery +--! public.{{prefix}}_json_entry's — validating the sv elements requires a subquery --! (`NOT EXISTS (SELECT ... FROM jsonb_array_elements(...))`), and CHECK --! constraints forbid subqueries. The validator is plpgsql instead (cached --! plan; substantially cheaper per call than a non-inlined LANGUAGE sql --! function — the same finding as issue #353), since this cast sits on the --! per-query hot path of every containment scenario ---! (`$1::jsonb::eql_v3.query_json`). +--! (`$1::jsonb::{{prefix}}.query_json`). --! @endinternal DO $$ BEGIN IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_json' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_json' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_json AS jsonb + CREATE DOMAIN {{prefix}}.query_json AS jsonb CHECK ( - public.eql_v3_is_valid_ste_vec_query_payload(VALUE) + public.{{prefix}}_is_valid_ste_vec_query_payload(VALUE) ); END IF; - COMMENT ON DOMAIN eql_v3.query_json IS 'EQL JSONB query operand (containment)'; + COMMENT ON DOMAIN {{prefix}}.query_json IS 'EQL JSONB query operand (containment)'; END $$; ---! @brief Convert a public.eql_v3_json_search to a query_json needle. +--! @brief Convert a public.{{prefix}}_json_search to a query_json needle. --! --! Normalises each sv element down to its selector `s`. Exact and structural --! containment are both selector-set containment; an `op` carried by a legacy @@ -247,13 +247,13 @@ $$; --! but is not part of the containment predicate. Other fields are stripped. --! This is the canonical needle shape for `@>` containment and the functional --! GIN index expression: ---! `GIN (eql_v3.to_ste_vec_query(col)::jsonb jsonb_path_ops)`. +--! `GIN ({{prefix}}.to_ste_vec_query(col)::jsonb jsonb_path_ops)`. --! ---! @param e public.eql_v3_json_search Source encrypted payload ---! @return eql_v3.query_json Query-shaped needle, sv elements normalised. ---! @see eql_v3.query_json -CREATE FUNCTION eql_v3.to_ste_vec_query(e public.eql_v3_json_search) - RETURNS eql_v3.query_json +--! @param e public.{{prefix}}_json_search Source encrypted payload +--! @return {{prefix}}.query_json Query-shaped needle, sv elements normalised. +--! @see {{prefix}}.query_json +CREATE FUNCTION {{prefix}}.to_ste_vec_query(e public.{{prefix}}_json_search) + RETURNS {{prefix}}.query_json LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ SELECT jsonb_build_object( @@ -269,7 +269,7 @@ AS $$ FROM jsonb_array_elements(e::jsonb -> 'sv') AS elem), '[]'::jsonb ) - )::eql_v3.query_json + )::{{prefix}}.query_json $$; --! @brief Normalise an already query-shaped needle to selector-only form. @@ -278,8 +278,8 @@ $$; --! therefore carry the path entry's `op`. Containment is selector-set --! containment, so this overload strips `op` before comparison and keeps every --! public containment entry point semantically identical. -CREATE FUNCTION eql_v3.to_ste_vec_query(e eql_v3.query_json) - RETURNS eql_v3.query_json +CREATE FUNCTION {{prefix}}.to_ste_vec_query(e {{prefix}}.query_json) + RETURNS {{prefix}}.query_json LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ SELECT jsonb_build_object( @@ -289,9 +289,9 @@ AS $$ FROM jsonb_array_elements(e::jsonb -> 'sv') AS elem), '[]'::jsonb ) - )::eql_v3.query_json + )::{{prefix}}.query_json $$; -CREATE CAST (public.eql_v3_json_search AS eql_v3.query_json) - WITH FUNCTION eql_v3.to_ste_vec_query(public.eql_v3_json_search) +CREATE CAST (public.{{prefix}}_json_search AS {{prefix}}.query_json) + WITH FUNCTION {{prefix}}.to_ste_vec_query(public.{{prefix}}_json_search) AS ASSIGNMENT; diff --git a/packages/eql/src/v3/lint/lints.sql b/packages/eql/src/v3/lint/lints.sql index 69878bf80..1e87deade 100644 --- a/packages/eql/src/v3/lint/lints.sql +++ b/packages/eql/src/v3/lint/lints.sql @@ -2,7 +2,7 @@ --! @brief EQL lint: detect non-inlinable operator implementation functions --! ---! Returns one row per violation found in the installed `eql_v3` surface. The +--! Returns one row per violation found in the installed `{{prefix}}` surface. The --! Postgres planner can only inline a function during index matching when: --! --! * `LANGUAGE sql` (plpgsql / C / etc. cannot be inlined) @@ -18,11 +18,11 @@ --! remaining non-inlinable. Implementing the check requires walking `prosrc` --! (or `pg_get_functiondef`); tracked as a follow-up. --! ---! Operators on `eql_v3` types (the jsonb-backed encrypted-domain families and ---! the SEM index-term type `eql_v3_internal.ore_block_256`) whose +--! Operators on `{{prefix}}` types (the jsonb-backed encrypted-domain families and +--! the SEM index-term type `{{prefix}}_internal.ore_block_256`) whose --! implementation functions fail any of these rules silently fall back to seq ---! scan when the documented functional indexes (`eql_v3.eq_term(col)`, ---! `eql_v3.ord_term(col)`) are in place. This lint surfaces every such case. +--! scan when the documented functional indexes (`{{prefix}}.eq_term(col)`, +--! `{{prefix}}.ord_term(col)`) are in place. This lint surfaces every such case. --! --! Severity: --! `error` — fixable, blocks index matching, ship-blocking. @@ -47,32 +47,32 @@ --! PostgreSQL skips the body and returns NULL --! on NULL arguments, silently bypassing the --! RAISE. ---! `domain_over_domain` — an `eql_v3` encrypted domain is derived from +--! `domain_over_domain` — an `{{prefix}}` encrypted domain is derived from --! another encrypted domain rather than jsonb. --! Operators resolve against the ultimate base --! type, so the derived domain does not --! inherit the base domain's blocker surface. --! `domain_opclass` — an operator class is declared FOR TYPE on an ---! `eql_v3` encrypted domain. Opclasses on +--! `{{prefix}}` encrypted domain. Opclasses on --! domains bypass operator resolution; use a --! functional index on the extractor instead. --! `schema_placement` — a naked composite or enum TYPE lives in the ---! public `eql_v3` schema. Internal index-term +--! public `{{prefix}}` schema. Internal index-term --! types (e.g. `ore_block_256_term`) belong in ---! `eql_v3_internal`; a composite/enum in ---! `eql_v3` clutters the Supabase Table Builder +--! `{{prefix}}_internal`; a composite/enum in +--! `{{prefix}}` clutters the Supabase Table Builder --! type picker, which the schema split exists to ---! prevent. Move it to `eql_v3_internal`. +--! prevent. Move it to `{{prefix}}_internal`. --! --! @code{.sql} --! SELECT severity, category, object_name, message ---! FROM eql_v3.lints() +--! FROM {{prefix}}.lints() --! WHERE severity = 'error' --! ORDER BY category, object_name; --! @endcode --! --! @return SETOF record (severity text, category text, object_name text, message text) -CREATE OR REPLACE FUNCTION eql_v3.lints() +CREATE OR REPLACE FUNCTION {{prefix}}.lints() RETURNS TABLE ( severity text, category text, @@ -85,7 +85,11 @@ AS $$ -- User-column encrypted domains now live in public so application tables -- survive EQL uninstall. Keep this separate from owned_schemas(): public is -- not installer-owned, but its EQL jsonb-backed domains are still the domain - -- types whose blockers/operator surfaces the lint must understand. + -- types whose blockers/operator surfaces the lint must understand. Only this + -- version's public domains: with EQL v3 and v4 installed side by side, the + -- other version's domains and blockers are not this lint's to judge, and its + -- blockers sit outside owned_schemas() where they would read as errors. + -- starts_with, not LIKE: the underscores in the prefix are LIKE wildcards. encrypted_domain_types AS ( SELECT dt.oid AS typid @@ -97,8 +101,8 @@ AS $$ AND bt.typname = 'jsonb' AND bn.nspname = 'pg_catalog' AND ( - dn.nspname = 'public' - OR dn.nspname = ANY(eql_v3_internal.owned_schemas()) + (dn.nspname = 'public' AND starts_with(dt.typname::text, '{{prefix}}_')) + OR dn.nspname = ANY({{prefix}}_internal.owned_schemas()) ) ), @@ -118,7 +122,7 @@ AS $$ SELECT 1 FROM pg_type t WHERE t.oid IN (op.oprleft, op.oprright) AND ( - t.typnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = ANY(eql_v3_internal.owned_schemas())) + t.typnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = ANY({{prefix}}_internal.owned_schemas())) OR t.oid IN (SELECT typid FROM encrypted_domain_types) ) ) @@ -143,7 +147,7 @@ AS $$ JOIN pg_language lang_l ON lang_l.oid = p.prolang ), - -- Encrypted-domain blockers: functions in `eql_v3` whose body contains + -- Encrypted-domain blockers: functions in `{{prefix}}` whose body contains -- a blocker marker emitted by the codegen (any of the -- `encrypted_domain_unsupported_*` helper calls — `_bool` for boolean -- blockers, `_jsonb` for the native-jsonb-operator blockers; plus the @@ -161,7 +165,7 @@ AS $$ FROM pg_catalog.pg_proc p JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace JOIN pg_catalog.pg_language lang_l ON lang_l.oid = p.prolang - WHERE n.nspname = ANY(eql_v3_internal.owned_schemas()) + WHERE n.nspname = ANY({{prefix}}_internal.owned_schemas()) AND (p.prosrc LIKE '%encrypted_domain_unsupported%' OR p.prosrc LIKE '%is not supported for%') AND EXISTS ( @@ -343,7 +347,7 @@ AS $$ JOIN pg_catalog.pg_type bt ON bt.oid = dt.typbasetype JOIN pg_catalog.pg_namespace bn ON bn.oid = bt.typnamespace WHERE dt.typtype = 'd' - AND dn.nspname = ANY(eql_v3_internal.owned_schemas()) + AND dn.nspname = ANY({{prefix}}_internal.owned_schemas()) AND bt.typtype = 'd' AND bt.oid IN (SELECT typid FROM encrypted_domain_types) @@ -369,7 +373,7 @@ AS $$ WHERE t.oid IN (SELECT typid FROM encrypted_domain_types) -- ┌─────────────────────────────────────────────────────────────────┐ - -- │ Schema placement: the public `eql_v3` schema must hold only the │ + -- │ Schema placement: the public `{{prefix}}` schema must hold only the │ -- │ jsonb-backed encrypted-domain types. A naked composite/enum type │ -- │ there is an internal index-term type in the wrong schema — it │ -- │ clutters the Supabase type picker the split exists to keep clean. │ @@ -382,19 +386,19 @@ AS $$ 'schema_placement', format('type %I.%I', n.nspname, t.typname), format( - 'Type `%s.%s` is a %s in the public `eql_v3` schema. Only jsonb-backed encrypted-domain types belong in `eql_v3`; internal index-term types belong in `eql_v3_internal` so they stay out of the Supabase Table Builder type picker. Move it to `eql_v3_internal`.', + 'Type `%s.%s` is a %s in the public `{{prefix}}` schema. Only jsonb-backed encrypted-domain types belong in `{{prefix}}`; internal index-term types belong in `{{prefix}}_internal` so they stay out of the Supabase Table Builder type picker. Move it to `{{prefix}}_internal`.', n.nspname, t.typname, CASE t.typtype WHEN 'c' THEN 'composite type' WHEN 'e' THEN 'enum type' ELSE 'type' END) FROM pg_catalog.pg_type t JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace - WHERE n.nspname = 'eql_v3' + WHERE n.nspname = '{{prefix}}' AND t.typtype IN ('c', 'e') ORDER BY 1, 2, 3; $$; -COMMENT ON FUNCTION eql_v3.lints() IS +COMMENT ON FUNCTION {{prefix}}.lints() IS 'EQL lint: returns one row per non-inlinable operator implementation. ' - 'Run `SELECT * FROM eql_v3.lints() WHERE severity = ''error''` for a ' - 'CI-gateable check that all operator implementations on eql_v3 types are ' + 'Run `SELECT * FROM {{prefix}}.lints() WHERE severity = ''error''` for a ' + 'CI-gateable check that all operator implementations on {{prefix}} types are ' 'eligible for planner inlining.'; diff --git a/packages/eql/src/v3/scalars/bigint/bigint_eq_functions.sql b/packages/eql/src/v3/scalars/bigint/bigint_eq_functions.sql index efa9f30f9..c28ef106c 100644 --- a/packages/eql/src/v3/scalars/bigint/bigint_eq_functions.sql +++ b/packages/eql/src/v3/scalars/bigint/bigint_eq_functions.sql @@ -5,634 +5,634 @@ -- REQUIRE: src/v3/sem/hmac_256/functions.sql --! @file encrypted_domain/bigint/bigint_eq_functions.sql ---! @brief Functions for public.eql_v3_bigint_eq. +--! @brief Functions for public.{{prefix}}_bigint_eq. ---! @brief Index extractor for public.eql_v3_bigint_eq. ---! @param a public.eql_v3_bigint_eq ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a public.eql_v3_bigint_eq) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for public.{{prefix}}_bigint_eq. +--! @param a public.{{prefix}}_bigint_eq +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a public.{{prefix}}_bigint_eq) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_eq. ---! @param a public.eql_v3_bigint_eq ---! @param b public.eql_v3_bigint_eq +--! @brief Operator wrapper for public.{{prefix}}_bigint_eq. +--! @param a public.{{prefix}}_bigint_eq +--! @param b public.{{prefix}}_bigint_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_bigint_eq, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_eq, b public.{{prefix}}_bigint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_eq. ---! @param a public.eql_v3_bigint_eq +--! @brief Operator wrapper for public.{{prefix}}_bigint_eq. +--! @param a public.{{prefix}}_bigint_eq --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_bigint_eq, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b::public.eql_v3_bigint_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_bigint_eq) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_eq. +--! @brief Operator wrapper for public.{{prefix}}_bigint_eq. --! @param a jsonb ---! @param b public.eql_v3_bigint_eq +--! @param b public.{{prefix}}_bigint_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_bigint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_bigint_eq) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_bigint_eq) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_eq. ---! @param a public.eql_v3_bigint_eq ---! @param b public.eql_v3_bigint_eq +--! @brief Operator wrapper for public.{{prefix}}_bigint_eq. +--! @param a public.{{prefix}}_bigint_eq +--! @param b public.{{prefix}}_bigint_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_bigint_eq, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_eq, b public.{{prefix}}_bigint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_eq. ---! @param a public.eql_v3_bigint_eq +--! @brief Operator wrapper for public.{{prefix}}_bigint_eq. +--! @param a public.{{prefix}}_bigint_eq --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_bigint_eq, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b::public.eql_v3_bigint_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_bigint_eq) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_eq. +--! @brief Operator wrapper for public.{{prefix}}_bigint_eq. --! @param a jsonb ---! @param b public.eql_v3_bigint_eq +--! @param b public.{{prefix}}_bigint_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_bigint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_bigint_eq) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_bigint_eq) <> {{prefix}}.eq_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator ---! @param b public.eql_v3_bigint_eq right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_bigint_eq, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_bigint_eq, b public.{{prefix}}_bigint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_bigint_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_bigint_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_eq right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_bigint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator ---! @param b public.eql_v3_bigint_eq right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_bigint_eq, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_bigint_eq, b public.{{prefix}}_bigint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_bigint_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_bigint_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_eq right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_bigint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator ---! @param b public.eql_v3_bigint_eq right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_bigint_eq, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_bigint_eq, b public.{{prefix}}_bigint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_bigint_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_bigint_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_eq right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_bigint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator ---! @param b public.eql_v3_bigint_eq right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_bigint_eq, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_bigint_eq, b public.{{prefix}}_bigint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_bigint_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_bigint_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_eq right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_bigint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator ---! @param b public.eql_v3_bigint_eq right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_bigint_eq, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_bigint_eq, b public.{{prefix}}_bigint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_bigint_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_bigint_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_eq right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_bigint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator ---! @param b public.eql_v3_bigint_eq right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_bigint_eq, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_bigint_eq, b public.{{prefix}}_bigint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_bigint_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_bigint_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_eq right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_bigint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_bigint_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_bigint_eq, selector text) -RETURNS public.eql_v3_bigint_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_bigint_eq'; END; $$ +--! @return public.{{prefix}}_bigint_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_bigint_eq, selector text) +RETURNS public.{{prefix}}_bigint_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_bigint_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_bigint_eq, selector integer) -RETURNS public.eql_v3_bigint_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_bigint_eq'; END; $$ +--! @return public.{{prefix}}_bigint_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_bigint_eq, selector integer) +RETURNS public.{{prefix}}_bigint_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_bigint_eq right operand of the blocked operator ---! @return public.eql_v3_bigint_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_bigint_eq) -RETURNS public.eql_v3_bigint_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_bigint_eq'; END; $$ +--! @param selector public.{{prefix}}_bigint_eq right operand of the blocked operator +--! @return public.{{prefix}}_bigint_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_bigint_eq) +RETURNS public.{{prefix}}_bigint_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_bigint_eq, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_bigint_eq, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_bigint_eq, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_bigint_eq, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_bigint_eq right operand of the blocked operator +--! @param selector public.{{prefix}}_bigint_eq right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_bigint_eq) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_bigint_eq, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_bigint_eq, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_bigint_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_bigint_eq, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_bigint_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_bigint_eq, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_bigint_eq, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_bigint_eq, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator ---! @param b public.eql_v3_bigint_eq right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_bigint_eq, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_bigint_eq, b public.{{prefix}}_bigint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_bigint_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_bigint_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_eq right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_bigint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_bigint_eq, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_bigint_eq, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_bigint_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_bigint_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_bigint_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_bigint_eq, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_bigint_eq, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_bigint_eq, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_bigint_eq, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_bigint_eq, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_bigint_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_bigint_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_bigint_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_bigint_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator ---! @param b public.eql_v3_bigint_eq right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_eq right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_bigint_eq, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_bigint_eq, b public.{{prefix}}_bigint_eq) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_bigint_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_bigint_eq, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_eq right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_eq right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_bigint_eq) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_bigint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_bigint_eq'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/bigint/bigint_eq_operators.sql b/packages/eql/src/v3/scalars/bigint/bigint_eq_operators.sql index 0bb312689..28b4f0c38 100644 --- a/packages/eql/src/v3/scalars/bigint/bigint_eq_operators.sql +++ b/packages/eql/src/v3/scalars/bigint/bigint_eq_operators.sql @@ -4,245 +4,245 @@ -- REQUIRE: src/v3/scalars/bigint/bigint_eq_functions.sql --! @file encrypted_domain/bigint/bigint_eq_operators.sql ---! @brief Operators for public.eql_v3_bigint_eq. +--! @brief Operators for public.{{prefix}}_bigint_eq. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = public.eql_v3_bigint_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = public.{{prefix}}_bigint_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = public.eql_v3_bigint_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = public.{{prefix}}_bigint_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = public.eql_v3_bigint_eq + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = public.{{prefix}}_bigint_eq ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_eq + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_eq ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = public.eql_v3_bigint_eq + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = public.{{prefix}}_bigint_eq ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_eq + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_eq ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = public.eql_v3_bigint_eq + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = public.{{prefix}}_bigint_eq ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_eq + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_eq ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = public.eql_v3_bigint_eq + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = public.{{prefix}}_bigint_eq ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_eq + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_eq ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = public.eql_v3_bigint_eq + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = public.{{prefix}}_bigint_eq ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_eq + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_eq ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = public.eql_v3_bigint_eq + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = public.{{prefix}}_bigint_eq ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_eq + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_eq ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_eq + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_eq ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_eq + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_eq ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = public.eql_v3_bigint_eq + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = public.{{prefix}}_bigint_eq ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_eq + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_eq ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = public.eql_v3_bigint_eq + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = public.{{prefix}}_bigint_eq ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_eq + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_eq ); diff --git a/packages/eql/src/v3/scalars/bigint/bigint_functions.sql b/packages/eql/src/v3/scalars/bigint/bigint_functions.sql index 1acd0d503..cc2debb8d 100644 --- a/packages/eql/src/v3/scalars/bigint/bigint_functions.sql +++ b/packages/eql/src/v3/scalars/bigint/bigint_functions.sql @@ -4,662 +4,662 @@ -- REQUIRE: src/v3/scalars/functions.sql --! @file encrypted_domain/bigint/bigint_functions.sql ---! @brief Functions for public.eql_v3_bigint. +--! @brief Functions for public.{{prefix}}_bigint. ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_bigint, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_bigint, b public.{{prefix}}_bigint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_bigint, b jsonb) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_bigint, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a jsonb, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal.eq(a jsonb, b public.{{prefix}}_bigint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_bigint, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_bigint, b public.{{prefix}}_bigint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_bigint, b jsonb) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_bigint, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a jsonb, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal.neq(a jsonb, b public.{{prefix}}_bigint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_bigint, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_bigint, b public.{{prefix}}_bigint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_bigint, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_bigint, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_bigint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_bigint, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_bigint, b public.{{prefix}}_bigint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_bigint, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_bigint, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_bigint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_bigint, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_bigint, b public.{{prefix}}_bigint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_bigint, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_bigint, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_bigint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_bigint, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_bigint, b public.{{prefix}}_bigint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_bigint, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_bigint, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_bigint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_bigint, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_bigint, b public.{{prefix}}_bigint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_bigint, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_bigint, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_bigint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_bigint, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_bigint, b public.{{prefix}}_bigint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_bigint, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_bigint, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_bigint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_bigint never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_bigint, selector text) -RETURNS public.eql_v3_bigint IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_bigint'; END; $$ +--! @return public.{{prefix}}_bigint never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_bigint, selector text) +RETURNS public.{{prefix}}_bigint IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_bigint never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_bigint, selector integer) -RETURNS public.eql_v3_bigint IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_bigint'; END; $$ +--! @return public.{{prefix}}_bigint never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_bigint, selector integer) +RETURNS public.{{prefix}}_bigint IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_bigint right operand of the blocked operator ---! @return public.eql_v3_bigint never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_bigint) -RETURNS public.eql_v3_bigint IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_bigint'; END; $$ +--! @param selector public.{{prefix}}_bigint right operand of the blocked operator +--! @return public.{{prefix}}_bigint never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_bigint) +RETURNS public.{{prefix}}_bigint IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_bigint, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_bigint, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_bigint, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_bigint, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_bigint right operand of the blocked operator +--! @param selector public.{{prefix}}_bigint right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_bigint) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_bigint, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_bigint, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_bigint, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_bigint, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_bigint, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_bigint, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_bigint, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_bigint, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_bigint, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_bigint, b public.{{prefix}}_bigint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_bigint, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_bigint, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_bigint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_bigint, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_bigint, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_bigint, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_bigint, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_bigint, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_bigint, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_bigint, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_bigint, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_bigint, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_bigint, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_bigint, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_bigint, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_bigint, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_bigint, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_bigint, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_bigint, b public.{{prefix}}_bigint) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint left operand of the blocked operator +--! @param a public.{{prefix}}_bigint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_bigint, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_bigint, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint right operand of the blocked operator +--! @param b public.{{prefix}}_bigint right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_bigint) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_bigint) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_bigint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_bigint'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/bigint/bigint_operators.sql b/packages/eql/src/v3/scalars/bigint/bigint_operators.sql index 46170b430..0e1a9e6af 100644 --- a/packages/eql/src/v3/scalars/bigint/bigint_operators.sql +++ b/packages/eql/src/v3/scalars/bigint/bigint_operators.sql @@ -4,239 +4,239 @@ -- REQUIRE: src/v3/scalars/bigint/bigint_functions.sql --! @file encrypted_domain/bigint/bigint_operators.sql ---! @brief Operators for public.eql_v3_bigint. +--! @brief Operators for public.{{prefix}}_bigint. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_bigint, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_bigint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = jsonb ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_bigint, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_bigint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = jsonb ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_bigint, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_bigint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_bigint, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_bigint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_bigint, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_bigint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_bigint, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_bigint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_bigint, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_bigint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_bigint, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_bigint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_bigint, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_bigint, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_bigint, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_bigint, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_bigint, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_bigint, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_bigint, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_bigint, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_bigint, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_bigint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_bigint, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_bigint, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_bigint, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_bigint, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_bigint, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_bigint, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_bigint, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_bigint, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = public.{{prefix}}_bigint ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_bigint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_bigint, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint ); diff --git a/packages/eql/src/v3/scalars/bigint/bigint_ord_aggregates.sql b/packages/eql/src/v3/scalars/bigint/bigint_ord_aggregates.sql index b4d508d87..eedcba3d8 100644 --- a/packages/eql/src/v3/scalars/bigint/bigint_ord_aggregates.sql +++ b/packages/eql/src/v3/scalars/bigint/bigint_ord_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/bigint/bigint_ord_operators.sql --! @file encrypted_domain/bigint/bigint_ord_aggregates.sql ---! @brief Aggregates for public.eql_v3_bigint_ord. +--! @brief Aggregates for public.{{prefix}}_bigint_ord. ---! @brief State function for min on public.eql_v3_bigint_ord. ---! @param state public.eql_v3_bigint_ord ---! @param value public.eql_v3_bigint_ord ---! @return public.eql_v3_bigint_ord -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_bigint_ord, value public.eql_v3_bigint_ord) -RETURNS public.eql_v3_bigint_ord +--! @brief State function for min on public.{{prefix}}_bigint_ord. +--! @param state public.{{prefix}}_bigint_ord +--! @param value public.{{prefix}}_bigint_ord +--! @return public.{{prefix}}_bigint_ord +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_bigint_ord, value public.{{prefix}}_bigint_ord) +RETURNS public.{{prefix}}_bigint_ord LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_bigint_ord. ---! @param input public.eql_v3_bigint_ord ---! @return public.eql_v3_bigint_ord -CREATE AGGREGATE eql_v3.min(public.eql_v3_bigint_ord) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_bigint_ord, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_bigint_ord. +--! @param input public.{{prefix}}_bigint_ord +--! @return public.{{prefix}}_bigint_ord +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_bigint_ord) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_bigint_ord, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_bigint_ord. ---! @param state public.eql_v3_bigint_ord ---! @param value public.eql_v3_bigint_ord ---! @return public.eql_v3_bigint_ord -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_bigint_ord, value public.eql_v3_bigint_ord) -RETURNS public.eql_v3_bigint_ord +--! @brief State function for max on public.{{prefix}}_bigint_ord. +--! @param state public.{{prefix}}_bigint_ord +--! @param value public.{{prefix}}_bigint_ord +--! @return public.{{prefix}}_bigint_ord +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_bigint_ord, value public.{{prefix}}_bigint_ord) +RETURNS public.{{prefix}}_bigint_ord LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_bigint_ord. ---! @param input public.eql_v3_bigint_ord ---! @return public.eql_v3_bigint_ord -CREATE AGGREGATE eql_v3.max(public.eql_v3_bigint_ord) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_bigint_ord, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_bigint_ord. +--! @param input public.{{prefix}}_bigint_ord +--! @return public.{{prefix}}_bigint_ord +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_bigint_ord) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_bigint_ord, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/bigint/bigint_ord_functions.sql b/packages/eql/src/v3/scalars/bigint/bigint_ord_functions.sql index 77acfe426..ad9b327d0 100644 --- a/packages/eql/src/v3/scalars/bigint/bigint_ord_functions.sql +++ b/packages/eql/src/v3/scalars/bigint/bigint_ord_functions.sql @@ -5,562 +5,562 @@ -- REQUIRE: src/v3/sem/ope_cllw/functions.sql --! @file encrypted_domain/bigint/bigint_ord_functions.sql ---! @brief Functions for public.eql_v3_bigint_ord. +--! @brief Functions for public.{{prefix}}_bigint_ord. ---! @brief Index extractor for public.eql_v3_bigint_ord. ---! @param a public.eql_v3_bigint_ord ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a public.eql_v3_bigint_ord) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for public.{{prefix}}_bigint_ord. +--! @param a public.{{prefix}}_bigint_ord +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a public.{{prefix}}_bigint_ord) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord. ---! @param a public.eql_v3_bigint_ord ---! @param b public.eql_v3_bigint_ord +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord. +--! @param a public.{{prefix}}_bigint_ord +--! @param b public.{{prefix}}_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_bigint_ord, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord. ---! @param a public.eql_v3_bigint_ord +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord. +--! @param a public.{{prefix}}_bigint_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_bigint_ord, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b::public.eql_v3_bigint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord. +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a jsonb ---! @param b public.eql_v3_bigint_ord +--! @param b public.{{prefix}}_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_bigint_ord) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord. ---! @param a public.eql_v3_bigint_ord ---! @param b public.eql_v3_bigint_ord +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord. +--! @param a public.{{prefix}}_bigint_ord +--! @param b public.{{prefix}}_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_bigint_ord, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord. ---! @param a public.eql_v3_bigint_ord +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord. +--! @param a public.{{prefix}}_bigint_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_bigint_ord, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b::public.eql_v3_bigint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord. +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a jsonb ---! @param b public.eql_v3_bigint_ord +--! @param b public.{{prefix}}_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_bigint_ord) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord. ---! @param a public.eql_v3_bigint_ord ---! @param b public.eql_v3_bigint_ord +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord. +--! @param a public.{{prefix}}_bigint_ord +--! @param b public.{{prefix}}_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_bigint_ord, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord. ---! @param a public.eql_v3_bigint_ord +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord. +--! @param a public.{{prefix}}_bigint_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_bigint_ord, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_bigint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b::public.eql_v3_bigint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord. +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a jsonb ---! @param b public.eql_v3_bigint_ord +--! @param b public.{{prefix}}_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_bigint_ord) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord. ---! @param a public.eql_v3_bigint_ord ---! @param b public.eql_v3_bigint_ord +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord. +--! @param a public.{{prefix}}_bigint_ord +--! @param b public.{{prefix}}_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_bigint_ord, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord. ---! @param a public.eql_v3_bigint_ord +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord. +--! @param a public.{{prefix}}_bigint_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_bigint_ord, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_bigint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b::public.eql_v3_bigint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord. +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a jsonb ---! @param b public.eql_v3_bigint_ord +--! @param b public.{{prefix}}_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_bigint_ord) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord. ---! @param a public.eql_v3_bigint_ord ---! @param b public.eql_v3_bigint_ord +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord. +--! @param a public.{{prefix}}_bigint_ord +--! @param b public.{{prefix}}_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_bigint_ord, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord. ---! @param a public.eql_v3_bigint_ord +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord. +--! @param a public.{{prefix}}_bigint_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_bigint_ord, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_bigint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b::public.eql_v3_bigint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord. +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a jsonb ---! @param b public.eql_v3_bigint_ord +--! @param b public.{{prefix}}_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_bigint_ord) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord. ---! @param a public.eql_v3_bigint_ord ---! @param b public.eql_v3_bigint_ord +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord. +--! @param a public.{{prefix}}_bigint_ord +--! @param b public.{{prefix}}_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_bigint_ord, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord. ---! @param a public.eql_v3_bigint_ord +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord. +--! @param a public.{{prefix}}_bigint_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_bigint_ord, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_bigint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b::public.eql_v3_bigint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord. +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a jsonb ---! @param b public.eql_v3_bigint_ord +--! @param b public.{{prefix}}_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_bigint_ord) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_bigint_ord, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_bigint_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_bigint_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_bigint_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_bigint_ord, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_bigint_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_bigint_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_bigint_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_bigint_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_bigint_ord, selector text) -RETURNS public.eql_v3_bigint_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_bigint_ord'; END; $$ +--! @return public.{{prefix}}_bigint_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_bigint_ord, selector text) +RETURNS public.{{prefix}}_bigint_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_bigint_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_bigint_ord, selector integer) -RETURNS public.eql_v3_bigint_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_bigint_ord'; END; $$ +--! @return public.{{prefix}}_bigint_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_bigint_ord, selector integer) +RETURNS public.{{prefix}}_bigint_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_bigint_ord right operand of the blocked operator ---! @return public.eql_v3_bigint_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_bigint_ord) -RETURNS public.eql_v3_bigint_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_bigint_ord'; END; $$ +--! @param selector public.{{prefix}}_bigint_ord right operand of the blocked operator +--! @return public.{{prefix}}_bigint_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_bigint_ord) +RETURNS public.{{prefix}}_bigint_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_bigint_ord, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_bigint_ord, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_bigint_ord, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_bigint_ord, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_bigint_ord right operand of the blocked operator +--! @param selector public.{{prefix}}_bigint_ord right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_bigint_ord) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_bigint_ord, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_bigint_ord, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_bigint_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_bigint_ord, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_bigint_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_bigint_ord, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_bigint_ord, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_bigint_ord, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_bigint_ord, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_bigint_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_bigint_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_bigint_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_bigint_ord, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_bigint_ord, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_bigint_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_bigint_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_bigint_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_bigint_ord, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_bigint_ord, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_bigint_ord, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_bigint_ord, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_bigint_ord, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_bigint_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_bigint_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_bigint_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_bigint_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_bigint_ord, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_bigint_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_bigint_ord, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_bigint_ord) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_bigint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_bigint_ord'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/bigint/bigint_ord_ope_aggregates.sql b/packages/eql/src/v3/scalars/bigint/bigint_ord_ope_aggregates.sql index 4e09605c1..58d86e1c6 100644 --- a/packages/eql/src/v3/scalars/bigint/bigint_ord_ope_aggregates.sql +++ b/packages/eql/src/v3/scalars/bigint/bigint_ord_ope_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/bigint/bigint_ord_ope_operators.sql --! @file encrypted_domain/bigint/bigint_ord_ope_aggregates.sql ---! @brief Aggregates for public.eql_v3_bigint_ord_ope. +--! @brief Aggregates for public.{{prefix}}_bigint_ord_ope. ---! @brief State function for min on public.eql_v3_bigint_ord_ope. ---! @param state public.eql_v3_bigint_ord_ope ---! @param value public.eql_v3_bigint_ord_ope ---! @return public.eql_v3_bigint_ord_ope -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_bigint_ord_ope, value public.eql_v3_bigint_ord_ope) -RETURNS public.eql_v3_bigint_ord_ope +--! @brief State function for min on public.{{prefix}}_bigint_ord_ope. +--! @param state public.{{prefix}}_bigint_ord_ope +--! @param value public.{{prefix}}_bigint_ord_ope +--! @return public.{{prefix}}_bigint_ord_ope +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_bigint_ord_ope, value public.{{prefix}}_bigint_ord_ope) +RETURNS public.{{prefix}}_bigint_ord_ope LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_bigint_ord_ope. ---! @param input public.eql_v3_bigint_ord_ope ---! @return public.eql_v3_bigint_ord_ope -CREATE AGGREGATE eql_v3.min(public.eql_v3_bigint_ord_ope) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_bigint_ord_ope, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_bigint_ord_ope. +--! @param input public.{{prefix}}_bigint_ord_ope +--! @return public.{{prefix}}_bigint_ord_ope +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_bigint_ord_ope) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_bigint_ord_ope, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_bigint_ord_ope. ---! @param state public.eql_v3_bigint_ord_ope ---! @param value public.eql_v3_bigint_ord_ope ---! @return public.eql_v3_bigint_ord_ope -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_bigint_ord_ope, value public.eql_v3_bigint_ord_ope) -RETURNS public.eql_v3_bigint_ord_ope +--! @brief State function for max on public.{{prefix}}_bigint_ord_ope. +--! @param state public.{{prefix}}_bigint_ord_ope +--! @param value public.{{prefix}}_bigint_ord_ope +--! @return public.{{prefix}}_bigint_ord_ope +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_bigint_ord_ope, value public.{{prefix}}_bigint_ord_ope) +RETURNS public.{{prefix}}_bigint_ord_ope LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_bigint_ord_ope. ---! @param input public.eql_v3_bigint_ord_ope ---! @return public.eql_v3_bigint_ord_ope -CREATE AGGREGATE eql_v3.max(public.eql_v3_bigint_ord_ope) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_bigint_ord_ope, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_bigint_ord_ope. +--! @param input public.{{prefix}}_bigint_ord_ope +--! @return public.{{prefix}}_bigint_ord_ope +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_bigint_ord_ope) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_bigint_ord_ope, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/bigint/bigint_ord_ope_functions.sql b/packages/eql/src/v3/scalars/bigint/bigint_ord_ope_functions.sql index 478a60db1..70ef50924 100644 --- a/packages/eql/src/v3/scalars/bigint/bigint_ord_ope_functions.sql +++ b/packages/eql/src/v3/scalars/bigint/bigint_ord_ope_functions.sql @@ -5,562 +5,562 @@ -- REQUIRE: src/v3/sem/ope_cllw/functions.sql --! @file encrypted_domain/bigint/bigint_ord_ope_functions.sql ---! @brief Functions for public.eql_v3_bigint_ord_ope. +--! @brief Functions for public.{{prefix}}_bigint_ord_ope. ---! @brief Index extractor for public.eql_v3_bigint_ord_ope. ---! @param a public.eql_v3_bigint_ord_ope ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a public.eql_v3_bigint_ord_ope) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for public.{{prefix}}_bigint_ord_ope. +--! @param a public.{{prefix}}_bigint_ord_ope +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a public.{{prefix}}_bigint_ord_ope) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ope. ---! @param a public.eql_v3_bigint_ord_ope ---! @param b public.eql_v3_bigint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. +--! @param a public.{{prefix}}_bigint_ord_ope +--! @param b public.{{prefix}}_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_bigint_ord_ope, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ope. ---! @param a public.eql_v3_bigint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. +--! @param a public.{{prefix}}_bigint_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_bigint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b::public.eql_v3_bigint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_bigint_ord_ope +--! @param b public.{{prefix}}_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_bigint_ord_ope) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ope. ---! @param a public.eql_v3_bigint_ord_ope ---! @param b public.eql_v3_bigint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. +--! @param a public.{{prefix}}_bigint_ord_ope +--! @param b public.{{prefix}}_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_bigint_ord_ope, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ope. ---! @param a public.eql_v3_bigint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. +--! @param a public.{{prefix}}_bigint_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_bigint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b::public.eql_v3_bigint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_bigint_ord_ope +--! @param b public.{{prefix}}_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_bigint_ord_ope) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ope. ---! @param a public.eql_v3_bigint_ord_ope ---! @param b public.eql_v3_bigint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. +--! @param a public.{{prefix}}_bigint_ord_ope +--! @param b public.{{prefix}}_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_bigint_ord_ope, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ope. ---! @param a public.eql_v3_bigint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. +--! @param a public.{{prefix}}_bigint_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_bigint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_bigint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b::public.eql_v3_bigint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_bigint_ord_ope +--! @param b public.{{prefix}}_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_bigint_ord_ope) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ope. ---! @param a public.eql_v3_bigint_ord_ope ---! @param b public.eql_v3_bigint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. +--! @param a public.{{prefix}}_bigint_ord_ope +--! @param b public.{{prefix}}_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_bigint_ord_ope, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ope. ---! @param a public.eql_v3_bigint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. +--! @param a public.{{prefix}}_bigint_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_bigint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_bigint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b::public.eql_v3_bigint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_bigint_ord_ope +--! @param b public.{{prefix}}_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_bigint_ord_ope) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ope. ---! @param a public.eql_v3_bigint_ord_ope ---! @param b public.eql_v3_bigint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. +--! @param a public.{{prefix}}_bigint_ord_ope +--! @param b public.{{prefix}}_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_bigint_ord_ope, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ope. ---! @param a public.eql_v3_bigint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. +--! @param a public.{{prefix}}_bigint_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_bigint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_bigint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b::public.eql_v3_bigint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_bigint_ord_ope +--! @param b public.{{prefix}}_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_bigint_ord_ope) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ope. ---! @param a public.eql_v3_bigint_ord_ope ---! @param b public.eql_v3_bigint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. +--! @param a public.{{prefix}}_bigint_ord_ope +--! @param b public.{{prefix}}_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_bigint_ord_ope, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ope. ---! @param a public.eql_v3_bigint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. +--! @param a public.{{prefix}}_bigint_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_bigint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_bigint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b::public.eql_v3_bigint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_bigint_ord_ope +--! @param b public.{{prefix}}_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_bigint_ord_ope) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_bigint_ord_ope, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_bigint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_bigint_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_bigint_ord_ope, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_bigint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_bigint_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_bigint_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_bigint_ord_ope, selector text) -RETURNS public.eql_v3_bigint_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_bigint_ord_ope'; END; $$ +--! @return public.{{prefix}}_bigint_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_bigint_ord_ope, selector text) +RETURNS public.{{prefix}}_bigint_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_bigint_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_bigint_ord_ope, selector integer) -RETURNS public.eql_v3_bigint_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_bigint_ord_ope'; END; $$ +--! @return public.{{prefix}}_bigint_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_bigint_ord_ope, selector integer) +RETURNS public.{{prefix}}_bigint_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_bigint_ord_ope right operand of the blocked operator ---! @return public.eql_v3_bigint_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_bigint_ord_ope) -RETURNS public.eql_v3_bigint_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_bigint_ord_ope'; END; $$ +--! @param selector public.{{prefix}}_bigint_ord_ope right operand of the blocked operator +--! @return public.{{prefix}}_bigint_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_bigint_ord_ope) +RETURNS public.{{prefix}}_bigint_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_bigint_ord_ope, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_bigint_ord_ope, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_bigint_ord_ope, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_bigint_ord_ope, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_bigint_ord_ope right operand of the blocked operator +--! @param selector public.{{prefix}}_bigint_ord_ope right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_bigint_ord_ope) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_bigint_ord_ope, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_bigint_ord_ope, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_bigint_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_bigint_ord_ope, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_bigint_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_bigint_ord_ope, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_bigint_ord_ope, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_bigint_ord_ope, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_bigint_ord_ope, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_bigint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_bigint_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_bigint_ord_ope, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_bigint_ord_ope, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_bigint_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_bigint_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_bigint_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_bigint_ord_ope, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_bigint_ord_ope, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_bigint_ord_ope, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_bigint_ord_ope, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_bigint_ord_ope, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_bigint_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_bigint_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_bigint_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_bigint_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord_ope right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_bigint_ord_ope, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ope) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_bigint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_bigint_ord_ope, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord_ope right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_bigint_ord_ope) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_bigint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_bigint_ord_ope'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/bigint/bigint_ord_ope_operators.sql b/packages/eql/src/v3/scalars/bigint/bigint_ord_ope_operators.sql index 65c515f20..32e990646 100644 --- a/packages/eql/src/v3/scalars/bigint/bigint_ord_ope_operators.sql +++ b/packages/eql/src/v3/scalars/bigint/bigint_ord_ope_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/bigint/bigint_ord_ope_functions.sql --! @file encrypted_domain/bigint/bigint_ord_ope_operators.sql ---! @brief Operators for public.eql_v3_bigint_ord_ope. +--! @brief Operators for public.{{prefix}}_bigint_ord_ope. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = public.eql_v3_bigint_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = public.eql_v3_bigint_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = public.eql_v3_bigint_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = public.eql_v3_bigint_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = public.eql_v3_bigint_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = public.eql_v3_bigint_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = public.eql_v3_bigint_ord_ope + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ope ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ope + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ope ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = public.eql_v3_bigint_ord_ope + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ope ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ope + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ope ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ope + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ope ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ope + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ope ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = public.eql_v3_bigint_ord_ope + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ope ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ope + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ope ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = public.eql_v3_bigint_ord_ope + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ope ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ope + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ope ); diff --git a/packages/eql/src/v3/scalars/bigint/bigint_ord_operators.sql b/packages/eql/src/v3/scalars/bigint/bigint_ord_operators.sql index c86e76306..9742bc09c 100644 --- a/packages/eql/src/v3/scalars/bigint/bigint_ord_operators.sql +++ b/packages/eql/src/v3/scalars/bigint/bigint_ord_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/bigint/bigint_ord_functions.sql --! @file encrypted_domain/bigint/bigint_ord_operators.sql ---! @brief Operators for public.eql_v3_bigint_ord. +--! @brief Operators for public.{{prefix}}_bigint_ord. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = public.eql_v3_bigint_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = public.eql_v3_bigint_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = public.eql_v3_bigint_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = public.eql_v3_bigint_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = public.eql_v3_bigint_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = public.eql_v3_bigint_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = public.eql_v3_bigint_ord + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = public.eql_v3_bigint_ord + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = public.eql_v3_bigint_ord + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = public.eql_v3_bigint_ord + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord ); diff --git a/packages/eql/src/v3/scalars/bigint/bigint_ord_ore_aggregates.sql b/packages/eql/src/v3/scalars/bigint/bigint_ord_ore_aggregates.sql index 685bc67a9..821641457 100644 --- a/packages/eql/src/v3/scalars/bigint/bigint_ord_ore_aggregates.sql +++ b/packages/eql/src/v3/scalars/bigint/bigint_ord_ore_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/bigint/bigint_ord_ore_operators.sql --! @file encrypted_domain/bigint/bigint_ord_ore_aggregates.sql ---! @brief Aggregates for public.eql_v3_bigint_ord_ore. +--! @brief Aggregates for public.{{prefix}}_bigint_ord_ore. ---! @brief State function for min on public.eql_v3_bigint_ord_ore. ---! @param state public.eql_v3_bigint_ord_ore ---! @param value public.eql_v3_bigint_ord_ore ---! @return public.eql_v3_bigint_ord_ore -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_bigint_ord_ore, value public.eql_v3_bigint_ord_ore) -RETURNS public.eql_v3_bigint_ord_ore +--! @brief State function for min on public.{{prefix}}_bigint_ord_ore. +--! @param state public.{{prefix}}_bigint_ord_ore +--! @param value public.{{prefix}}_bigint_ord_ore +--! @return public.{{prefix}}_bigint_ord_ore +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_bigint_ord_ore, value public.{{prefix}}_bigint_ord_ore) +RETURNS public.{{prefix}}_bigint_ord_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_bigint_ord_ore. ---! @param input public.eql_v3_bigint_ord_ore ---! @return public.eql_v3_bigint_ord_ore -CREATE AGGREGATE eql_v3.min(public.eql_v3_bigint_ord_ore) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_bigint_ord_ore, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_bigint_ord_ore. +--! @param input public.{{prefix}}_bigint_ord_ore +--! @return public.{{prefix}}_bigint_ord_ore +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_bigint_ord_ore) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_bigint_ord_ore, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_bigint_ord_ore. ---! @param state public.eql_v3_bigint_ord_ore ---! @param value public.eql_v3_bigint_ord_ore ---! @return public.eql_v3_bigint_ord_ore -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_bigint_ord_ore, value public.eql_v3_bigint_ord_ore) -RETURNS public.eql_v3_bigint_ord_ore +--! @brief State function for max on public.{{prefix}}_bigint_ord_ore. +--! @param state public.{{prefix}}_bigint_ord_ore +--! @param value public.{{prefix}}_bigint_ord_ore +--! @return public.{{prefix}}_bigint_ord_ore +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_bigint_ord_ore, value public.{{prefix}}_bigint_ord_ore) +RETURNS public.{{prefix}}_bigint_ord_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_bigint_ord_ore. ---! @param input public.eql_v3_bigint_ord_ore ---! @return public.eql_v3_bigint_ord_ore -CREATE AGGREGATE eql_v3.max(public.eql_v3_bigint_ord_ore) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_bigint_ord_ore, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_bigint_ord_ore. +--! @param input public.{{prefix}}_bigint_ord_ore +--! @return public.{{prefix}}_bigint_ord_ore +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_bigint_ord_ore) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_bigint_ord_ore, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/bigint/bigint_ord_ore_functions.sql b/packages/eql/src/v3/scalars/bigint/bigint_ord_ore_functions.sql index 0441c8186..c2856dba4 100644 --- a/packages/eql/src/v3/scalars/bigint/bigint_ord_ore_functions.sql +++ b/packages/eql/src/v3/scalars/bigint/bigint_ord_ore_functions.sql @@ -6,562 +6,562 @@ -- REQUIRE: src/v3/sem/ore_block_256/operators.sql --! @file encrypted_domain/bigint/bigint_ord_ore_functions.sql ---! @brief Functions for public.eql_v3_bigint_ord_ore. +--! @brief Functions for public.{{prefix}}_bigint_ord_ore. ---! @brief Index extractor for public.eql_v3_bigint_ord_ore. ---! @param a public.eql_v3_bigint_ord_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a public.eql_v3_bigint_ord_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for public.{{prefix}}_bigint_ord_ore. +--! @param a public.{{prefix}}_bigint_ord_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a public.{{prefix}}_bigint_ord_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ore. ---! @param a public.eql_v3_bigint_ord_ore ---! @param b public.eql_v3_bigint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. +--! @param a public.{{prefix}}_bigint_ord_ore +--! @param b public.{{prefix}}_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_bigint_ord_ore, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ore. ---! @param a public.eql_v3_bigint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. +--! @param a public.{{prefix}}_bigint_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_bigint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b::public.eql_v3_bigint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{prefix}}_bigint_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_bigint_ord_ore +--! @param b public.{{prefix}}_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_bigint_ord_ore) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ore. ---! @param a public.eql_v3_bigint_ord_ore ---! @param b public.eql_v3_bigint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. +--! @param a public.{{prefix}}_bigint_ord_ore +--! @param b public.{{prefix}}_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_bigint_ord_ore, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ore. ---! @param a public.eql_v3_bigint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. +--! @param a public.{{prefix}}_bigint_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_bigint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b::public.eql_v3_bigint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{prefix}}_bigint_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_bigint_ord_ore +--! @param b public.{{prefix}}_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_bigint_ord_ore) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ore. ---! @param a public.eql_v3_bigint_ord_ore ---! @param b public.eql_v3_bigint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. +--! @param a public.{{prefix}}_bigint_ord_ore +--! @param b public.{{prefix}}_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_bigint_ord_ore, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ore. ---! @param a public.eql_v3_bigint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. +--! @param a public.{{prefix}}_bigint_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_bigint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_bigint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b::public.eql_v3_bigint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_bigint_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_bigint_ord_ore +--! @param b public.{{prefix}}_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_bigint_ord_ore) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ore. ---! @param a public.eql_v3_bigint_ord_ore ---! @param b public.eql_v3_bigint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. +--! @param a public.{{prefix}}_bigint_ord_ore +--! @param b public.{{prefix}}_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_bigint_ord_ore, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ore. ---! @param a public.eql_v3_bigint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. +--! @param a public.{{prefix}}_bigint_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_bigint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_bigint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b::public.eql_v3_bigint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_bigint_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_bigint_ord_ore +--! @param b public.{{prefix}}_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_bigint_ord_ore) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ore. ---! @param a public.eql_v3_bigint_ord_ore ---! @param b public.eql_v3_bigint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. +--! @param a public.{{prefix}}_bigint_ord_ore +--! @param b public.{{prefix}}_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_bigint_ord_ore, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ore. ---! @param a public.eql_v3_bigint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. +--! @param a public.{{prefix}}_bigint_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_bigint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_bigint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b::public.eql_v3_bigint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_bigint_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_bigint_ord_ore +--! @param b public.{{prefix}}_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_bigint_ord_ore) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ore. ---! @param a public.eql_v3_bigint_ord_ore ---! @param b public.eql_v3_bigint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. +--! @param a public.{{prefix}}_bigint_ord_ore +--! @param b public.{{prefix}}_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_bigint_ord_ore, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ore. ---! @param a public.eql_v3_bigint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. +--! @param a public.{{prefix}}_bigint_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_bigint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_bigint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b::public.eql_v3_bigint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_bigint_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_bigint_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_bigint_ord_ore +--! @param b public.{{prefix}}_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_bigint_ord_ore) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_bigint_ord_ore, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_bigint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_bigint_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_bigint_ord_ore, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_bigint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_bigint_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_bigint_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_bigint_ord_ore, selector text) -RETURNS public.eql_v3_bigint_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_bigint_ord_ore'; END; $$ +--! @return public.{{prefix}}_bigint_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_bigint_ord_ore, selector text) +RETURNS public.{{prefix}}_bigint_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_bigint_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_bigint_ord_ore, selector integer) -RETURNS public.eql_v3_bigint_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_bigint_ord_ore'; END; $$ +--! @return public.{{prefix}}_bigint_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_bigint_ord_ore, selector integer) +RETURNS public.{{prefix}}_bigint_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_bigint_ord_ore right operand of the blocked operator ---! @return public.eql_v3_bigint_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_bigint_ord_ore) -RETURNS public.eql_v3_bigint_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_bigint_ord_ore'; END; $$ +--! @param selector public.{{prefix}}_bigint_ord_ore right operand of the blocked operator +--! @return public.{{prefix}}_bigint_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_bigint_ord_ore) +RETURNS public.{{prefix}}_bigint_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_bigint_ord_ore, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_bigint_ord_ore, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_bigint_ord_ore, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_bigint_ord_ore, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_bigint_ord_ore right operand of the blocked operator +--! @param selector public.{{prefix}}_bigint_ord_ore right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_bigint_ord_ore) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_bigint_ord_ore, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_bigint_ord_ore, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_bigint_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_bigint_ord_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_bigint_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_bigint_ord_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_bigint_ord_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_bigint_ord_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_bigint_ord_ore, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_bigint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_bigint_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_bigint_ord_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_bigint_ord_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_bigint_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_bigint_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_bigint_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_bigint_ord_ore, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_bigint_ord_ore, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_bigint_ord_ore, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_bigint_ord_ore, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_bigint_ord_ore, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_bigint_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_bigint_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_bigint_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_bigint_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_bigint_ord_ore, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_bigint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_bigint_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_bigint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_bigint_ord_ore, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_bigint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_bigint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_bigint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_bigint_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_bigint_ord_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_bigint_ord_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_bigint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_bigint_ord_ore'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/bigint/bigint_ord_ore_operators.sql b/packages/eql/src/v3/scalars/bigint/bigint_ord_ore_operators.sql index 2f87146cc..3894c846f 100644 --- a/packages/eql/src/v3/scalars/bigint/bigint_ord_ore_operators.sql +++ b/packages/eql/src/v3/scalars/bigint/bigint_ord_ore_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/bigint/bigint_ord_ore_functions.sql --! @file encrypted_domain/bigint/bigint_ord_ore_operators.sql ---! @brief Operators for public.eql_v3_bigint_ord_ore. +--! @brief Operators for public.{{prefix}}_bigint_ord_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = public.eql_v3_bigint_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = public.eql_v3_bigint_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = public.eql_v3_bigint_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = public.eql_v3_bigint_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = public.eql_v3_bigint_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = public.eql_v3_bigint_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = public.eql_v3_bigint_ord_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ore ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = public.eql_v3_bigint_ord_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ore ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ore + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ore ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ore + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ore ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = public.eql_v3_bigint_ord_ore + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ore ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ore + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ore ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = public.eql_v3_bigint_ord_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ore ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_bigint_ord_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_bigint_ord_ore ); diff --git a/packages/eql/src/v3/scalars/bigint/bigint_types.sql b/packages/eql/src/v3/scalars/bigint/bigint_types.sql index 940c301f5..fd257d7f9 100644 --- a/packages/eql/src/v3/scalars/bigint/bigint_types.sql +++ b/packages/eql/src/v3/scalars/bigint/bigint_types.sql @@ -6,47 +6,47 @@ DO $$ BEGIN - --! @brief Encrypted domain public.eql_v3_bigint. + --! @brief Encrypted domain public.{{prefix}}_bigint. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_bigint' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_bigint' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_bigint AS jsonb + CREATE DOMAIN public.{{prefix}}_bigint AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_bigint IS 'EQL encrypted bigint (storage only)'; + COMMENT ON DOMAIN public.{{prefix}}_bigint IS 'EQL encrypted bigint (storage only)'; - --! @brief Encrypted domain public.eql_v3_bigint_eq. + --! @brief Encrypted domain public.{{prefix}}_bigint_eq. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_bigint_eq' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_bigint_eq' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_bigint_eq AS jsonb + CREATE DOMAIN public.{{prefix}}_bigint_eq AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'hm' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_bigint_eq IS 'EQL encrypted bigint (equality)'; + COMMENT ON DOMAIN public.{{prefix}}_bigint_eq IS 'EQL encrypted bigint (equality)'; - --! @brief Encrypted domain public.eql_v3_bigint_ord_ore. + --! @brief Encrypted domain public.{{prefix}}_bigint_ord_ore. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_bigint_ord_ore' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_bigint_ord_ore' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_bigint_ord_ore AS jsonb + CREATE DOMAIN public.{{prefix}}_bigint_ord_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -55,46 +55,46 @@ BEGIN AND VALUE ? 'ob' AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_bigint_ord_ore IS 'EQL encrypted bigint (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_bigint_ord_ore IS 'EQL encrypted bigint (equality, ordering)'; - --! @brief Encrypted domain public.eql_v3_bigint_ord. + --! @brief Encrypted domain public.{{prefix}}_bigint_ord. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_bigint_ord' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_bigint_ord' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_bigint_ord AS jsonb + CREATE DOMAIN public.{{prefix}}_bigint_ord AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'op' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_bigint_ord IS 'EQL encrypted bigint (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_bigint_ord IS 'EQL encrypted bigint (equality, ordering)'; - --! @brief Encrypted domain public.eql_v3_bigint_ord_ope. + --! @brief Encrypted domain public.{{prefix}}_bigint_ord_ope. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_bigint_ord_ope' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_bigint_ord_ope' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_bigint_ord_ope AS jsonb + CREATE DOMAIN public.{{prefix}}_bigint_ord_ope AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'op' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_bigint_ord_ope IS 'EQL encrypted bigint (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_bigint_ord_ope IS 'EQL encrypted bigint (equality, ordering)'; END $$; diff --git a/packages/eql/src/v3/scalars/bigint/json_entry_bigint_functions.sql b/packages/eql/src/v3/scalars/bigint/json_entry_bigint_functions.sql index 3ee50c424..da47e1897 100644 --- a/packages/eql/src/v3/scalars/bigint/json_entry_bigint_functions.sql +++ b/packages/eql/src/v3/scalars/bigint/json_entry_bigint_functions.sql @@ -7,244 +7,244 @@ -- REQUIRE: src/v3/scalars/bigint/query_bigint_ord_ope_functions.sql --! @file encrypted_domain/bigint/json_entry_bigint_functions.sql ---! @brief Functions for public.eql_v3_json_entry. +--! @brief Functions for public.{{prefix}}_json_entry. ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_bigint_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_bigint_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json_entry, b eql_v3.query_bigint_ord) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json_entry, b {{prefix}}.query_bigint_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_bigint_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_bigint_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a eql_v3.query_bigint_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_bigint_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_bigint_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json_entry, b eql_v3.query_bigint_ord) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json_entry, b {{prefix}}.query_bigint_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_bigint_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_bigint_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a eql_v3.query_bigint_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_bigint_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_json_entry, b eql_v3.query_bigint_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_bigint_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_bigint_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_bigint_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_bigint_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_json_entry, b eql_v3.query_bigint_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_bigint_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_bigint_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_bigint_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_bigint_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_json_entry, b eql_v3.query_bigint_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_bigint_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_bigint_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_bigint_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_bigint_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_json_entry, b eql_v3.query_bigint_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_bigint_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_bigint_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_bigint_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_bigint_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_bigint_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json_entry, b eql_v3.query_bigint_ord_ope) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json_entry, b {{prefix}}.query_bigint_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_bigint_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_bigint_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a eql_v3.query_bigint_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_bigint_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_bigint_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json_entry, b eql_v3.query_bigint_ord_ope) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json_entry, b {{prefix}}.query_bigint_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_bigint_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_bigint_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a eql_v3.query_bigint_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_bigint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_json_entry, b eql_v3.query_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_bigint_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_bigint_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_bigint_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_bigint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_json_entry, b eql_v3.query_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_bigint_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_bigint_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_bigint_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_bigint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_json_entry, b eql_v3.query_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_bigint_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_bigint_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_bigint_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_bigint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_json_entry, b eql_v3.query_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_bigint_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_bigint_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_bigint_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/bigint/json_entry_bigint_operators.sql b/packages/eql/src/v3/scalars/bigint/json_entry_bigint_operators.sql index cc44db7ce..3403a3c1f 100644 --- a/packages/eql/src/v3/scalars/bigint/json_entry_bigint_operators.sql +++ b/packages/eql/src/v3/scalars/bigint/json_entry_bigint_operators.sql @@ -5,140 +5,140 @@ -- REQUIRE: src/v3/scalars/bigint/json_entry_bigint_functions.sql --! @file encrypted_domain/bigint/json_entry_bigint_operators.sql ---! @brief Operators for public.eql_v3_json_entry. +--! @brief Operators for public.{{prefix}}_json_entry. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_bigint_ord + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_bigint_ord ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = eql_v3.query_bigint_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_bigint_ord + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_bigint_ord ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = eql_v3.query_bigint_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_bigint_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_bigint_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_bigint_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_bigint_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_bigint_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_bigint_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_bigint_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_bigint_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_bigint_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_bigint_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_bigint_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_bigint_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_bigint_ord_ope + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_bigint_ord_ope ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = eql_v3.query_bigint_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_bigint_ord_ope + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_bigint_ord_ope ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = eql_v3.query_bigint_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_bigint_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_bigint_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_bigint_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_bigint_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_bigint_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_bigint_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_bigint_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_bigint_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_bigint_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_bigint_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_bigint_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_bigint_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/bigint/query_bigint_eq_functions.sql b/packages/eql/src/v3/scalars/bigint/query_bigint_eq_functions.sql index 7efa82837..7983a84ae 100644 --- a/packages/eql/src/v3/scalars/bigint/query_bigint_eq_functions.sql +++ b/packages/eql/src/v3/scalars/bigint/query_bigint_eq_functions.sql @@ -4,44 +4,44 @@ -- REQUIRE: src/v3/scalars/bigint/bigint_eq_functions.sql --! @file encrypted_domain/bigint/query_bigint_eq_functions.sql ---! @brief Functions for eql_v3.query_bigint_eq. +--! @brief Functions for {{prefix}}.query_bigint_eq. ---! @brief Index extractor for eql_v3.query_bigint_eq. ---! @param a eql_v3.query_bigint_eq ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a eql_v3.query_bigint_eq) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for {{prefix}}.query_bigint_eq. +--! @param a {{prefix}}.query_bigint_eq +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a {{prefix}}.query_bigint_eq) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_eq. ---! @param a public.eql_v3_bigint_eq ---! @param b eql_v3.query_bigint_eq +--! @brief Operator wrapper for {{prefix}}.query_bigint_eq. +--! @param a public.{{prefix}}_bigint_eq +--! @param b {{prefix}}.query_bigint_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_bigint_eq, b eql_v3.query_bigint_eq) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_eq, b {{prefix}}.query_bigint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_eq. ---! @param a eql_v3.query_bigint_eq ---! @param b public.eql_v3_bigint_eq +--! @brief Operator wrapper for {{prefix}}.query_bigint_eq. +--! @param a {{prefix}}.query_bigint_eq +--! @param b public.{{prefix}}_bigint_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_bigint_eq, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_bigint_eq, b public.{{prefix}}_bigint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_eq. ---! @param a public.eql_v3_bigint_eq ---! @param b eql_v3.query_bigint_eq +--! @brief Operator wrapper for {{prefix}}.query_bigint_eq. +--! @param a public.{{prefix}}_bigint_eq +--! @param b {{prefix}}.query_bigint_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_bigint_eq, b eql_v3.query_bigint_eq) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_eq, b {{prefix}}.query_bigint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_eq. ---! @param a eql_v3.query_bigint_eq ---! @param b public.eql_v3_bigint_eq +--! @brief Operator wrapper for {{prefix}}.query_bigint_eq. +--! @param a {{prefix}}.query_bigint_eq +--! @param b public.{{prefix}}_bigint_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_bigint_eq, b public.eql_v3_bigint_eq) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_bigint_eq, b public.{{prefix}}_bigint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; diff --git a/packages/eql/src/v3/scalars/bigint/query_bigint_eq_operators.sql b/packages/eql/src/v3/scalars/bigint/query_bigint_eq_operators.sql index 76f9908ec..d726740a7 100644 --- a/packages/eql/src/v3/scalars/bigint/query_bigint_eq_operators.sql +++ b/packages/eql/src/v3/scalars/bigint/query_bigint_eq_operators.sql @@ -4,28 +4,28 @@ -- REQUIRE: src/v3/scalars/bigint/query_bigint_eq_functions.sql --! @file encrypted_domain/bigint/query_bigint_eq_operators.sql ---! @brief Operators for eql_v3.query_bigint_eq. +--! @brief Operators for {{prefix}}.query_bigint_eq. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = eql_v3.query_bigint_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = {{prefix}}.query_bigint_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_bigint_eq, RIGHTARG = public.eql_v3_bigint_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_bigint_eq, RIGHTARG = public.{{prefix}}_bigint_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_bigint_eq, RIGHTARG = eql_v3.query_bigint_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = {{prefix}}.query_bigint_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_bigint_eq, RIGHTARG = public.eql_v3_bigint_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_bigint_eq, RIGHTARG = public.{{prefix}}_bigint_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); diff --git a/packages/eql/src/v3/scalars/bigint/query_bigint_ord_functions.sql b/packages/eql/src/v3/scalars/bigint/query_bigint_ord_functions.sql index 4fbd3e16b..c85509ab2 100644 --- a/packages/eql/src/v3/scalars/bigint/query_bigint_ord_functions.sql +++ b/packages/eql/src/v3/scalars/bigint/query_bigint_ord_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/bigint/bigint_ord_functions.sql --! @file encrypted_domain/bigint/query_bigint_ord_functions.sql ---! @brief Functions for eql_v3.query_bigint_ord. +--! @brief Functions for {{prefix}}.query_bigint_ord. ---! @brief Index extractor for eql_v3.query_bigint_ord. ---! @param a eql_v3.query_bigint_ord ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a eql_v3.query_bigint_ord) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for {{prefix}}.query_bigint_ord. +--! @param a {{prefix}}.query_bigint_ord +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a {{prefix}}.query_bigint_ord) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord. ---! @param a public.eql_v3_bigint_ord ---! @param b eql_v3.query_bigint_ord +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord. +--! @param a public.{{prefix}}_bigint_ord +--! @param b {{prefix}}.query_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_bigint_ord, b eql_v3.query_bigint_ord) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord. ---! @param a eql_v3.query_bigint_ord ---! @param b public.eql_v3_bigint_ord +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord. +--! @param a {{prefix}}.query_bigint_ord +--! @param b public.{{prefix}}_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_bigint_ord, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord. ---! @param a public.eql_v3_bigint_ord ---! @param b eql_v3.query_bigint_ord +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord. +--! @param a public.{{prefix}}_bigint_ord +--! @param b {{prefix}}.query_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_bigint_ord, b eql_v3.query_bigint_ord) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord. ---! @param a eql_v3.query_bigint_ord ---! @param b public.eql_v3_bigint_ord +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord. +--! @param a {{prefix}}.query_bigint_ord +--! @param b public.{{prefix}}_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_bigint_ord, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord. ---! @param a public.eql_v3_bigint_ord ---! @param b eql_v3.query_bigint_ord +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord. +--! @param a public.{{prefix}}_bigint_ord +--! @param b {{prefix}}.query_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_bigint_ord, b eql_v3.query_bigint_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord. ---! @param a eql_v3.query_bigint_ord ---! @param b public.eql_v3_bigint_ord +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord. +--! @param a {{prefix}}.query_bigint_ord +--! @param b public.{{prefix}}_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_bigint_ord, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord. ---! @param a public.eql_v3_bigint_ord ---! @param b eql_v3.query_bigint_ord +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord. +--! @param a public.{{prefix}}_bigint_ord +--! @param b {{prefix}}.query_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_bigint_ord, b eql_v3.query_bigint_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord. ---! @param a eql_v3.query_bigint_ord ---! @param b public.eql_v3_bigint_ord +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord. +--! @param a {{prefix}}.query_bigint_ord +--! @param b public.{{prefix}}_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_bigint_ord, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord. ---! @param a public.eql_v3_bigint_ord ---! @param b eql_v3.query_bigint_ord +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord. +--! @param a public.{{prefix}}_bigint_ord +--! @param b {{prefix}}.query_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_bigint_ord, b eql_v3.query_bigint_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord. ---! @param a eql_v3.query_bigint_ord ---! @param b public.eql_v3_bigint_ord +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord. +--! @param a {{prefix}}.query_bigint_ord +--! @param b public.{{prefix}}_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_bigint_ord, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord. ---! @param a public.eql_v3_bigint_ord ---! @param b eql_v3.query_bigint_ord +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord. +--! @param a public.{{prefix}}_bigint_ord +--! @param b {{prefix}}.query_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_bigint_ord, b eql_v3.query_bigint_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord. ---! @param a eql_v3.query_bigint_ord ---! @param b public.eql_v3_bigint_ord +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord. +--! @param a {{prefix}}.query_bigint_ord +--! @param b public.{{prefix}}_bigint_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_bigint_ord, b public.eql_v3_bigint_ord) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/bigint/query_bigint_ord_ope_functions.sql b/packages/eql/src/v3/scalars/bigint/query_bigint_ord_ope_functions.sql index c28bec13a..6315451b9 100644 --- a/packages/eql/src/v3/scalars/bigint/query_bigint_ord_ope_functions.sql +++ b/packages/eql/src/v3/scalars/bigint/query_bigint_ord_ope_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/bigint/bigint_ord_ope_functions.sql --! @file encrypted_domain/bigint/query_bigint_ord_ope_functions.sql ---! @brief Functions for eql_v3.query_bigint_ord_ope. +--! @brief Functions for {{prefix}}.query_bigint_ord_ope. ---! @brief Index extractor for eql_v3.query_bigint_ord_ope. ---! @param a eql_v3.query_bigint_ord_ope ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a eql_v3.query_bigint_ord_ope) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for {{prefix}}.query_bigint_ord_ope. +--! @param a {{prefix}}.query_bigint_ord_ope +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a {{prefix}}.query_bigint_ord_ope) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ope. ---! @param a public.eql_v3_bigint_ord_ope ---! @param b eql_v3.query_bigint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. +--! @param a public.{{prefix}}_bigint_ord_ope +--! @param b {{prefix}}.query_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_bigint_ord_ope, b eql_v3.query_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ope. ---! @param a eql_v3.query_bigint_ord_ope ---! @param b public.eql_v3_bigint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. +--! @param a {{prefix}}.query_bigint_ord_ope +--! @param b public.{{prefix}}_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_bigint_ord_ope, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ope. ---! @param a public.eql_v3_bigint_ord_ope ---! @param b eql_v3.query_bigint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. +--! @param a public.{{prefix}}_bigint_ord_ope +--! @param b {{prefix}}.query_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_bigint_ord_ope, b eql_v3.query_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ope. ---! @param a eql_v3.query_bigint_ord_ope ---! @param b public.eql_v3_bigint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. +--! @param a {{prefix}}.query_bigint_ord_ope +--! @param b public.{{prefix}}_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_bigint_ord_ope, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ope. ---! @param a public.eql_v3_bigint_ord_ope ---! @param b eql_v3.query_bigint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. +--! @param a public.{{prefix}}_bigint_ord_ope +--! @param b {{prefix}}.query_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_bigint_ord_ope, b eql_v3.query_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ope. ---! @param a eql_v3.query_bigint_ord_ope ---! @param b public.eql_v3_bigint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. +--! @param a {{prefix}}.query_bigint_ord_ope +--! @param b public.{{prefix}}_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_bigint_ord_ope, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ope. ---! @param a public.eql_v3_bigint_ord_ope ---! @param b eql_v3.query_bigint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. +--! @param a public.{{prefix}}_bigint_ord_ope +--! @param b {{prefix}}.query_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_bigint_ord_ope, b eql_v3.query_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ope. ---! @param a eql_v3.query_bigint_ord_ope ---! @param b public.eql_v3_bigint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. +--! @param a {{prefix}}.query_bigint_ord_ope +--! @param b public.{{prefix}}_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_bigint_ord_ope, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ope. ---! @param a public.eql_v3_bigint_ord_ope ---! @param b eql_v3.query_bigint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. +--! @param a public.{{prefix}}_bigint_ord_ope +--! @param b {{prefix}}.query_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_bigint_ord_ope, b eql_v3.query_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ope. ---! @param a eql_v3.query_bigint_ord_ope ---! @param b public.eql_v3_bigint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. +--! @param a {{prefix}}.query_bigint_ord_ope +--! @param b public.{{prefix}}_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_bigint_ord_ope, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ope. ---! @param a public.eql_v3_bigint_ord_ope ---! @param b eql_v3.query_bigint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. +--! @param a public.{{prefix}}_bigint_ord_ope +--! @param b {{prefix}}.query_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_bigint_ord_ope, b eql_v3.query_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ope. ---! @param a eql_v3.query_bigint_ord_ope ---! @param b public.eql_v3_bigint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. +--! @param a {{prefix}}.query_bigint_ord_ope +--! @param b public.{{prefix}}_bigint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_bigint_ord_ope, b public.eql_v3_bigint_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/bigint/query_bigint_ord_ope_operators.sql b/packages/eql/src/v3/scalars/bigint/query_bigint_ord_ope_operators.sql index 7e58ae385..2f01b668a 100644 --- a/packages/eql/src/v3/scalars/bigint/query_bigint_ord_ope_operators.sql +++ b/packages/eql/src/v3/scalars/bigint/query_bigint_ord_ope_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/bigint/query_bigint_ord_ope_functions.sql --! @file encrypted_domain/bigint/query_bigint_ord_ope_operators.sql ---! @brief Operators for eql_v3.query_bigint_ord_ope. +--! @brief Operators for {{prefix}}.query_bigint_ord_ope. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = eql_v3.query_bigint_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_bigint_ord_ope, RIGHTARG = public.eql_v3_bigint_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = eql_v3.query_bigint_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_bigint_ord_ope, RIGHTARG = public.eql_v3_bigint_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = eql_v3.query_bigint_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_bigint_ord_ope, RIGHTARG = public.eql_v3_bigint_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = eql_v3.query_bigint_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_bigint_ord_ope, RIGHTARG = public.eql_v3_bigint_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = eql_v3.query_bigint_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_bigint_ord_ope, RIGHTARG = public.eql_v3_bigint_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_bigint_ord_ope, RIGHTARG = eql_v3.query_bigint_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_bigint_ord_ope, RIGHTARG = public.eql_v3_bigint_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/bigint/query_bigint_ord_operators.sql b/packages/eql/src/v3/scalars/bigint/query_bigint_ord_operators.sql index 9bbb5f8d0..42274269f 100644 --- a/packages/eql/src/v3/scalars/bigint/query_bigint_ord_operators.sql +++ b/packages/eql/src/v3/scalars/bigint/query_bigint_ord_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/bigint/query_bigint_ord_functions.sql --! @file encrypted_domain/bigint/query_bigint_ord_operators.sql ---! @brief Operators for eql_v3.query_bigint_ord. +--! @brief Operators for {{prefix}}.query_bigint_ord. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = eql_v3.query_bigint_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_bigint_ord, RIGHTARG = public.eql_v3_bigint_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = eql_v3.query_bigint_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_bigint_ord, RIGHTARG = public.eql_v3_bigint_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = eql_v3.query_bigint_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_bigint_ord, RIGHTARG = public.eql_v3_bigint_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = eql_v3.query_bigint_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_bigint_ord, RIGHTARG = public.eql_v3_bigint_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = eql_v3.query_bigint_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_bigint_ord, RIGHTARG = public.eql_v3_bigint_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_bigint_ord, RIGHTARG = eql_v3.query_bigint_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_bigint_ord, RIGHTARG = public.eql_v3_bigint_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/bigint/query_bigint_ord_ore_functions.sql b/packages/eql/src/v3/scalars/bigint/query_bigint_ord_ore_functions.sql index 9b90cc642..c1dec7671 100644 --- a/packages/eql/src/v3/scalars/bigint/query_bigint_ord_ore_functions.sql +++ b/packages/eql/src/v3/scalars/bigint/query_bigint_ord_ore_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/bigint/bigint_ord_ore_functions.sql --! @file encrypted_domain/bigint/query_bigint_ord_ore_functions.sql ---! @brief Functions for eql_v3.query_bigint_ord_ore. +--! @brief Functions for {{prefix}}.query_bigint_ord_ore. ---! @brief Index extractor for eql_v3.query_bigint_ord_ore. ---! @param a eql_v3.query_bigint_ord_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a eql_v3.query_bigint_ord_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for {{prefix}}.query_bigint_ord_ore. +--! @param a {{prefix}}.query_bigint_ord_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a {{prefix}}.query_bigint_ord_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ore. ---! @param a public.eql_v3_bigint_ord_ore ---! @param b eql_v3.query_bigint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. +--! @param a public.{{prefix}}_bigint_ord_ore +--! @param b {{prefix}}.query_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_bigint_ord_ore, b eql_v3.query_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ore. ---! @param a eql_v3.query_bigint_ord_ore ---! @param b public.eql_v3_bigint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. +--! @param a {{prefix}}.query_bigint_ord_ore +--! @param b public.{{prefix}}_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_bigint_ord_ore, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ore. ---! @param a public.eql_v3_bigint_ord_ore ---! @param b eql_v3.query_bigint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. +--! @param a public.{{prefix}}_bigint_ord_ore +--! @param b {{prefix}}.query_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_bigint_ord_ore, b eql_v3.query_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ore. ---! @param a eql_v3.query_bigint_ord_ore ---! @param b public.eql_v3_bigint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. +--! @param a {{prefix}}.query_bigint_ord_ore +--! @param b public.{{prefix}}_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_bigint_ord_ore, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ore. ---! @param a public.eql_v3_bigint_ord_ore ---! @param b eql_v3.query_bigint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. +--! @param a public.{{prefix}}_bigint_ord_ore +--! @param b {{prefix}}.query_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_bigint_ord_ore, b eql_v3.query_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ore. ---! @param a eql_v3.query_bigint_ord_ore ---! @param b public.eql_v3_bigint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. +--! @param a {{prefix}}.query_bigint_ord_ore +--! @param b public.{{prefix}}_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_bigint_ord_ore, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ore. ---! @param a public.eql_v3_bigint_ord_ore ---! @param b eql_v3.query_bigint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. +--! @param a public.{{prefix}}_bigint_ord_ore +--! @param b {{prefix}}.query_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_bigint_ord_ore, b eql_v3.query_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ore. ---! @param a eql_v3.query_bigint_ord_ore ---! @param b public.eql_v3_bigint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. +--! @param a {{prefix}}.query_bigint_ord_ore +--! @param b public.{{prefix}}_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_bigint_ord_ore, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ore. ---! @param a public.eql_v3_bigint_ord_ore ---! @param b eql_v3.query_bigint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. +--! @param a public.{{prefix}}_bigint_ord_ore +--! @param b {{prefix}}.query_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_bigint_ord_ore, b eql_v3.query_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ore. ---! @param a eql_v3.query_bigint_ord_ore ---! @param b public.eql_v3_bigint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. +--! @param a {{prefix}}.query_bigint_ord_ore +--! @param b public.{{prefix}}_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_bigint_ord_ore, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ore. ---! @param a public.eql_v3_bigint_ord_ore ---! @param b eql_v3.query_bigint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. +--! @param a public.{{prefix}}_bigint_ord_ore +--! @param b {{prefix}}.query_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_bigint_ord_ore, b eql_v3.query_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_bigint_ord_ore. ---! @param a eql_v3.query_bigint_ord_ore ---! @param b public.eql_v3_bigint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. +--! @param a {{prefix}}.query_bigint_ord_ore +--! @param b public.{{prefix}}_bigint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_bigint_ord_ore, b public.eql_v3_bigint_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; diff --git a/packages/eql/src/v3/scalars/bigint/query_bigint_ord_ore_operators.sql b/packages/eql/src/v3/scalars/bigint/query_bigint_ord_ore_operators.sql index d672cfe57..a86c28310 100644 --- a/packages/eql/src/v3/scalars/bigint/query_bigint_ord_ore_operators.sql +++ b/packages/eql/src/v3/scalars/bigint/query_bigint_ord_ore_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/bigint/query_bigint_ord_ore_functions.sql --! @file encrypted_domain/bigint/query_bigint_ord_ore_operators.sql ---! @brief Operators for eql_v3.query_bigint_ord_ore. +--! @brief Operators for {{prefix}}.query_bigint_ord_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = eql_v3.query_bigint_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_bigint_ord_ore, RIGHTARG = public.eql_v3_bigint_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = eql_v3.query_bigint_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_bigint_ord_ore, RIGHTARG = public.eql_v3_bigint_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = eql_v3.query_bigint_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_bigint_ord_ore, RIGHTARG = public.eql_v3_bigint_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = eql_v3.query_bigint_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_bigint_ord_ore, RIGHTARG = public.eql_v3_bigint_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = eql_v3.query_bigint_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_bigint_ord_ore, RIGHTARG = public.eql_v3_bigint_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_bigint_ord_ore, RIGHTARG = eql_v3.query_bigint_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_bigint_ord_ore, RIGHTARG = public.eql_v3_bigint_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/bigint/query_bigint_range_functions.sql b/packages/eql/src/v3/scalars/bigint/query_bigint_range_functions.sql new file mode 100644 index 000000000..0d9edb9c8 --- /dev/null +++ b/packages/eql/src/v3/scalars/bigint/query_bigint_range_functions.sql @@ -0,0 +1,177 @@ +-- AUTOMATICALLY GENERATED FILE. +-- ONLY EQL VERSION: 4 +-- REQUIRE: src/v3/schema.sql +-- REQUIRE: src/v3/scalars/bigint/query_bigint_range_types.sql +-- REQUIRE: src/v3/scalars/bigint/bigint_ord_ore_functions.sql +-- REQUIRE: src/v3/scalars/bigint/bigint_ord_functions.sql +-- REQUIRE: src/v3/scalars/bigint/bigint_ord_ope_functions.sql +-- REQUIRE: src/v3/sem/ore_block_256/functions.sql +-- REQUIRE: src/v3/sem/ore_block_256/operators.sql +-- REQUIRE: src/v3/sem/ope_cllw/functions.sql + +--! @file v3/scalars/bigint/query_bigint_range_functions.sql +--! @brief The bound accessors and `{{prefix}}.between` for bigint's range query domains. +--! @note EQL version {{eql_version}} only, like the range domains themselves. + +--! @brief The low bound of a {{prefix}}.query_bigint_range_ore, as a block ORE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_bigint_range_ore Range query operand +--! @return {{prefix}}_internal.ore_block_256 The low bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.lo(r {{prefix}}.query_bigint_range_ore) +RETURNS {{prefix}}_internal.ore_block_256 +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ore_block_256(jsonb_build_object('ob', r::jsonb -> 'lo')) $$; + +--! @brief The high bound of a {{prefix}}.query_bigint_range_ore, as a block ORE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_bigint_range_ore Range query operand +--! @return {{prefix}}_internal.ore_block_256 The high bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.hi(r {{prefix}}.query_bigint_range_ore) +RETURNS {{prefix}}_internal.ore_block_256 +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ore_block_256(jsonb_build_object('ob', r::jsonb -> 'hi')) $$; + +--! @brief The low bound of a {{prefix}}.query_bigint_range_ope, as a CLLW OPE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_bigint_range_ope Range query operand +--! @return {{prefix}}_internal.ope_cllw The low bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.lo(r {{prefix}}.query_bigint_range_ope) +RETURNS {{prefix}}_internal.ope_cllw +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> 'lo')) $$; + +--! @brief The high bound of a {{prefix}}.query_bigint_range_ope, as a CLLW OPE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_bigint_range_ope Range query operand +--! @return {{prefix}}_internal.ope_cllw The high bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.hi(r {{prefix}}.query_bigint_range_ope) +RETURNS {{prefix}}_internal.ope_cllw +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> 'hi')) $$; + +--! @brief Whether a public.{{prefix}}_bigint_ord_ore value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_bigint_range_ore)`. +--! +--! @param a public.{{prefix}}_bigint_ord_ore Encrypted column value +--! @param r {{prefix}}.query_bigint_range_ore Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term_ore(a)`, which a btree index on that expression +--! serves as one range scan. For this ORE range that index needs the +--! default btree operator class on {{prefix}}_internal.ore_block_256, which the +--! installer creates only with superuser privileges. Without it (on Supabase, +--! for instance) the installer disables the ORE column domains and this ORE range, +--! so use an OPE column (`public.{{prefix}}_bigint_ord`, `public.{{prefix}}_bigint_ord_ope`) +--! and `{{prefix}}.query_bigint_range_ope`, which index everywhere. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_bigint_range_ore`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_bigint_ord_ore, r {{prefix}}.query_bigint_range_ore) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_bigint_ord value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_bigint_range_ope)`. +--! +--! @param a public.{{prefix}}_bigint_ord Encrypted column value +--! @param r {{prefix}}.query_bigint_range_ope Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term(a)`, which a btree index on that expression +--! serves as one range scan. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_bigint_range_ope`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_bigint_ord, r {{prefix}}.query_bigint_range_ope) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_bigint_ord_ope value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_bigint_range_ope)`. +--! +--! @param a public.{{prefix}}_bigint_ord_ope Encrypted column value +--! @param r {{prefix}}.query_bigint_range_ope Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term(a)`, which a btree index on that expression +--! serves as one range scan. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_bigint_range_ope`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_bigint_ord_ope, r {{prefix}}.query_bigint_range_ope) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r) $$; diff --git a/packages/eql/src/v3/scalars/bigint/query_bigint_range_types.sql b/packages/eql/src/v3/scalars/bigint/query_bigint_range_types.sql new file mode 100644 index 000000000..37c422c54 --- /dev/null +++ b/packages/eql/src/v3/scalars/bigint/query_bigint_range_types.sql @@ -0,0 +1,107 @@ +-- AUTOMATICALLY GENERATED FILE. +-- ONLY EQL VERSION: 4 +-- REQUIRE: src/v3/schema.sql +-- REQUIRE: src/v3/scalars/ore_fallback.sql + +--! @file v3/scalars/bigint/query_bigint_range_types.sql +--! @brief Range query-operand domains for bigint: the operand of `{{prefix}}.between`. +--! @note A range holds both bounds of one `BETWEEN` as one value: +--! `{"v": {{eql_version}}, "i": {...}, "lo": , "hi": }`. Each bound is the +--! single-bound query domain's `ob` (ORE) or `op` (OPE) value, in a +--! `{v, i, lo, hi}` envelope. Both bounds are included. There is one +--! range domain per ordering term the family stores (ADR-0009, +--! decisions 7 and 8). +--! @note Cast the range parameter to its exact range domain +--! (`$1::{{prefix}}.query_bigint_range_ore`). An uncast `$1`, a `jsonb` +--! parameter, or a range of another term or family fails with 42725 +--! ("function ... is not unique"); see `{{prefix}}.between`. +--! @note EQL version {{eql_version}} only: the `-- ONLY EQL VERSION:` line above keeps this +--! file out of every other version's installer. +--! @note Like every query operand, a range lives in `{{prefix}}`, not `public`, +--! and holds no ciphertext `c`. A range whose low bound is above its +--! high bound matches no row, as with SQL `BETWEEN`; the SQL does not +--! reorder the bounds. +--! @note On an install without the ORE operator class (a non-superuser +--! install, on Supabase for instance), the ORE range domain is disabled +--! as the single-bound ORE domains are: a value cast to it raises +--! `feature_not_supported`, naming the OPE range. See +--! `v3/scalars/ore_fallback.sql`. + +DO $$ +BEGIN + --! @brief Range query-operand domain {{prefix}}.query_bigint_range_ore (two block ORE bounds; no `c`). + IF NOT EXISTS ( + SELECT 1 FROM pg_type + WHERE typname = 'query_bigint_range_ore' AND typnamespace = '{{prefix}}'::regnamespace + ) THEN + CREATE DOMAIN {{prefix}}.query_bigint_range_ore AS jsonb + CHECK ( + jsonb_typeof(VALUE) = 'object' + AND VALUE ? 'v' + AND VALUE ? 'i' + AND VALUE ? 'lo' + AND VALUE ? 'hi' + AND NOT (VALUE ? 'c') + AND jsonb_typeof(VALUE -> 'lo') = 'array' + AND jsonb_array_length(VALUE -> 'lo') > 0 + AND jsonb_typeof(VALUE -> 'hi') = 'array' + AND jsonb_array_length(VALUE -> 'hi') > 0 + -- `"v": null` makes the comparison NULL, and a CHECK that is NULL + -- passes, so COALESCE refuses it. A NULL range still passes (no row + -- matches it). The comparison keeps the one form the v4 isolation + -- gate accepts. + AND COALESCE(VALUE->>'v' = '{{eql_version}}', VALUE IS NULL) + ); + END IF; + + COMMENT ON DOMAIN {{prefix}}.query_bigint_range_ore IS 'EQL bigint range query operand (block ORE)'; + + --! @brief Range query-operand domain {{prefix}}.query_bigint_range_ope (two CLLW OPE bounds; no `c`). + IF NOT EXISTS ( + SELECT 1 FROM pg_type + WHERE typname = 'query_bigint_range_ope' AND typnamespace = '{{prefix}}'::regnamespace + ) THEN + CREATE DOMAIN {{prefix}}.query_bigint_range_ope AS jsonb + CHECK ( + jsonb_typeof(VALUE) = 'object' + AND VALUE ? 'v' + AND VALUE ? 'i' + AND VALUE ? 'lo' + AND VALUE ? 'hi' + AND NOT (VALUE ? 'c') + AND jsonb_typeof(VALUE -> 'lo') = 'string' + AND jsonb_typeof(VALUE -> 'hi') = 'string' + -- `"v": null` makes the comparison NULL, and a CHECK that is NULL + -- passes, so COALESCE refuses it. A NULL range still passes (no row + -- matches it). The comparison keeps the one form the v4 isolation + -- gate accepts. + AND COALESCE(VALUE->>'v' = '{{eql_version}}', VALUE IS NULL) + ); + END IF; + + COMMENT ON DOMAIN {{prefix}}.query_bigint_range_ope IS 'EQL bigint range query operand (CLLW OPE)'; +END +$$; + +-- Without the default btree operator class on {{prefix}}_internal.ore_block_256 +-- (the installer skips it on insufficient_privilege), ore_fallback.sql has +-- created {{prefix}}_internal.ore_domain_unavailable and poisoned the +-- single-bound ORE domains. It cannot reach this ORE range, which exists in +-- EQL v4 only, so the same NOT VALID poison CHECK is added here. +DO $do$ +BEGIN + IF EXISTS ( + SELECT 1 + FROM pg_catalog.pg_opclass c + JOIN pg_catalog.pg_am am ON am.oid = c.opcmethod + WHERE am.amname = 'btree' + AND c.opcdefault + AND c.opcintype = '{{prefix}}_internal.ore_block_256'::pg_catalog.regtype + ) THEN + RETURN; + END IF; + + ALTER DOMAIN {{prefix}}.query_bigint_range_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, '{{prefix}}.query_bigint_range_ore', '{{prefix}}.query_bigint_range_ope (range)')) NOT VALID; +END; +$do$; diff --git a/packages/eql/src/v3/scalars/bigint/query_bigint_types.sql b/packages/eql/src/v3/scalars/bigint/query_bigint_types.sql index fbffb8c40..d1d4e14ed 100644 --- a/packages/eql/src/v3/scalars/bigint/query_bigint_types.sql +++ b/packages/eql/src/v3/scalars/bigint/query_bigint_types.sql @@ -3,41 +3,41 @@ --! @file v3/scalars/bigint/query_bigint_types.sql --! @brief Query-operand domains for bigint (index-terms-only, no ciphertext). ---! @note Query-operand domains live in `eql_v3` (not `public`): they are +--! @note Query-operand domains live in `{{prefix}}` (not `public`): they are --! never valid column types, so they don't belong in the column-type --! namespace, and dropping the EQL-owned schema can never drop an --! application column. --! @note Cast a query operand explicitly to its `query_` domain in a predicate ---! (e.g. `WHERE col = $1::eql_v3.query_bigint_eq`). A bare, +--! (e.g. `WHERE col = $1::{{prefix}}.query_bigint_eq`). A bare, --! uncast literal RHS is ambiguous between the `query_` and `jsonb` --! operator overloads and will not resolve. DO $$ BEGIN - --! @brief Query-operand domain eql_v3.query_bigint_eq (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_bigint_eq (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_bigint_eq' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_bigint_eq' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_bigint_eq AS jsonb + CREATE DOMAIN {{prefix}}.query_bigint_eq AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'hm' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_bigint_eq IS 'EQL bigint query operand (equality)'; + COMMENT ON DOMAIN {{prefix}}.query_bigint_eq IS 'EQL bigint query operand (equality)'; - --! @brief Query-operand domain eql_v3.query_bigint_ord_ore (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_bigint_ord_ore (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_bigint_ord_ore' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_bigint_ord_ore' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_bigint_ord_ore AS jsonb + CREATE DOMAIN {{prefix}}.query_bigint_ord_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -46,46 +46,46 @@ BEGIN AND NOT (VALUE ? 'c') AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_bigint_ord_ore IS 'EQL bigint query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_bigint_ord_ore IS 'EQL bigint query operand (equality, ordering)'; - --! @brief Query-operand domain eql_v3.query_bigint_ord (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_bigint_ord (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_bigint_ord' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_bigint_ord' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_bigint_ord AS jsonb + CREATE DOMAIN {{prefix}}.query_bigint_ord AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'op' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_bigint_ord IS 'EQL bigint query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_bigint_ord IS 'EQL bigint query operand (equality, ordering)'; - --! @brief Query-operand domain eql_v3.query_bigint_ord_ope (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_bigint_ord_ope (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_bigint_ord_ope' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_bigint_ord_ope' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_bigint_ord_ope AS jsonb + CREATE DOMAIN {{prefix}}.query_bigint_ord_ope AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'op' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_bigint_ord_ope IS 'EQL bigint query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_bigint_ord_ope IS 'EQL bigint query operand (equality, ordering)'; END $$; diff --git a/packages/eql/src/v3/scalars/boolean/boolean_functions.sql b/packages/eql/src/v3/scalars/boolean/boolean_functions.sql index c34730227..e3414420f 100644 --- a/packages/eql/src/v3/scalars/boolean/boolean_functions.sql +++ b/packages/eql/src/v3/scalars/boolean/boolean_functions.sql @@ -4,662 +4,662 @@ -- REQUIRE: src/v3/scalars/functions.sql --! @file encrypted_domain/boolean/boolean_functions.sql ---! @brief Functions for public.eql_v3_boolean. +--! @brief Functions for public.{{prefix}}_boolean. ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_boolean, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_boolean, b public.{{prefix}}_boolean) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_boolean, b jsonb) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_boolean, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a jsonb, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal.eq(a jsonb, b public.{{prefix}}_boolean) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_boolean, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_boolean, b public.{{prefix}}_boolean) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_boolean, b jsonb) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_boolean, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a jsonb, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal.neq(a jsonb, b public.{{prefix}}_boolean) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_boolean, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_boolean, b public.{{prefix}}_boolean) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_boolean, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_boolean, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_boolean) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_boolean, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_boolean, b public.{{prefix}}_boolean) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_boolean, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_boolean, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_boolean) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_boolean, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_boolean, b public.{{prefix}}_boolean) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_boolean, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_boolean, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_boolean) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_boolean, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_boolean, b public.{{prefix}}_boolean) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_boolean, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_boolean, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_boolean) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_boolean, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_boolean, b public.{{prefix}}_boolean) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_boolean, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_boolean, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_boolean) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_boolean, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_boolean, b public.{{prefix}}_boolean) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_boolean, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_boolean, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_boolean) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_boolean, selector text) -RETURNS public.eql_v3_boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_boolean'; END; $$ +--! @return public.{{prefix}}_boolean never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_boolean, selector text) +RETURNS public.{{prefix}}_boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_boolean, selector integer) -RETURNS public.eql_v3_boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_boolean'; END; $$ +--! @return public.{{prefix}}_boolean never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_boolean, selector integer) +RETURNS public.{{prefix}}_boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_boolean right operand of the blocked operator ---! @return public.eql_v3_boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_boolean) -RETURNS public.eql_v3_boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_boolean'; END; $$ +--! @param selector public.{{prefix}}_boolean right operand of the blocked operator +--! @return public.{{prefix}}_boolean never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_boolean) +RETURNS public.{{prefix}}_boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_boolean, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_boolean, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_boolean, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_boolean, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_boolean right operand of the blocked operator +--! @param selector public.{{prefix}}_boolean right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_boolean) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_boolean, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_boolean, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_boolean, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_boolean, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_boolean, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_boolean, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_boolean, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_boolean, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_boolean, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_boolean, b public.{{prefix}}_boolean) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_boolean, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_boolean, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_boolean) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_boolean, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_boolean, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_boolean, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_boolean, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_boolean, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_boolean, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_boolean, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_boolean, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_boolean, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_boolean, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_boolean, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_boolean, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_boolean, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_boolean, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_boolean, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_boolean, b public.{{prefix}}_boolean) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_boolean left operand of the blocked operator +--! @param a public.{{prefix}}_boolean left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_boolean, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_boolean, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_boolean. +--! @brief Unsupported operator blocker for public.{{prefix}}_boolean. --! ---! Intercepts an operator that is not supported on public.eql_v3_boolean and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_boolean and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_boolean right operand of the blocked operator +--! @param b public.{{prefix}}_boolean right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_boolean) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_boolean) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_boolean'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_boolean'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/boolean/boolean_operators.sql b/packages/eql/src/v3/scalars/boolean/boolean_operators.sql index 004793512..d7a3d00e4 100644 --- a/packages/eql/src/v3/scalars/boolean/boolean_operators.sql +++ b/packages/eql/src/v3/scalars/boolean/boolean_operators.sql @@ -4,239 +4,239 @@ -- REQUIRE: src/v3/scalars/boolean/boolean_functions.sql --! @file encrypted_domain/boolean/boolean_operators.sql ---! @brief Operators for public.eql_v3_boolean. +--! @brief Operators for public.{{prefix}}_boolean. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_boolean, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_boolean, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = jsonb ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_boolean, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_boolean, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = jsonb ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_boolean, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_boolean, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_boolean, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_boolean, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_boolean, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_boolean, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_boolean, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_boolean, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_boolean, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_boolean, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_boolean, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_boolean, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_boolean, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_boolean, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_boolean, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_boolean, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_boolean, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_boolean, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_boolean, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_boolean, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_boolean, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_boolean, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_boolean, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_boolean, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_boolean, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_boolean, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_boolean, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_boolean, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_boolean, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_boolean, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = public.{{prefix}}_boolean ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_boolean, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_boolean, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_boolean + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_boolean ); diff --git a/packages/eql/src/v3/scalars/boolean/boolean_types.sql b/packages/eql/src/v3/scalars/boolean/boolean_types.sql index 755c68df4..217adc946 100644 --- a/packages/eql/src/v3/scalars/boolean/boolean_types.sql +++ b/packages/eql/src/v3/scalars/boolean/boolean_types.sql @@ -6,21 +6,21 @@ DO $$ BEGIN - --! @brief Encrypted domain public.eql_v3_boolean. + --! @brief Encrypted domain public.{{prefix}}_boolean. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_boolean' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_boolean' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_boolean AS jsonb + CREATE DOMAIN public.{{prefix}}_boolean AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_boolean IS 'EQL encrypted boolean (storage only)'; + COMMENT ON DOMAIN public.{{prefix}}_boolean IS 'EQL encrypted boolean (storage only)'; END $$; diff --git a/packages/eql/src/v3/scalars/date/date_eq_functions.sql b/packages/eql/src/v3/scalars/date/date_eq_functions.sql index c72d2b9d1..ca4cd6750 100644 --- a/packages/eql/src/v3/scalars/date/date_eq_functions.sql +++ b/packages/eql/src/v3/scalars/date/date_eq_functions.sql @@ -5,634 +5,634 @@ -- REQUIRE: src/v3/sem/hmac_256/functions.sql --! @file encrypted_domain/date/date_eq_functions.sql ---! @brief Functions for public.eql_v3_date_eq. +--! @brief Functions for public.{{prefix}}_date_eq. ---! @brief Index extractor for public.eql_v3_date_eq. ---! @param a public.eql_v3_date_eq ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a public.eql_v3_date_eq) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for public.{{prefix}}_date_eq. +--! @param a public.{{prefix}}_date_eq +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a public.{{prefix}}_date_eq) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_date_eq. ---! @param a public.eql_v3_date_eq ---! @param b public.eql_v3_date_eq +--! @brief Operator wrapper for public.{{prefix}}_date_eq. +--! @param a public.{{prefix}}_date_eq +--! @param b public.{{prefix}}_date_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_date_eq, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_eq, b public.{{prefix}}_date_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_eq. ---! @param a public.eql_v3_date_eq +--! @brief Operator wrapper for public.{{prefix}}_date_eq. +--! @param a public.{{prefix}}_date_eq --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_date_eq, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b::public.eql_v3_date_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_date_eq) $$; ---! @brief Operator wrapper for public.eql_v3_date_eq. +--! @brief Operator wrapper for public.{{prefix}}_date_eq. --! @param a jsonb ---! @param b public.eql_v3_date_eq +--! @param b public.{{prefix}}_date_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_date_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_date_eq) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_date_eq) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_eq. ---! @param a public.eql_v3_date_eq ---! @param b public.eql_v3_date_eq +--! @brief Operator wrapper for public.{{prefix}}_date_eq. +--! @param a public.{{prefix}}_date_eq +--! @param b public.{{prefix}}_date_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_date_eq, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_eq, b public.{{prefix}}_date_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_eq. ---! @param a public.eql_v3_date_eq +--! @brief Operator wrapper for public.{{prefix}}_date_eq. +--! @param a public.{{prefix}}_date_eq --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_date_eq, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b::public.eql_v3_date_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_date_eq) $$; ---! @brief Operator wrapper for public.eql_v3_date_eq. +--! @brief Operator wrapper for public.{{prefix}}_date_eq. --! @param a jsonb ---! @param b public.eql_v3_date_eq +--! @param b public.{{prefix}}_date_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_date_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_date_eq) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_date_eq) <> {{prefix}}.eq_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator ---! @param b public.eql_v3_date_eq right operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator +--! @param b public.{{prefix}}_date_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_date_eq, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_date_eq, b public.{{prefix}}_date_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_date_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_date_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_eq right operand of the blocked operator +--! @param b public.{{prefix}}_date_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_date_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator ---! @param b public.eql_v3_date_eq right operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator +--! @param b public.{{prefix}}_date_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_date_eq, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_date_eq, b public.{{prefix}}_date_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_date_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_date_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_eq right operand of the blocked operator +--! @param b public.{{prefix}}_date_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_date_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator ---! @param b public.eql_v3_date_eq right operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator +--! @param b public.{{prefix}}_date_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_date_eq, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_date_eq, b public.{{prefix}}_date_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_date_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_date_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_eq right operand of the blocked operator +--! @param b public.{{prefix}}_date_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_date_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator ---! @param b public.eql_v3_date_eq right operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator +--! @param b public.{{prefix}}_date_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_date_eq, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_date_eq, b public.{{prefix}}_date_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_date_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_date_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_eq right operand of the blocked operator +--! @param b public.{{prefix}}_date_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_date_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator ---! @param b public.eql_v3_date_eq right operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator +--! @param b public.{{prefix}}_date_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_date_eq, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_date_eq, b public.{{prefix}}_date_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_date_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_date_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_eq right operand of the blocked operator +--! @param b public.{{prefix}}_date_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_date_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator ---! @param b public.eql_v3_date_eq right operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator +--! @param b public.{{prefix}}_date_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_date_eq, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_date_eq, b public.{{prefix}}_date_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_date_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_date_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_eq right operand of the blocked operator +--! @param b public.{{prefix}}_date_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_date_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_date_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_date_eq, selector text) -RETURNS public.eql_v3_date_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_date_eq'; END; $$ +--! @return public.{{prefix}}_date_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_date_eq, selector text) +RETURNS public.{{prefix}}_date_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_date_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_date_eq, selector integer) -RETURNS public.eql_v3_date_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_date_eq'; END; $$ +--! @return public.{{prefix}}_date_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_date_eq, selector integer) +RETURNS public.{{prefix}}_date_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_date_eq right operand of the blocked operator ---! @return public.eql_v3_date_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_date_eq) -RETURNS public.eql_v3_date_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_date_eq'; END; $$ +--! @param selector public.{{prefix}}_date_eq right operand of the blocked operator +--! @return public.{{prefix}}_date_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_date_eq) +RETURNS public.{{prefix}}_date_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_date_eq, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_date_eq, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_date_eq, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_date_eq, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_date_eq right operand of the blocked operator +--! @param selector public.{{prefix}}_date_eq right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_date_eq) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_date_eq, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_date_eq, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_date_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_date_eq, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_date_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_date_eq, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_date_eq, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_date_eq, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator ---! @param b public.eql_v3_date_eq right operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator +--! @param b public.{{prefix}}_date_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_date_eq, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_date_eq, b public.{{prefix}}_date_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_date_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_date_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_eq right operand of the blocked operator +--! @param b public.{{prefix}}_date_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_date_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_date_eq, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_date_eq, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_date_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_date_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_date_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_date_eq, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_date_eq, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_date_eq, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_date_eq, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_date_eq, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_date_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_date_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_date_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_date_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator ---! @param b public.eql_v3_date_eq right operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator +--! @param b public.{{prefix}}_date_eq right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_date_eq, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_date_eq, b public.{{prefix}}_date_eq) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_eq left operand of the blocked operator +--! @param a public.{{prefix}}_date_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_date_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_date_eq, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_eq right operand of the blocked operator +--! @param b public.{{prefix}}_date_eq right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_date_eq) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_date_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_date_eq'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/date/date_eq_operators.sql b/packages/eql/src/v3/scalars/date/date_eq_operators.sql index 6fa719cc4..17ec9d4a2 100644 --- a/packages/eql/src/v3/scalars/date/date_eq_operators.sql +++ b/packages/eql/src/v3/scalars/date/date_eq_operators.sql @@ -4,245 +4,245 @@ -- REQUIRE: src/v3/scalars/date/date_eq_functions.sql --! @file encrypted_domain/date/date_eq_operators.sql ---! @brief Operators for public.eql_v3_date_eq. +--! @brief Operators for public.{{prefix}}_date_eq. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_date_eq, RIGHTARG = public.eql_v3_date_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = public.{{prefix}}_date_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_date_eq, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_date_eq, RIGHTARG = public.eql_v3_date_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = public.{{prefix}}_date_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_date_eq, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_date_eq, RIGHTARG = public.eql_v3_date_eq + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = public.{{prefix}}_date_eq ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_date_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_eq + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_eq ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_date_eq, RIGHTARG = public.eql_v3_date_eq + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = public.{{prefix}}_date_eq ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_date_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_eq + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_eq ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_date_eq, RIGHTARG = public.eql_v3_date_eq + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = public.{{prefix}}_date_eq ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_date_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_eq + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_eq ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_date_eq, RIGHTARG = public.eql_v3_date_eq + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = public.{{prefix}}_date_eq ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_date_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_eq + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_eq ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_date_eq, RIGHTARG = public.eql_v3_date_eq + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = public.{{prefix}}_date_eq ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_date_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_eq + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_eq ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_date_eq, RIGHTARG = public.eql_v3_date_eq + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = public.{{prefix}}_date_eq ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_date_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_eq + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_eq ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_date_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_date_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_eq + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_eq ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_date_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_date_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_eq + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_eq ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_date_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_date_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_date_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_date_eq, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_date_eq, RIGHTARG = public.eql_v3_date_eq + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = public.{{prefix}}_date_eq ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_date_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_eq + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_eq ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_date_eq, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_date_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_date_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_date_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_date_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_date_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_date_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_date_eq, RIGHTARG = public.eql_v3_date_eq + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = public.{{prefix}}_date_eq ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_date_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_eq + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_eq ); diff --git a/packages/eql/src/v3/scalars/date/date_functions.sql b/packages/eql/src/v3/scalars/date/date_functions.sql index 463bbdca5..0ac101353 100644 --- a/packages/eql/src/v3/scalars/date/date_functions.sql +++ b/packages/eql/src/v3/scalars/date/date_functions.sql @@ -4,662 +4,662 @@ -- REQUIRE: src/v3/scalars/functions.sql --! @file encrypted_domain/date/date_functions.sql ---! @brief Functions for public.eql_v3_date. +--! @brief Functions for public.{{prefix}}_date. ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_date, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_date, b public.{{prefix}}_date) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_date, b jsonb) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_date, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a jsonb, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal.eq(a jsonb, b public.{{prefix}}_date) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_date, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_date, b public.{{prefix}}_date) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_date, b jsonb) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_date, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a jsonb, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal.neq(a jsonb, b public.{{prefix}}_date) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_date, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_date, b public.{{prefix}}_date) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_date, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_date, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_date) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_date, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_date, b public.{{prefix}}_date) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_date, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_date, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_date) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_date, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_date, b public.{{prefix}}_date) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_date, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_date, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_date) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_date, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_date, b public.{{prefix}}_date) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_date, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_date, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_date) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_date, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_date, b public.{{prefix}}_date) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_date, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_date, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_date) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_date, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_date, b public.{{prefix}}_date) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_date, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_date, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_date) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_date never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_date, selector text) -RETURNS public.eql_v3_date IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_date'; END; $$ +--! @return public.{{prefix}}_date never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_date, selector text) +RETURNS public.{{prefix}}_date IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_date never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_date, selector integer) -RETURNS public.eql_v3_date IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_date'; END; $$ +--! @return public.{{prefix}}_date never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_date, selector integer) +RETURNS public.{{prefix}}_date IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_date right operand of the blocked operator ---! @return public.eql_v3_date never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_date) -RETURNS public.eql_v3_date IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_date'; END; $$ +--! @param selector public.{{prefix}}_date right operand of the blocked operator +--! @return public.{{prefix}}_date never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_date) +RETURNS public.{{prefix}}_date IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_date, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_date, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_date, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_date, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_date right operand of the blocked operator +--! @param selector public.{{prefix}}_date right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_date) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_date, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_date, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_date, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_date, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_date, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_date, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_date, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_date, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_date, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_date, b public.{{prefix}}_date) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_date, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_date, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_date) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_date, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_date, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_date, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_date, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_date, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_date, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_date, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_date, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_date, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_date, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_date, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_date, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_date, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_date, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_date, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_date, b public.{{prefix}}_date) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date left operand of the blocked operator +--! @param a public.{{prefix}}_date left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_date, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_date, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date. +--! @brief Unsupported operator blocker for public.{{prefix}}_date. --! ---! Intercepts an operator that is not supported on public.eql_v3_date and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date right operand of the blocked operator +--! @param b public.{{prefix}}_date right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_date) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_date) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_date'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_date'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/date/date_operators.sql b/packages/eql/src/v3/scalars/date/date_operators.sql index daad33efe..bc651c657 100644 --- a/packages/eql/src/v3/scalars/date/date_operators.sql +++ b/packages/eql/src/v3/scalars/date/date_operators.sql @@ -4,239 +4,239 @@ -- REQUIRE: src/v3/scalars/date/date_functions.sql --! @file encrypted_domain/date/date_operators.sql ---! @brief Operators for public.eql_v3_date. +--! @brief Operators for public.{{prefix}}_date. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_date, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_date, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_date, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_date, RIGHTARG = jsonb ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_date, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_date, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_date, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_date, RIGHTARG = jsonb ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_date, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_date, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_date, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_date, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_date, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_date, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_date, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_date, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_date, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_date, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_date, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_date, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_date, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_date, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_date, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_date, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_date, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_date, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_date, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_date, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_date, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_date, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_date, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_date, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_date, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_date, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_date, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_date, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_date, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_date, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_date, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_date, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_date, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_date, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_date, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_date, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_date, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_date, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_date, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_date, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_date, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_date, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_date, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_date, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_date, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_date, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_date, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_date, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_date, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_date, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_date, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_date, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_date, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_date, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_date, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_date, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_date, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_date, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_date, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_date, RIGHTARG = public.{{prefix}}_date ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_date, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_date, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date ); diff --git a/packages/eql/src/v3/scalars/date/date_ord_aggregates.sql b/packages/eql/src/v3/scalars/date/date_ord_aggregates.sql index c3050d373..17fc17831 100644 --- a/packages/eql/src/v3/scalars/date/date_ord_aggregates.sql +++ b/packages/eql/src/v3/scalars/date/date_ord_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/date/date_ord_operators.sql --! @file encrypted_domain/date/date_ord_aggregates.sql ---! @brief Aggregates for public.eql_v3_date_ord. +--! @brief Aggregates for public.{{prefix}}_date_ord. ---! @brief State function for min on public.eql_v3_date_ord. ---! @param state public.eql_v3_date_ord ---! @param value public.eql_v3_date_ord ---! @return public.eql_v3_date_ord -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_date_ord, value public.eql_v3_date_ord) -RETURNS public.eql_v3_date_ord +--! @brief State function for min on public.{{prefix}}_date_ord. +--! @param state public.{{prefix}}_date_ord +--! @param value public.{{prefix}}_date_ord +--! @return public.{{prefix}}_date_ord +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_date_ord, value public.{{prefix}}_date_ord) +RETURNS public.{{prefix}}_date_ord LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_date_ord. ---! @param input public.eql_v3_date_ord ---! @return public.eql_v3_date_ord -CREATE AGGREGATE eql_v3.min(public.eql_v3_date_ord) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_date_ord, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_date_ord. +--! @param input public.{{prefix}}_date_ord +--! @return public.{{prefix}}_date_ord +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_date_ord) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_date_ord, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_date_ord. ---! @param state public.eql_v3_date_ord ---! @param value public.eql_v3_date_ord ---! @return public.eql_v3_date_ord -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_date_ord, value public.eql_v3_date_ord) -RETURNS public.eql_v3_date_ord +--! @brief State function for max on public.{{prefix}}_date_ord. +--! @param state public.{{prefix}}_date_ord +--! @param value public.{{prefix}}_date_ord +--! @return public.{{prefix}}_date_ord +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_date_ord, value public.{{prefix}}_date_ord) +RETURNS public.{{prefix}}_date_ord LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_date_ord. ---! @param input public.eql_v3_date_ord ---! @return public.eql_v3_date_ord -CREATE AGGREGATE eql_v3.max(public.eql_v3_date_ord) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_date_ord, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_date_ord. +--! @param input public.{{prefix}}_date_ord +--! @return public.{{prefix}}_date_ord +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_date_ord) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_date_ord, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/date/date_ord_functions.sql b/packages/eql/src/v3/scalars/date/date_ord_functions.sql index baf000ced..859031af8 100644 --- a/packages/eql/src/v3/scalars/date/date_ord_functions.sql +++ b/packages/eql/src/v3/scalars/date/date_ord_functions.sql @@ -5,562 +5,562 @@ -- REQUIRE: src/v3/sem/ope_cllw/functions.sql --! @file encrypted_domain/date/date_ord_functions.sql ---! @brief Functions for public.eql_v3_date_ord. +--! @brief Functions for public.{{prefix}}_date_ord. ---! @brief Index extractor for public.eql_v3_date_ord. ---! @param a public.eql_v3_date_ord ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a public.eql_v3_date_ord) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for public.{{prefix}}_date_ord. +--! @param a public.{{prefix}}_date_ord +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a public.{{prefix}}_date_ord) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord. ---! @param a public.eql_v3_date_ord ---! @param b public.eql_v3_date_ord +--! @brief Operator wrapper for public.{{prefix}}_date_ord. +--! @param a public.{{prefix}}_date_ord +--! @param b public.{{prefix}}_date_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_date_ord, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord. ---! @param a public.eql_v3_date_ord +--! @brief Operator wrapper for public.{{prefix}}_date_ord. +--! @param a public.{{prefix}}_date_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_date_ord, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b::public.eql_v3_date_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_date_ord) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord. +--! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a jsonb ---! @param b public.eql_v3_date_ord +--! @param b public.{{prefix}}_date_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_date_ord) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord. ---! @param a public.eql_v3_date_ord ---! @param b public.eql_v3_date_ord +--! @brief Operator wrapper for public.{{prefix}}_date_ord. +--! @param a public.{{prefix}}_date_ord +--! @param b public.{{prefix}}_date_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_date_ord, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord. ---! @param a public.eql_v3_date_ord +--! @brief Operator wrapper for public.{{prefix}}_date_ord. +--! @param a public.{{prefix}}_date_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_date_ord, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b::public.eql_v3_date_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_date_ord) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord. +--! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a jsonb ---! @param b public.eql_v3_date_ord +--! @param b public.{{prefix}}_date_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_date_ord) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord. ---! @param a public.eql_v3_date_ord ---! @param b public.eql_v3_date_ord +--! @brief Operator wrapper for public.{{prefix}}_date_ord. +--! @param a public.{{prefix}}_date_ord +--! @param b public.{{prefix}}_date_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_date_ord, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord. ---! @param a public.eql_v3_date_ord +--! @brief Operator wrapper for public.{{prefix}}_date_ord. +--! @param a public.{{prefix}}_date_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_date_ord, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_date_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b::public.eql_v3_date_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_date_ord) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord. +--! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a jsonb ---! @param b public.eql_v3_date_ord +--! @param b public.{{prefix}}_date_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_date_ord) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord. ---! @param a public.eql_v3_date_ord ---! @param b public.eql_v3_date_ord +--! @brief Operator wrapper for public.{{prefix}}_date_ord. +--! @param a public.{{prefix}}_date_ord +--! @param b public.{{prefix}}_date_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_date_ord, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord. ---! @param a public.eql_v3_date_ord +--! @brief Operator wrapper for public.{{prefix}}_date_ord. +--! @param a public.{{prefix}}_date_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_date_ord, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_date_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b::public.eql_v3_date_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_date_ord) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord. +--! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a jsonb ---! @param b public.eql_v3_date_ord +--! @param b public.{{prefix}}_date_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_date_ord) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord. ---! @param a public.eql_v3_date_ord ---! @param b public.eql_v3_date_ord +--! @brief Operator wrapper for public.{{prefix}}_date_ord. +--! @param a public.{{prefix}}_date_ord +--! @param b public.{{prefix}}_date_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_date_ord, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord. ---! @param a public.eql_v3_date_ord +--! @brief Operator wrapper for public.{{prefix}}_date_ord. +--! @param a public.{{prefix}}_date_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_date_ord, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_date_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b::public.eql_v3_date_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_date_ord) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord. +--! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a jsonb ---! @param b public.eql_v3_date_ord +--! @param b public.{{prefix}}_date_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_date_ord) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord. ---! @param a public.eql_v3_date_ord ---! @param b public.eql_v3_date_ord +--! @brief Operator wrapper for public.{{prefix}}_date_ord. +--! @param a public.{{prefix}}_date_ord +--! @param b public.{{prefix}}_date_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_date_ord, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord. ---! @param a public.eql_v3_date_ord +--! @brief Operator wrapper for public.{{prefix}}_date_ord. +--! @param a public.{{prefix}}_date_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_date_ord, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_date_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b::public.eql_v3_date_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_date_ord) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord. +--! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a jsonb ---! @param b public.eql_v3_date_ord +--! @param b public.{{prefix}}_date_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_date_ord) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator ---! @param b public.eql_v3_date_ord right operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator +--! @param b public.{{prefix}}_date_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_date_ord, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_date_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_date_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_ord right operand of the blocked operator +--! @param b public.{{prefix}}_date_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_date_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator ---! @param b public.eql_v3_date_ord right operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator +--! @param b public.{{prefix}}_date_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_date_ord, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_date_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_date_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_ord right operand of the blocked operator +--! @param b public.{{prefix}}_date_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_date_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_date_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_date_ord, selector text) -RETURNS public.eql_v3_date_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_date_ord'; END; $$ +--! @return public.{{prefix}}_date_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_date_ord, selector text) +RETURNS public.{{prefix}}_date_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_date_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_date_ord, selector integer) -RETURNS public.eql_v3_date_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_date_ord'; END; $$ +--! @return public.{{prefix}}_date_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_date_ord, selector integer) +RETURNS public.{{prefix}}_date_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_date_ord right operand of the blocked operator ---! @return public.eql_v3_date_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_date_ord) -RETURNS public.eql_v3_date_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_date_ord'; END; $$ +--! @param selector public.{{prefix}}_date_ord right operand of the blocked operator +--! @return public.{{prefix}}_date_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_date_ord) +RETURNS public.{{prefix}}_date_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_date_ord, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_date_ord, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_date_ord, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_date_ord, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_date_ord right operand of the blocked operator +--! @param selector public.{{prefix}}_date_ord right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_date_ord) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_date_ord, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_date_ord, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_date_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_date_ord, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_date_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_date_ord, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_date_ord, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_date_ord, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator ---! @param b public.eql_v3_date_ord right operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator +--! @param b public.{{prefix}}_date_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_date_ord, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_date_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_date_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_ord right operand of the blocked operator +--! @param b public.{{prefix}}_date_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_date_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_date_ord, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_date_ord, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_date_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_date_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_date_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_date_ord, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_date_ord, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_date_ord, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_date_ord, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_date_ord, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_date_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_date_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_date_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_date_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator ---! @param b public.eql_v3_date_ord right operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator +--! @param b public.{{prefix}}_date_ord right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_date_ord, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_date_ord, b public.{{prefix}}_date_ord) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_date_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_date_ord, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_ord right operand of the blocked operator +--! @param b public.{{prefix}}_date_ord right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_date_ord) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_date_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_date_ord'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/date/date_ord_ope_aggregates.sql b/packages/eql/src/v3/scalars/date/date_ord_ope_aggregates.sql index 7f2908c0c..26fa57f22 100644 --- a/packages/eql/src/v3/scalars/date/date_ord_ope_aggregates.sql +++ b/packages/eql/src/v3/scalars/date/date_ord_ope_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/date/date_ord_ope_operators.sql --! @file encrypted_domain/date/date_ord_ope_aggregates.sql ---! @brief Aggregates for public.eql_v3_date_ord_ope. +--! @brief Aggregates for public.{{prefix}}_date_ord_ope. ---! @brief State function for min on public.eql_v3_date_ord_ope. ---! @param state public.eql_v3_date_ord_ope ---! @param value public.eql_v3_date_ord_ope ---! @return public.eql_v3_date_ord_ope -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_date_ord_ope, value public.eql_v3_date_ord_ope) -RETURNS public.eql_v3_date_ord_ope +--! @brief State function for min on public.{{prefix}}_date_ord_ope. +--! @param state public.{{prefix}}_date_ord_ope +--! @param value public.{{prefix}}_date_ord_ope +--! @return public.{{prefix}}_date_ord_ope +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_date_ord_ope, value public.{{prefix}}_date_ord_ope) +RETURNS public.{{prefix}}_date_ord_ope LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_date_ord_ope. ---! @param input public.eql_v3_date_ord_ope ---! @return public.eql_v3_date_ord_ope -CREATE AGGREGATE eql_v3.min(public.eql_v3_date_ord_ope) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_date_ord_ope, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_date_ord_ope. +--! @param input public.{{prefix}}_date_ord_ope +--! @return public.{{prefix}}_date_ord_ope +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_date_ord_ope) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_date_ord_ope, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_date_ord_ope. ---! @param state public.eql_v3_date_ord_ope ---! @param value public.eql_v3_date_ord_ope ---! @return public.eql_v3_date_ord_ope -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_date_ord_ope, value public.eql_v3_date_ord_ope) -RETURNS public.eql_v3_date_ord_ope +--! @brief State function for max on public.{{prefix}}_date_ord_ope. +--! @param state public.{{prefix}}_date_ord_ope +--! @param value public.{{prefix}}_date_ord_ope +--! @return public.{{prefix}}_date_ord_ope +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_date_ord_ope, value public.{{prefix}}_date_ord_ope) +RETURNS public.{{prefix}}_date_ord_ope LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_date_ord_ope. ---! @param input public.eql_v3_date_ord_ope ---! @return public.eql_v3_date_ord_ope -CREATE AGGREGATE eql_v3.max(public.eql_v3_date_ord_ope) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_date_ord_ope, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_date_ord_ope. +--! @param input public.{{prefix}}_date_ord_ope +--! @return public.{{prefix}}_date_ord_ope +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_date_ord_ope) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_date_ord_ope, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/date/date_ord_ope_functions.sql b/packages/eql/src/v3/scalars/date/date_ord_ope_functions.sql index 9cc2a88d0..c64f82300 100644 --- a/packages/eql/src/v3/scalars/date/date_ord_ope_functions.sql +++ b/packages/eql/src/v3/scalars/date/date_ord_ope_functions.sql @@ -5,562 +5,562 @@ -- REQUIRE: src/v3/sem/ope_cllw/functions.sql --! @file encrypted_domain/date/date_ord_ope_functions.sql ---! @brief Functions for public.eql_v3_date_ord_ope. +--! @brief Functions for public.{{prefix}}_date_ord_ope. ---! @brief Index extractor for public.eql_v3_date_ord_ope. ---! @param a public.eql_v3_date_ord_ope ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a public.eql_v3_date_ord_ope) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for public.{{prefix}}_date_ord_ope. +--! @param a public.{{prefix}}_date_ord_ope +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a public.{{prefix}}_date_ord_ope) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ope. ---! @param a public.eql_v3_date_ord_ope ---! @param b public.eql_v3_date_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. +--! @param a public.{{prefix}}_date_ord_ope +--! @param b public.{{prefix}}_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_date_ord_ope, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_ord_ope, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ope. ---! @param a public.eql_v3_date_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. +--! @param a public.{{prefix}}_date_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_date_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b::public.eql_v3_date_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_date_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_date_ord_ope +--! @param b public.{{prefix}}_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_date_ord_ope) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ope. ---! @param a public.eql_v3_date_ord_ope ---! @param b public.eql_v3_date_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. +--! @param a public.{{prefix}}_date_ord_ope +--! @param b public.{{prefix}}_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_date_ord_ope, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_ord_ope, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ope. ---! @param a public.eql_v3_date_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. +--! @param a public.{{prefix}}_date_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_date_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b::public.eql_v3_date_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_date_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_date_ord_ope +--! @param b public.{{prefix}}_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_date_ord_ope) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ope. ---! @param a public.eql_v3_date_ord_ope ---! @param b public.eql_v3_date_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. +--! @param a public.{{prefix}}_date_ord_ope +--! @param b public.{{prefix}}_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_date_ord_ope, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_date_ord_ope, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ope. ---! @param a public.eql_v3_date_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. +--! @param a public.{{prefix}}_date_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_date_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_date_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b::public.eql_v3_date_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_date_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_date_ord_ope +--! @param b public.{{prefix}}_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_date_ord_ope) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ope. ---! @param a public.eql_v3_date_ord_ope ---! @param b public.eql_v3_date_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. +--! @param a public.{{prefix}}_date_ord_ope +--! @param b public.{{prefix}}_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_date_ord_ope, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_date_ord_ope, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ope. ---! @param a public.eql_v3_date_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. +--! @param a public.{{prefix}}_date_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_date_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_date_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b::public.eql_v3_date_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_date_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_date_ord_ope +--! @param b public.{{prefix}}_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_date_ord_ope) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ope. ---! @param a public.eql_v3_date_ord_ope ---! @param b public.eql_v3_date_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. +--! @param a public.{{prefix}}_date_ord_ope +--! @param b public.{{prefix}}_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_date_ord_ope, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_date_ord_ope, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ope. ---! @param a public.eql_v3_date_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. +--! @param a public.{{prefix}}_date_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_date_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_date_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b::public.eql_v3_date_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_date_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_date_ord_ope +--! @param b public.{{prefix}}_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_date_ord_ope) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ope. ---! @param a public.eql_v3_date_ord_ope ---! @param b public.eql_v3_date_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. +--! @param a public.{{prefix}}_date_ord_ope +--! @param b public.{{prefix}}_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_date_ord_ope, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_date_ord_ope, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ope. ---! @param a public.eql_v3_date_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. +--! @param a public.{{prefix}}_date_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_date_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_date_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b::public.eql_v3_date_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_date_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_date_ord_ope +--! @param b public.{{prefix}}_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_date_ord_ope) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_date_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_date_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_date_ord_ope, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_date_ord_ope, b public.{{prefix}}_date_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_date_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_date_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_date_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_date_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_date_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_date_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_date_ord_ope, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_date_ord_ope, b public.{{prefix}}_date_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_date_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_date_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_date_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_date_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_date_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_date_ord_ope, selector text) -RETURNS public.eql_v3_date_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_date_ord_ope'; END; $$ +--! @return public.{{prefix}}_date_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_date_ord_ope, selector text) +RETURNS public.{{prefix}}_date_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_date_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_date_ord_ope, selector integer) -RETURNS public.eql_v3_date_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_date_ord_ope'; END; $$ +--! @return public.{{prefix}}_date_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_date_ord_ope, selector integer) +RETURNS public.{{prefix}}_date_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_date_ord_ope right operand of the blocked operator ---! @return public.eql_v3_date_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_date_ord_ope) -RETURNS public.eql_v3_date_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_date_ord_ope'; END; $$ +--! @param selector public.{{prefix}}_date_ord_ope right operand of the blocked operator +--! @return public.{{prefix}}_date_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_date_ord_ope) +RETURNS public.{{prefix}}_date_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_date_ord_ope, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_date_ord_ope, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_date_ord_ope, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_date_ord_ope, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_date_ord_ope right operand of the blocked operator +--! @param selector public.{{prefix}}_date_ord_ope right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_date_ord_ope) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_date_ord_ope, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_date_ord_ope, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_date_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_date_ord_ope, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_date_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_date_ord_ope, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_date_ord_ope, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_date_ord_ope, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_date_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_date_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_date_ord_ope, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_date_ord_ope, b public.{{prefix}}_date_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_date_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_date_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_date_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_date_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_date_ord_ope, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_date_ord_ope, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_date_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_date_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_date_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_date_ord_ope, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_date_ord_ope, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_date_ord_ope, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_date_ord_ope, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_date_ord_ope, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_date_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_date_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_date_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_date_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_date_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_date_ord_ope right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_date_ord_ope, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_date_ord_ope, b public.{{prefix}}_date_ord_ope) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_date_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_date_ord_ope, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_date_ord_ope right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_date_ord_ope) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_date_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_date_ord_ope'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/date/date_ord_ope_operators.sql b/packages/eql/src/v3/scalars/date/date_ord_ope_operators.sql index b511e73a0..6a5ce6b96 100644 --- a/packages/eql/src/v3/scalars/date/date_ord_ope_operators.sql +++ b/packages/eql/src/v3/scalars/date/date_ord_ope_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/date/date_ord_ope_functions.sql --! @file encrypted_domain/date/date_ord_ope_operators.sql ---! @brief Operators for public.eql_v3_date_ord_ope. +--! @brief Operators for public.{{prefix}}_date_ord_ope. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = public.eql_v3_date_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = public.eql_v3_date_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = public.eql_v3_date_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = public.eql_v3_date_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = public.eql_v3_date_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = public.eql_v3_date_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = public.eql_v3_date_ord_ope + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ope ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ope + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ope ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = public.eql_v3_date_ord_ope + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ope ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ope + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ope ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ope + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ope ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ope + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ope ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = public.eql_v3_date_ord_ope + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ope ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ope + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ope ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = public.eql_v3_date_ord_ope + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ope ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ope + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ope ); diff --git a/packages/eql/src/v3/scalars/date/date_ord_operators.sql b/packages/eql/src/v3/scalars/date/date_ord_operators.sql index 28e0bac49..bed1b234d 100644 --- a/packages/eql/src/v3/scalars/date/date_ord_operators.sql +++ b/packages/eql/src/v3/scalars/date/date_ord_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/date/date_ord_functions.sql --! @file encrypted_domain/date/date_ord_operators.sql ---! @brief Operators for public.eql_v3_date_ord. +--! @brief Operators for public.{{prefix}}_date_ord. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = public.eql_v3_date_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = public.{{prefix}}_date_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = public.eql_v3_date_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = public.{{prefix}}_date_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = public.eql_v3_date_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = public.{{prefix}}_date_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = public.eql_v3_date_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = public.{{prefix}}_date_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = public.eql_v3_date_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = public.{{prefix}}_date_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = public.eql_v3_date_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = public.{{prefix}}_date_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = public.eql_v3_date_ord + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = public.{{prefix}}_date_ord ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = public.eql_v3_date_ord + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = public.{{prefix}}_date_ord ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_date_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_date_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_date_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_date_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_date_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_date_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_date_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_date_ord, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_date_ord, RIGHTARG = public.eql_v3_date_ord + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = public.{{prefix}}_date_ord ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_date_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_date_ord, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_date_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_date_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_date_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_date_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_date_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_date_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_date_ord, RIGHTARG = public.eql_v3_date_ord + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = public.{{prefix}}_date_ord ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_date_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord ); diff --git a/packages/eql/src/v3/scalars/date/date_ord_ore_aggregates.sql b/packages/eql/src/v3/scalars/date/date_ord_ore_aggregates.sql index bcc6aa22b..1cbcd8125 100644 --- a/packages/eql/src/v3/scalars/date/date_ord_ore_aggregates.sql +++ b/packages/eql/src/v3/scalars/date/date_ord_ore_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/date/date_ord_ore_operators.sql --! @file encrypted_domain/date/date_ord_ore_aggregates.sql ---! @brief Aggregates for public.eql_v3_date_ord_ore. +--! @brief Aggregates for public.{{prefix}}_date_ord_ore. ---! @brief State function for min on public.eql_v3_date_ord_ore. ---! @param state public.eql_v3_date_ord_ore ---! @param value public.eql_v3_date_ord_ore ---! @return public.eql_v3_date_ord_ore -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_date_ord_ore, value public.eql_v3_date_ord_ore) -RETURNS public.eql_v3_date_ord_ore +--! @brief State function for min on public.{{prefix}}_date_ord_ore. +--! @param state public.{{prefix}}_date_ord_ore +--! @param value public.{{prefix}}_date_ord_ore +--! @return public.{{prefix}}_date_ord_ore +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_date_ord_ore, value public.{{prefix}}_date_ord_ore) +RETURNS public.{{prefix}}_date_ord_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_date_ord_ore. ---! @param input public.eql_v3_date_ord_ore ---! @return public.eql_v3_date_ord_ore -CREATE AGGREGATE eql_v3.min(public.eql_v3_date_ord_ore) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_date_ord_ore, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_date_ord_ore. +--! @param input public.{{prefix}}_date_ord_ore +--! @return public.{{prefix}}_date_ord_ore +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_date_ord_ore) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_date_ord_ore, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_date_ord_ore. ---! @param state public.eql_v3_date_ord_ore ---! @param value public.eql_v3_date_ord_ore ---! @return public.eql_v3_date_ord_ore -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_date_ord_ore, value public.eql_v3_date_ord_ore) -RETURNS public.eql_v3_date_ord_ore +--! @brief State function for max on public.{{prefix}}_date_ord_ore. +--! @param state public.{{prefix}}_date_ord_ore +--! @param value public.{{prefix}}_date_ord_ore +--! @return public.{{prefix}}_date_ord_ore +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_date_ord_ore, value public.{{prefix}}_date_ord_ore) +RETURNS public.{{prefix}}_date_ord_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_date_ord_ore. ---! @param input public.eql_v3_date_ord_ore ---! @return public.eql_v3_date_ord_ore -CREATE AGGREGATE eql_v3.max(public.eql_v3_date_ord_ore) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_date_ord_ore, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_date_ord_ore. +--! @param input public.{{prefix}}_date_ord_ore +--! @return public.{{prefix}}_date_ord_ore +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_date_ord_ore) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_date_ord_ore, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/date/date_ord_ore_functions.sql b/packages/eql/src/v3/scalars/date/date_ord_ore_functions.sql index a84903fb3..676c12d33 100644 --- a/packages/eql/src/v3/scalars/date/date_ord_ore_functions.sql +++ b/packages/eql/src/v3/scalars/date/date_ord_ore_functions.sql @@ -6,562 +6,562 @@ -- REQUIRE: src/v3/sem/ore_block_256/operators.sql --! @file encrypted_domain/date/date_ord_ore_functions.sql ---! @brief Functions for public.eql_v3_date_ord_ore. +--! @brief Functions for public.{{prefix}}_date_ord_ore. ---! @brief Index extractor for public.eql_v3_date_ord_ore. ---! @param a public.eql_v3_date_ord_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a public.eql_v3_date_ord_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for public.{{prefix}}_date_ord_ore. +--! @param a public.{{prefix}}_date_ord_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a public.{{prefix}}_date_ord_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ore. ---! @param a public.eql_v3_date_ord_ore ---! @param b public.eql_v3_date_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. +--! @param a public.{{prefix}}_date_ord_ore +--! @param b public.{{prefix}}_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_date_ord_ore, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_ord_ore, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ore. ---! @param a public.eql_v3_date_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. +--! @param a public.{{prefix}}_date_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_date_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b::public.eql_v3_date_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{prefix}}_date_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_date_ord_ore +--! @param b public.{{prefix}}_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_date_ord_ore) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ore. ---! @param a public.eql_v3_date_ord_ore ---! @param b public.eql_v3_date_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. +--! @param a public.{{prefix}}_date_ord_ore +--! @param b public.{{prefix}}_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_date_ord_ore, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_ord_ore, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ore. ---! @param a public.eql_v3_date_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. +--! @param a public.{{prefix}}_date_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_date_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b::public.eql_v3_date_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{prefix}}_date_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_date_ord_ore +--! @param b public.{{prefix}}_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_date_ord_ore) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ore. ---! @param a public.eql_v3_date_ord_ore ---! @param b public.eql_v3_date_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. +--! @param a public.{{prefix}}_date_ord_ore +--! @param b public.{{prefix}}_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_date_ord_ore, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_date_ord_ore, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ore. ---! @param a public.eql_v3_date_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. +--! @param a public.{{prefix}}_date_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_date_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_date_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b::public.eql_v3_date_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_date_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_date_ord_ore +--! @param b public.{{prefix}}_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_date_ord_ore) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ore. ---! @param a public.eql_v3_date_ord_ore ---! @param b public.eql_v3_date_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. +--! @param a public.{{prefix}}_date_ord_ore +--! @param b public.{{prefix}}_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_date_ord_ore, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_date_ord_ore, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ore. ---! @param a public.eql_v3_date_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. +--! @param a public.{{prefix}}_date_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_date_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_date_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b::public.eql_v3_date_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_date_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_date_ord_ore +--! @param b public.{{prefix}}_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_date_ord_ore) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ore. ---! @param a public.eql_v3_date_ord_ore ---! @param b public.eql_v3_date_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. +--! @param a public.{{prefix}}_date_ord_ore +--! @param b public.{{prefix}}_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_date_ord_ore, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_date_ord_ore, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ore. ---! @param a public.eql_v3_date_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. +--! @param a public.{{prefix}}_date_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_date_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_date_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b::public.eql_v3_date_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_date_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_date_ord_ore +--! @param b public.{{prefix}}_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_date_ord_ore) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ore. ---! @param a public.eql_v3_date_ord_ore ---! @param b public.eql_v3_date_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. +--! @param a public.{{prefix}}_date_ord_ore +--! @param b public.{{prefix}}_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_date_ord_ore, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_date_ord_ore, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ore. ---! @param a public.eql_v3_date_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. +--! @param a public.{{prefix}}_date_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_date_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_date_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b::public.eql_v3_date_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_date_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_date_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_date_ord_ore +--! @param b public.{{prefix}}_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_date_ord_ore) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_date_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_date_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_date_ord_ore, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_date_ord_ore, b public.{{prefix}}_date_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_date_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_date_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_date_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_date_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_date_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_date_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_date_ord_ore, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_date_ord_ore, b public.{{prefix}}_date_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_date_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_date_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_date_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_date_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_date_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_date_ord_ore, selector text) -RETURNS public.eql_v3_date_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_date_ord_ore'; END; $$ +--! @return public.{{prefix}}_date_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_date_ord_ore, selector text) +RETURNS public.{{prefix}}_date_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_date_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_date_ord_ore, selector integer) -RETURNS public.eql_v3_date_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_date_ord_ore'; END; $$ +--! @return public.{{prefix}}_date_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_date_ord_ore, selector integer) +RETURNS public.{{prefix}}_date_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_date_ord_ore right operand of the blocked operator ---! @return public.eql_v3_date_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_date_ord_ore) -RETURNS public.eql_v3_date_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_date_ord_ore'; END; $$ +--! @param selector public.{{prefix}}_date_ord_ore right operand of the blocked operator +--! @return public.{{prefix}}_date_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_date_ord_ore) +RETURNS public.{{prefix}}_date_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_date_ord_ore, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_date_ord_ore, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_date_ord_ore, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_date_ord_ore, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_date_ord_ore right operand of the blocked operator +--! @param selector public.{{prefix}}_date_ord_ore right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_date_ord_ore) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_date_ord_ore, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_date_ord_ore, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_date_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_date_ord_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_date_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_date_ord_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_date_ord_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_date_ord_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_date_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_date_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_date_ord_ore, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_date_ord_ore, b public.{{prefix}}_date_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_date_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_date_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_date_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_date_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_date_ord_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_date_ord_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_date_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_date_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_date_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_date_ord_ore, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_date_ord_ore, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_date_ord_ore, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_date_ord_ore, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_date_ord_ore, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_date_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_date_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_date_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_date_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_date_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_date_ord_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_date_ord_ore, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_date_ord_ore, b public.{{prefix}}_date_ord_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_date_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_date_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_date_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_date_ord_ore, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_date_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_date_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_date_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_date_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_date_ord_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_date_ord_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_date_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_date_ord_ore'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/date/date_ord_ore_operators.sql b/packages/eql/src/v3/scalars/date/date_ord_ore_operators.sql index 28a9cc7ed..a248fbfc1 100644 --- a/packages/eql/src/v3/scalars/date/date_ord_ore_operators.sql +++ b/packages/eql/src/v3/scalars/date/date_ord_ore_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/date/date_ord_ore_functions.sql --! @file encrypted_domain/date/date_ord_ore_operators.sql ---! @brief Operators for public.eql_v3_date_ord_ore. +--! @brief Operators for public.{{prefix}}_date_ord_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = public.eql_v3_date_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = public.eql_v3_date_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = public.eql_v3_date_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = public.eql_v3_date_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = public.eql_v3_date_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = public.eql_v3_date_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = public.eql_v3_date_ord_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ore ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = public.eql_v3_date_ord_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ore ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ore + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ore ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ore + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ore ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = public.eql_v3_date_ord_ore + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ore ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ore + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ore ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = public.eql_v3_date_ord_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ore ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_date_ord_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_date_ord_ore ); diff --git a/packages/eql/src/v3/scalars/date/date_types.sql b/packages/eql/src/v3/scalars/date/date_types.sql index 88675a024..8ad3cb4ba 100644 --- a/packages/eql/src/v3/scalars/date/date_types.sql +++ b/packages/eql/src/v3/scalars/date/date_types.sql @@ -6,47 +6,47 @@ DO $$ BEGIN - --! @brief Encrypted domain public.eql_v3_date. + --! @brief Encrypted domain public.{{prefix}}_date. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_date' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_date' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_date AS jsonb + CREATE DOMAIN public.{{prefix}}_date AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_date IS 'EQL encrypted date (storage only)'; + COMMENT ON DOMAIN public.{{prefix}}_date IS 'EQL encrypted date (storage only)'; - --! @brief Encrypted domain public.eql_v3_date_eq. + --! @brief Encrypted domain public.{{prefix}}_date_eq. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_date_eq' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_date_eq' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_date_eq AS jsonb + CREATE DOMAIN public.{{prefix}}_date_eq AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'hm' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_date_eq IS 'EQL encrypted date (equality)'; + COMMENT ON DOMAIN public.{{prefix}}_date_eq IS 'EQL encrypted date (equality)'; - --! @brief Encrypted domain public.eql_v3_date_ord_ore. + --! @brief Encrypted domain public.{{prefix}}_date_ord_ore. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_date_ord_ore' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_date_ord_ore' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_date_ord_ore AS jsonb + CREATE DOMAIN public.{{prefix}}_date_ord_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -55,46 +55,46 @@ BEGIN AND VALUE ? 'ob' AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_date_ord_ore IS 'EQL encrypted date (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_date_ord_ore IS 'EQL encrypted date (equality, ordering)'; - --! @brief Encrypted domain public.eql_v3_date_ord. + --! @brief Encrypted domain public.{{prefix}}_date_ord. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_date_ord' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_date_ord' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_date_ord AS jsonb + CREATE DOMAIN public.{{prefix}}_date_ord AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'op' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_date_ord IS 'EQL encrypted date (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_date_ord IS 'EQL encrypted date (equality, ordering)'; - --! @brief Encrypted domain public.eql_v3_date_ord_ope. + --! @brief Encrypted domain public.{{prefix}}_date_ord_ope. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_date_ord_ope' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_date_ord_ope' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_date_ord_ope AS jsonb + CREATE DOMAIN public.{{prefix}}_date_ord_ope AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'op' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_date_ord_ope IS 'EQL encrypted date (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_date_ord_ope IS 'EQL encrypted date (equality, ordering)'; END $$; diff --git a/packages/eql/src/v3/scalars/date/json_entry_date_functions.sql b/packages/eql/src/v3/scalars/date/json_entry_date_functions.sql index afbaad93e..9e9f91635 100644 --- a/packages/eql/src/v3/scalars/date/json_entry_date_functions.sql +++ b/packages/eql/src/v3/scalars/date/json_entry_date_functions.sql @@ -5,340 +5,340 @@ -- REQUIRE: src/v3/scalars/date/query_date_types.sql --! @file encrypted_domain/date/json_entry_date_functions.sql ---! @brief Functions for public.eql_v3_json_entry. +--! @brief Functions for public.{{prefix}}_json_entry. ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_date_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_date_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json_entry, b eql_v3.query_date_ord) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json_entry, b {{prefix}}.query_date_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_date_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_date_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a eql_v3.query_date_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_date_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_date_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_date_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json_entry, b eql_v3.query_date_ord) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json_entry, b {{prefix}}.query_date_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_date_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_date_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a eql_v3.query_date_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_date_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_date_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_date_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_json_entry, b eql_v3.query_date_ord) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_date_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_date_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_date_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a eql_v3.query_date_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_date_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_date_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_date_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_json_entry, b eql_v3.query_date_ord) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_date_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_date_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_date_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a eql_v3.query_date_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_date_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_date_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_date_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_json_entry, b eql_v3.query_date_ord) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_date_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_date_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_date_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a eql_v3.query_date_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_date_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_date_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_date_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_json_entry, b eql_v3.query_date_ord) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_date_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_date_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_date_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a eql_v3.query_date_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_date_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_date_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_date_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json_entry, b eql_v3.query_date_ord_ope) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json_entry, b {{prefix}}.query_date_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_date_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_date_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a eql_v3.query_date_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_date_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_date_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json_entry, b eql_v3.query_date_ord_ope) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json_entry, b {{prefix}}.query_date_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_date_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_date_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a eql_v3.query_date_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_date_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_date_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_json_entry, b eql_v3.query_date_ord_ope) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_date_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_date_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_date_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a eql_v3.query_date_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_date_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_date_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_json_entry, b eql_v3.query_date_ord_ope) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_date_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_date_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_date_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a eql_v3.query_date_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_date_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_date_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_json_entry, b eql_v3.query_date_ord_ope) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_date_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_date_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_date_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a eql_v3.query_date_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_date_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_date_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_json_entry, b eql_v3.query_date_ord_ope) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_date_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_date_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_date_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a eql_v3.query_date_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/date/json_entry_date_operators.sql b/packages/eql/src/v3/scalars/date/json_entry_date_operators.sql index 21d15ef62..70cbcf9c8 100644 --- a/packages/eql/src/v3/scalars/date/json_entry_date_operators.sql +++ b/packages/eql/src/v3/scalars/date/json_entry_date_operators.sql @@ -5,124 +5,124 @@ -- REQUIRE: src/v3/scalars/date/json_entry_date_functions.sql --! @file encrypted_domain/date/json_entry_date_operators.sql ---! @brief Operators for public.eql_v3_json_entry. +--! @brief Operators for public.{{prefix}}_json_entry. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_date_ord + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_date_ord ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = eql_v3.query_date_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_date_ord + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_date_ord ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = eql_v3.query_date_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_date_ord + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_date_ord ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = eql_v3.query_date_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_date_ord + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_date_ord ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = eql_v3.query_date_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_date_ord + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_date_ord ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = eql_v3.query_date_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_date_ord + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_date_ord ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = eql_v3.query_date_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_date_ord_ope + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_date_ord_ope ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = eql_v3.query_date_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_date_ord_ope + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_date_ord_ope ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = eql_v3.query_date_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_date_ord_ope + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_date_ord_ope ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = eql_v3.query_date_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_date_ord_ope + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_date_ord_ope ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = eql_v3.query_date_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_date_ord_ope + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_date_ord_ope ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = eql_v3.query_date_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_date_ord_ope + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_date_ord_ope ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = eql_v3.query_date_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); diff --git a/packages/eql/src/v3/scalars/date/query_date_eq_functions.sql b/packages/eql/src/v3/scalars/date/query_date_eq_functions.sql index ca139e143..11dc75212 100644 --- a/packages/eql/src/v3/scalars/date/query_date_eq_functions.sql +++ b/packages/eql/src/v3/scalars/date/query_date_eq_functions.sql @@ -4,44 +4,44 @@ -- REQUIRE: src/v3/scalars/date/date_eq_functions.sql --! @file encrypted_domain/date/query_date_eq_functions.sql ---! @brief Functions for eql_v3.query_date_eq. +--! @brief Functions for {{prefix}}.query_date_eq. ---! @brief Index extractor for eql_v3.query_date_eq. ---! @param a eql_v3.query_date_eq ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a eql_v3.query_date_eq) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for {{prefix}}.query_date_eq. +--! @param a {{prefix}}.query_date_eq +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a {{prefix}}.query_date_eq) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_date_eq. ---! @param a public.eql_v3_date_eq ---! @param b eql_v3.query_date_eq +--! @brief Operator wrapper for {{prefix}}.query_date_eq. +--! @param a public.{{prefix}}_date_eq +--! @param b {{prefix}}.query_date_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_date_eq, b eql_v3.query_date_eq) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_eq, b {{prefix}}.query_date_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_eq. ---! @param a eql_v3.query_date_eq ---! @param b public.eql_v3_date_eq +--! @brief Operator wrapper for {{prefix}}.query_date_eq. +--! @param a {{prefix}}.query_date_eq +--! @param b public.{{prefix}}_date_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_date_eq, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_date_eq, b public.{{prefix}}_date_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_eq. ---! @param a public.eql_v3_date_eq ---! @param b eql_v3.query_date_eq +--! @brief Operator wrapper for {{prefix}}.query_date_eq. +--! @param a public.{{prefix}}_date_eq +--! @param b {{prefix}}.query_date_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_date_eq, b eql_v3.query_date_eq) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_eq, b {{prefix}}.query_date_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_eq. ---! @param a eql_v3.query_date_eq ---! @param b public.eql_v3_date_eq +--! @brief Operator wrapper for {{prefix}}.query_date_eq. +--! @param a {{prefix}}.query_date_eq +--! @param b public.{{prefix}}_date_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_date_eq, b public.eql_v3_date_eq) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_date_eq, b public.{{prefix}}_date_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; diff --git a/packages/eql/src/v3/scalars/date/query_date_eq_operators.sql b/packages/eql/src/v3/scalars/date/query_date_eq_operators.sql index 9fe762f09..fac95ee10 100644 --- a/packages/eql/src/v3/scalars/date/query_date_eq_operators.sql +++ b/packages/eql/src/v3/scalars/date/query_date_eq_operators.sql @@ -4,28 +4,28 @@ -- REQUIRE: src/v3/scalars/date/query_date_eq_functions.sql --! @file encrypted_domain/date/query_date_eq_operators.sql ---! @brief Operators for eql_v3.query_date_eq. +--! @brief Operators for {{prefix}}.query_date_eq. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_date_eq, RIGHTARG = eql_v3.query_date_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = {{prefix}}.query_date_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_date_eq, RIGHTARG = public.eql_v3_date_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_date_eq, RIGHTARG = public.{{prefix}}_date_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_date_eq, RIGHTARG = eql_v3.query_date_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = {{prefix}}.query_date_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_date_eq, RIGHTARG = public.eql_v3_date_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_date_eq, RIGHTARG = public.{{prefix}}_date_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); diff --git a/packages/eql/src/v3/scalars/date/query_date_ord_functions.sql b/packages/eql/src/v3/scalars/date/query_date_ord_functions.sql index ca717c325..856f51cea 100644 --- a/packages/eql/src/v3/scalars/date/query_date_ord_functions.sql +++ b/packages/eql/src/v3/scalars/date/query_date_ord_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/date/date_ord_functions.sql --! @file encrypted_domain/date/query_date_ord_functions.sql ---! @brief Functions for eql_v3.query_date_ord. +--! @brief Functions for {{prefix}}.query_date_ord. ---! @brief Index extractor for eql_v3.query_date_ord. ---! @param a eql_v3.query_date_ord ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a eql_v3.query_date_ord) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for {{prefix}}.query_date_ord. +--! @param a {{prefix}}.query_date_ord +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a {{prefix}}.query_date_ord) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord. ---! @param a public.eql_v3_date_ord ---! @param b eql_v3.query_date_ord +--! @brief Operator wrapper for {{prefix}}.query_date_ord. +--! @param a public.{{prefix}}_date_ord +--! @param b {{prefix}}.query_date_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_date_ord, b eql_v3.query_date_ord) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord. ---! @param a eql_v3.query_date_ord ---! @param b public.eql_v3_date_ord +--! @brief Operator wrapper for {{prefix}}.query_date_ord. +--! @param a {{prefix}}.query_date_ord +--! @param b public.{{prefix}}_date_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_date_ord, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord. ---! @param a public.eql_v3_date_ord ---! @param b eql_v3.query_date_ord +--! @brief Operator wrapper for {{prefix}}.query_date_ord. +--! @param a public.{{prefix}}_date_ord +--! @param b {{prefix}}.query_date_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_date_ord, b eql_v3.query_date_ord) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord. ---! @param a eql_v3.query_date_ord ---! @param b public.eql_v3_date_ord +--! @brief Operator wrapper for {{prefix}}.query_date_ord. +--! @param a {{prefix}}.query_date_ord +--! @param b public.{{prefix}}_date_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_date_ord, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord. ---! @param a public.eql_v3_date_ord ---! @param b eql_v3.query_date_ord +--! @brief Operator wrapper for {{prefix}}.query_date_ord. +--! @param a public.{{prefix}}_date_ord +--! @param b {{prefix}}.query_date_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_date_ord, b eql_v3.query_date_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord. ---! @param a eql_v3.query_date_ord ---! @param b public.eql_v3_date_ord +--! @brief Operator wrapper for {{prefix}}.query_date_ord. +--! @param a {{prefix}}.query_date_ord +--! @param b public.{{prefix}}_date_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_date_ord, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord. ---! @param a public.eql_v3_date_ord ---! @param b eql_v3.query_date_ord +--! @brief Operator wrapper for {{prefix}}.query_date_ord. +--! @param a public.{{prefix}}_date_ord +--! @param b {{prefix}}.query_date_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_date_ord, b eql_v3.query_date_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord. ---! @param a eql_v3.query_date_ord ---! @param b public.eql_v3_date_ord +--! @brief Operator wrapper for {{prefix}}.query_date_ord. +--! @param a {{prefix}}.query_date_ord +--! @param b public.{{prefix}}_date_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_date_ord, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord. ---! @param a public.eql_v3_date_ord ---! @param b eql_v3.query_date_ord +--! @brief Operator wrapper for {{prefix}}.query_date_ord. +--! @param a public.{{prefix}}_date_ord +--! @param b {{prefix}}.query_date_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_date_ord, b eql_v3.query_date_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord. ---! @param a eql_v3.query_date_ord ---! @param b public.eql_v3_date_ord +--! @brief Operator wrapper for {{prefix}}.query_date_ord. +--! @param a {{prefix}}.query_date_ord +--! @param b public.{{prefix}}_date_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_date_ord, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord. ---! @param a public.eql_v3_date_ord ---! @param b eql_v3.query_date_ord +--! @brief Operator wrapper for {{prefix}}.query_date_ord. +--! @param a public.{{prefix}}_date_ord +--! @param b {{prefix}}.query_date_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_date_ord, b eql_v3.query_date_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord. ---! @param a eql_v3.query_date_ord ---! @param b public.eql_v3_date_ord +--! @brief Operator wrapper for {{prefix}}.query_date_ord. +--! @param a {{prefix}}.query_date_ord +--! @param b public.{{prefix}}_date_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_date_ord, b public.eql_v3_date_ord) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/date/query_date_ord_ope_functions.sql b/packages/eql/src/v3/scalars/date/query_date_ord_ope_functions.sql index 12c031721..f8c65dff7 100644 --- a/packages/eql/src/v3/scalars/date/query_date_ord_ope_functions.sql +++ b/packages/eql/src/v3/scalars/date/query_date_ord_ope_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/date/date_ord_ope_functions.sql --! @file encrypted_domain/date/query_date_ord_ope_functions.sql ---! @brief Functions for eql_v3.query_date_ord_ope. +--! @brief Functions for {{prefix}}.query_date_ord_ope. ---! @brief Index extractor for eql_v3.query_date_ord_ope. ---! @param a eql_v3.query_date_ord_ope ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a eql_v3.query_date_ord_ope) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for {{prefix}}.query_date_ord_ope. +--! @param a {{prefix}}.query_date_ord_ope +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a {{prefix}}.query_date_ord_ope) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ope. ---! @param a public.eql_v3_date_ord_ope ---! @param b eql_v3.query_date_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. +--! @param a public.{{prefix}}_date_ord_ope +--! @param b {{prefix}}.query_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_date_ord_ope, b eql_v3.query_date_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ope. ---! @param a eql_v3.query_date_ord_ope ---! @param b public.eql_v3_date_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. +--! @param a {{prefix}}.query_date_ord_ope +--! @param b public.{{prefix}}_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_date_ord_ope, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ope. ---! @param a public.eql_v3_date_ord_ope ---! @param b eql_v3.query_date_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. +--! @param a public.{{prefix}}_date_ord_ope +--! @param b {{prefix}}.query_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_date_ord_ope, b eql_v3.query_date_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ope. ---! @param a eql_v3.query_date_ord_ope ---! @param b public.eql_v3_date_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. +--! @param a {{prefix}}.query_date_ord_ope +--! @param b public.{{prefix}}_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_date_ord_ope, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ope. ---! @param a public.eql_v3_date_ord_ope ---! @param b eql_v3.query_date_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. +--! @param a public.{{prefix}}_date_ord_ope +--! @param b {{prefix}}.query_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_date_ord_ope, b eql_v3.query_date_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ope. ---! @param a eql_v3.query_date_ord_ope ---! @param b public.eql_v3_date_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. +--! @param a {{prefix}}.query_date_ord_ope +--! @param b public.{{prefix}}_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_date_ord_ope, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ope. ---! @param a public.eql_v3_date_ord_ope ---! @param b eql_v3.query_date_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. +--! @param a public.{{prefix}}_date_ord_ope +--! @param b {{prefix}}.query_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_date_ord_ope, b eql_v3.query_date_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ope. ---! @param a eql_v3.query_date_ord_ope ---! @param b public.eql_v3_date_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. +--! @param a {{prefix}}.query_date_ord_ope +--! @param b public.{{prefix}}_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_date_ord_ope, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ope. ---! @param a public.eql_v3_date_ord_ope ---! @param b eql_v3.query_date_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. +--! @param a public.{{prefix}}_date_ord_ope +--! @param b {{prefix}}.query_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_date_ord_ope, b eql_v3.query_date_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ope. ---! @param a eql_v3.query_date_ord_ope ---! @param b public.eql_v3_date_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. +--! @param a {{prefix}}.query_date_ord_ope +--! @param b public.{{prefix}}_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_date_ord_ope, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ope. ---! @param a public.eql_v3_date_ord_ope ---! @param b eql_v3.query_date_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. +--! @param a public.{{prefix}}_date_ord_ope +--! @param b {{prefix}}.query_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_date_ord_ope, b eql_v3.query_date_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ope. ---! @param a eql_v3.query_date_ord_ope ---! @param b public.eql_v3_date_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. +--! @param a {{prefix}}.query_date_ord_ope +--! @param b public.{{prefix}}_date_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_date_ord_ope, b public.eql_v3_date_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/date/query_date_ord_ope_operators.sql b/packages/eql/src/v3/scalars/date/query_date_ord_ope_operators.sql index 02b85da2b..c1de6b14c 100644 --- a/packages/eql/src/v3/scalars/date/query_date_ord_ope_operators.sql +++ b/packages/eql/src/v3/scalars/date/query_date_ord_ope_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/date/query_date_ord_ope_functions.sql --! @file encrypted_domain/date/query_date_ord_ope_operators.sql ---! @brief Operators for eql_v3.query_date_ord_ope. +--! @brief Operators for {{prefix}}.query_date_ord_ope. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = eql_v3.query_date_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_date_ord_ope, RIGHTARG = public.eql_v3_date_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = eql_v3.query_date_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_date_ord_ope, RIGHTARG = public.eql_v3_date_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = eql_v3.query_date_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_date_ord_ope, RIGHTARG = public.eql_v3_date_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = eql_v3.query_date_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_date_ord_ope, RIGHTARG = public.eql_v3_date_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = eql_v3.query_date_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_date_ord_ope, RIGHTARG = public.eql_v3_date_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_date_ord_ope, RIGHTARG = eql_v3.query_date_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_date_ord_ope, RIGHTARG = public.eql_v3_date_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/date/query_date_ord_operators.sql b/packages/eql/src/v3/scalars/date/query_date_ord_operators.sql index 94d0cdf44..c555e1b20 100644 --- a/packages/eql/src/v3/scalars/date/query_date_ord_operators.sql +++ b/packages/eql/src/v3/scalars/date/query_date_ord_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/date/query_date_ord_functions.sql --! @file encrypted_domain/date/query_date_ord_operators.sql ---! @brief Operators for eql_v3.query_date_ord. +--! @brief Operators for {{prefix}}.query_date_ord. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = eql_v3.query_date_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_date_ord, RIGHTARG = public.eql_v3_date_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = eql_v3.query_date_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_date_ord, RIGHTARG = public.eql_v3_date_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = eql_v3.query_date_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_date_ord, RIGHTARG = public.eql_v3_date_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = eql_v3.query_date_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_date_ord, RIGHTARG = public.eql_v3_date_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = eql_v3.query_date_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_date_ord, RIGHTARG = public.eql_v3_date_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_date_ord, RIGHTARG = eql_v3.query_date_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_date_ord, RIGHTARG = public.eql_v3_date_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/date/query_date_ord_ore_functions.sql b/packages/eql/src/v3/scalars/date/query_date_ord_ore_functions.sql index d2a155a4f..c06aebf87 100644 --- a/packages/eql/src/v3/scalars/date/query_date_ord_ore_functions.sql +++ b/packages/eql/src/v3/scalars/date/query_date_ord_ore_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/date/date_ord_ore_functions.sql --! @file encrypted_domain/date/query_date_ord_ore_functions.sql ---! @brief Functions for eql_v3.query_date_ord_ore. +--! @brief Functions for {{prefix}}.query_date_ord_ore. ---! @brief Index extractor for eql_v3.query_date_ord_ore. ---! @param a eql_v3.query_date_ord_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a eql_v3.query_date_ord_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for {{prefix}}.query_date_ord_ore. +--! @param a {{prefix}}.query_date_ord_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a {{prefix}}.query_date_ord_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ore. ---! @param a public.eql_v3_date_ord_ore ---! @param b eql_v3.query_date_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. +--! @param a public.{{prefix}}_date_ord_ore +--! @param b {{prefix}}.query_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_date_ord_ore, b eql_v3.query_date_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ore. ---! @param a eql_v3.query_date_ord_ore ---! @param b public.eql_v3_date_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. +--! @param a {{prefix}}.query_date_ord_ore +--! @param b public.{{prefix}}_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_date_ord_ore, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ore. ---! @param a public.eql_v3_date_ord_ore ---! @param b eql_v3.query_date_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. +--! @param a public.{{prefix}}_date_ord_ore +--! @param b {{prefix}}.query_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_date_ord_ore, b eql_v3.query_date_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ore. ---! @param a eql_v3.query_date_ord_ore ---! @param b public.eql_v3_date_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. +--! @param a {{prefix}}.query_date_ord_ore +--! @param b public.{{prefix}}_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_date_ord_ore, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ore. ---! @param a public.eql_v3_date_ord_ore ---! @param b eql_v3.query_date_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. +--! @param a public.{{prefix}}_date_ord_ore +--! @param b {{prefix}}.query_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_date_ord_ore, b eql_v3.query_date_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ore. ---! @param a eql_v3.query_date_ord_ore ---! @param b public.eql_v3_date_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. +--! @param a {{prefix}}.query_date_ord_ore +--! @param b public.{{prefix}}_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_date_ord_ore, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ore. ---! @param a public.eql_v3_date_ord_ore ---! @param b eql_v3.query_date_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. +--! @param a public.{{prefix}}_date_ord_ore +--! @param b {{prefix}}.query_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_date_ord_ore, b eql_v3.query_date_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ore. ---! @param a eql_v3.query_date_ord_ore ---! @param b public.eql_v3_date_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. +--! @param a {{prefix}}.query_date_ord_ore +--! @param b public.{{prefix}}_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_date_ord_ore, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ore. ---! @param a public.eql_v3_date_ord_ore ---! @param b eql_v3.query_date_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. +--! @param a public.{{prefix}}_date_ord_ore +--! @param b {{prefix}}.query_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_date_ord_ore, b eql_v3.query_date_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ore. ---! @param a eql_v3.query_date_ord_ore ---! @param b public.eql_v3_date_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. +--! @param a {{prefix}}.query_date_ord_ore +--! @param b public.{{prefix}}_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_date_ord_ore, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ore. ---! @param a public.eql_v3_date_ord_ore ---! @param b eql_v3.query_date_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. +--! @param a public.{{prefix}}_date_ord_ore +--! @param b {{prefix}}.query_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_date_ord_ore, b eql_v3.query_date_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_date_ord_ore. ---! @param a eql_v3.query_date_ord_ore ---! @param b public.eql_v3_date_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. +--! @param a {{prefix}}.query_date_ord_ore +--! @param b public.{{prefix}}_date_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_date_ord_ore, b public.eql_v3_date_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; diff --git a/packages/eql/src/v3/scalars/date/query_date_ord_ore_operators.sql b/packages/eql/src/v3/scalars/date/query_date_ord_ore_operators.sql index 06b065845..4e22bab87 100644 --- a/packages/eql/src/v3/scalars/date/query_date_ord_ore_operators.sql +++ b/packages/eql/src/v3/scalars/date/query_date_ord_ore_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/date/query_date_ord_ore_functions.sql --! @file encrypted_domain/date/query_date_ord_ore_operators.sql ---! @brief Operators for eql_v3.query_date_ord_ore. +--! @brief Operators for {{prefix}}.query_date_ord_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = eql_v3.query_date_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_date_ord_ore, RIGHTARG = public.eql_v3_date_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = eql_v3.query_date_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_date_ord_ore, RIGHTARG = public.eql_v3_date_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = eql_v3.query_date_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_date_ord_ore, RIGHTARG = public.eql_v3_date_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = eql_v3.query_date_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_date_ord_ore, RIGHTARG = public.eql_v3_date_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = eql_v3.query_date_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_date_ord_ore, RIGHTARG = public.eql_v3_date_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_date_ord_ore, RIGHTARG = eql_v3.query_date_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_date_ord_ore, RIGHTARG = public.eql_v3_date_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/date/query_date_range_functions.sql b/packages/eql/src/v3/scalars/date/query_date_range_functions.sql new file mode 100644 index 000000000..840e33f1b --- /dev/null +++ b/packages/eql/src/v3/scalars/date/query_date_range_functions.sql @@ -0,0 +1,177 @@ +-- AUTOMATICALLY GENERATED FILE. +-- ONLY EQL VERSION: 4 +-- REQUIRE: src/v3/schema.sql +-- REQUIRE: src/v3/scalars/date/query_date_range_types.sql +-- REQUIRE: src/v3/scalars/date/date_ord_ore_functions.sql +-- REQUIRE: src/v3/scalars/date/date_ord_functions.sql +-- REQUIRE: src/v3/scalars/date/date_ord_ope_functions.sql +-- REQUIRE: src/v3/sem/ore_block_256/functions.sql +-- REQUIRE: src/v3/sem/ore_block_256/operators.sql +-- REQUIRE: src/v3/sem/ope_cllw/functions.sql + +--! @file v3/scalars/date/query_date_range_functions.sql +--! @brief The bound accessors and `{{prefix}}.between` for date's range query domains. +--! @note EQL version {{eql_version}} only, like the range domains themselves. + +--! @brief The low bound of a {{prefix}}.query_date_range_ore, as a block ORE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_date_range_ore Range query operand +--! @return {{prefix}}_internal.ore_block_256 The low bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.lo(r {{prefix}}.query_date_range_ore) +RETURNS {{prefix}}_internal.ore_block_256 +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ore_block_256(jsonb_build_object('ob', r::jsonb -> 'lo')) $$; + +--! @brief The high bound of a {{prefix}}.query_date_range_ore, as a block ORE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_date_range_ore Range query operand +--! @return {{prefix}}_internal.ore_block_256 The high bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.hi(r {{prefix}}.query_date_range_ore) +RETURNS {{prefix}}_internal.ore_block_256 +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ore_block_256(jsonb_build_object('ob', r::jsonb -> 'hi')) $$; + +--! @brief The low bound of a {{prefix}}.query_date_range_ope, as a CLLW OPE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_date_range_ope Range query operand +--! @return {{prefix}}_internal.ope_cllw The low bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.lo(r {{prefix}}.query_date_range_ope) +RETURNS {{prefix}}_internal.ope_cllw +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> 'lo')) $$; + +--! @brief The high bound of a {{prefix}}.query_date_range_ope, as a CLLW OPE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_date_range_ope Range query operand +--! @return {{prefix}}_internal.ope_cllw The high bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.hi(r {{prefix}}.query_date_range_ope) +RETURNS {{prefix}}_internal.ope_cllw +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> 'hi')) $$; + +--! @brief Whether a public.{{prefix}}_date_ord_ore value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_date_range_ore)`. +--! +--! @param a public.{{prefix}}_date_ord_ore Encrypted column value +--! @param r {{prefix}}.query_date_range_ore Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term_ore(a)`, which a btree index on that expression +--! serves as one range scan. For this ORE range that index needs the +--! default btree operator class on {{prefix}}_internal.ore_block_256, which the +--! installer creates only with superuser privileges. Without it (on Supabase, +--! for instance) the installer disables the ORE column domains and this ORE range, +--! so use an OPE column (`public.{{prefix}}_date_ord`, `public.{{prefix}}_date_ord_ope`) +--! and `{{prefix}}.query_date_range_ope`, which index everywhere. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_date_range_ore`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_date_ord_ore, r {{prefix}}.query_date_range_ore) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_date_ord value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_date_range_ope)`. +--! +--! @param a public.{{prefix}}_date_ord Encrypted column value +--! @param r {{prefix}}.query_date_range_ope Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term(a)`, which a btree index on that expression +--! serves as one range scan. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_date_range_ope`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_date_ord, r {{prefix}}.query_date_range_ope) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_date_ord_ope value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_date_range_ope)`. +--! +--! @param a public.{{prefix}}_date_ord_ope Encrypted column value +--! @param r {{prefix}}.query_date_range_ope Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term(a)`, which a btree index on that expression +--! serves as one range scan. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_date_range_ope`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_date_ord_ope, r {{prefix}}.query_date_range_ope) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r) $$; diff --git a/packages/eql/src/v3/scalars/date/query_date_range_types.sql b/packages/eql/src/v3/scalars/date/query_date_range_types.sql new file mode 100644 index 000000000..31ec74c6a --- /dev/null +++ b/packages/eql/src/v3/scalars/date/query_date_range_types.sql @@ -0,0 +1,107 @@ +-- AUTOMATICALLY GENERATED FILE. +-- ONLY EQL VERSION: 4 +-- REQUIRE: src/v3/schema.sql +-- REQUIRE: src/v3/scalars/ore_fallback.sql + +--! @file v3/scalars/date/query_date_range_types.sql +--! @brief Range query-operand domains for date: the operand of `{{prefix}}.between`. +--! @note A range holds both bounds of one `BETWEEN` as one value: +--! `{"v": {{eql_version}}, "i": {...}, "lo": , "hi": }`. Each bound is the +--! single-bound query domain's `ob` (ORE) or `op` (OPE) value, in a +--! `{v, i, lo, hi}` envelope. Both bounds are included. There is one +--! range domain per ordering term the family stores (ADR-0009, +--! decisions 7 and 8). +--! @note Cast the range parameter to its exact range domain +--! (`$1::{{prefix}}.query_date_range_ore`). An uncast `$1`, a `jsonb` +--! parameter, or a range of another term or family fails with 42725 +--! ("function ... is not unique"); see `{{prefix}}.between`. +--! @note EQL version {{eql_version}} only: the `-- ONLY EQL VERSION:` line above keeps this +--! file out of every other version's installer. +--! @note Like every query operand, a range lives in `{{prefix}}`, not `public`, +--! and holds no ciphertext `c`. A range whose low bound is above its +--! high bound matches no row, as with SQL `BETWEEN`; the SQL does not +--! reorder the bounds. +--! @note On an install without the ORE operator class (a non-superuser +--! install, on Supabase for instance), the ORE range domain is disabled +--! as the single-bound ORE domains are: a value cast to it raises +--! `feature_not_supported`, naming the OPE range. See +--! `v3/scalars/ore_fallback.sql`. + +DO $$ +BEGIN + --! @brief Range query-operand domain {{prefix}}.query_date_range_ore (two block ORE bounds; no `c`). + IF NOT EXISTS ( + SELECT 1 FROM pg_type + WHERE typname = 'query_date_range_ore' AND typnamespace = '{{prefix}}'::regnamespace + ) THEN + CREATE DOMAIN {{prefix}}.query_date_range_ore AS jsonb + CHECK ( + jsonb_typeof(VALUE) = 'object' + AND VALUE ? 'v' + AND VALUE ? 'i' + AND VALUE ? 'lo' + AND VALUE ? 'hi' + AND NOT (VALUE ? 'c') + AND jsonb_typeof(VALUE -> 'lo') = 'array' + AND jsonb_array_length(VALUE -> 'lo') > 0 + AND jsonb_typeof(VALUE -> 'hi') = 'array' + AND jsonb_array_length(VALUE -> 'hi') > 0 + -- `"v": null` makes the comparison NULL, and a CHECK that is NULL + -- passes, so COALESCE refuses it. A NULL range still passes (no row + -- matches it). The comparison keeps the one form the v4 isolation + -- gate accepts. + AND COALESCE(VALUE->>'v' = '{{eql_version}}', VALUE IS NULL) + ); + END IF; + + COMMENT ON DOMAIN {{prefix}}.query_date_range_ore IS 'EQL date range query operand (block ORE)'; + + --! @brief Range query-operand domain {{prefix}}.query_date_range_ope (two CLLW OPE bounds; no `c`). + IF NOT EXISTS ( + SELECT 1 FROM pg_type + WHERE typname = 'query_date_range_ope' AND typnamespace = '{{prefix}}'::regnamespace + ) THEN + CREATE DOMAIN {{prefix}}.query_date_range_ope AS jsonb + CHECK ( + jsonb_typeof(VALUE) = 'object' + AND VALUE ? 'v' + AND VALUE ? 'i' + AND VALUE ? 'lo' + AND VALUE ? 'hi' + AND NOT (VALUE ? 'c') + AND jsonb_typeof(VALUE -> 'lo') = 'string' + AND jsonb_typeof(VALUE -> 'hi') = 'string' + -- `"v": null` makes the comparison NULL, and a CHECK that is NULL + -- passes, so COALESCE refuses it. A NULL range still passes (no row + -- matches it). The comparison keeps the one form the v4 isolation + -- gate accepts. + AND COALESCE(VALUE->>'v' = '{{eql_version}}', VALUE IS NULL) + ); + END IF; + + COMMENT ON DOMAIN {{prefix}}.query_date_range_ope IS 'EQL date range query operand (CLLW OPE)'; +END +$$; + +-- Without the default btree operator class on {{prefix}}_internal.ore_block_256 +-- (the installer skips it on insufficient_privilege), ore_fallback.sql has +-- created {{prefix}}_internal.ore_domain_unavailable and poisoned the +-- single-bound ORE domains. It cannot reach this ORE range, which exists in +-- EQL v4 only, so the same NOT VALID poison CHECK is added here. +DO $do$ +BEGIN + IF EXISTS ( + SELECT 1 + FROM pg_catalog.pg_opclass c + JOIN pg_catalog.pg_am am ON am.oid = c.opcmethod + WHERE am.amname = 'btree' + AND c.opcdefault + AND c.opcintype = '{{prefix}}_internal.ore_block_256'::pg_catalog.regtype + ) THEN + RETURN; + END IF; + + ALTER DOMAIN {{prefix}}.query_date_range_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, '{{prefix}}.query_date_range_ore', '{{prefix}}.query_date_range_ope (range)')) NOT VALID; +END; +$do$; diff --git a/packages/eql/src/v3/scalars/date/query_date_types.sql b/packages/eql/src/v3/scalars/date/query_date_types.sql index 68b3bae1d..1f2f4edbf 100644 --- a/packages/eql/src/v3/scalars/date/query_date_types.sql +++ b/packages/eql/src/v3/scalars/date/query_date_types.sql @@ -3,41 +3,41 @@ --! @file v3/scalars/date/query_date_types.sql --! @brief Query-operand domains for date (index-terms-only, no ciphertext). ---! @note Query-operand domains live in `eql_v3` (not `public`): they are +--! @note Query-operand domains live in `{{prefix}}` (not `public`): they are --! never valid column types, so they don't belong in the column-type --! namespace, and dropping the EQL-owned schema can never drop an --! application column. --! @note Cast a query operand explicitly to its `query_` domain in a predicate ---! (e.g. `WHERE col = $1::eql_v3.query_date_eq`). A bare, +--! (e.g. `WHERE col = $1::{{prefix}}.query_date_eq`). A bare, --! uncast literal RHS is ambiguous between the `query_` and `jsonb` --! operator overloads and will not resolve. DO $$ BEGIN - --! @brief Query-operand domain eql_v3.query_date_eq (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_date_eq (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_date_eq' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_date_eq' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_date_eq AS jsonb + CREATE DOMAIN {{prefix}}.query_date_eq AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'hm' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_date_eq IS 'EQL date query operand (equality)'; + COMMENT ON DOMAIN {{prefix}}.query_date_eq IS 'EQL date query operand (equality)'; - --! @brief Query-operand domain eql_v3.query_date_ord_ore (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_date_ord_ore (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_date_ord_ore' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_date_ord_ore' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_date_ord_ore AS jsonb + CREATE DOMAIN {{prefix}}.query_date_ord_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -46,46 +46,46 @@ BEGIN AND NOT (VALUE ? 'c') AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_date_ord_ore IS 'EQL date query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_date_ord_ore IS 'EQL date query operand (equality, ordering)'; - --! @brief Query-operand domain eql_v3.query_date_ord (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_date_ord (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_date_ord' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_date_ord' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_date_ord AS jsonb + CREATE DOMAIN {{prefix}}.query_date_ord AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'op' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_date_ord IS 'EQL date query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_date_ord IS 'EQL date query operand (equality, ordering)'; - --! @brief Query-operand domain eql_v3.query_date_ord_ope (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_date_ord_ope (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_date_ord_ope' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_date_ord_ope' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_date_ord_ope AS jsonb + CREATE DOMAIN {{prefix}}.query_date_ord_ope AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'op' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_date_ord_ope IS 'EQL date query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_date_ord_ope IS 'EQL date query operand (equality, ordering)'; END $$; diff --git a/packages/eql/src/v3/scalars/double/double_eq_functions.sql b/packages/eql/src/v3/scalars/double/double_eq_functions.sql index 49b33c2f6..597bb5b4e 100644 --- a/packages/eql/src/v3/scalars/double/double_eq_functions.sql +++ b/packages/eql/src/v3/scalars/double/double_eq_functions.sql @@ -5,634 +5,634 @@ -- REQUIRE: src/v3/sem/hmac_256/functions.sql --! @file encrypted_domain/double/double_eq_functions.sql ---! @brief Functions for public.eql_v3_double_eq. +--! @brief Functions for public.{{prefix}}_double_eq. ---! @brief Index extractor for public.eql_v3_double_eq. ---! @param a public.eql_v3_double_eq ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a public.eql_v3_double_eq) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for public.{{prefix}}_double_eq. +--! @param a public.{{prefix}}_double_eq +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a public.{{prefix}}_double_eq) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_double_eq. ---! @param a public.eql_v3_double_eq ---! @param b public.eql_v3_double_eq +--! @brief Operator wrapper for public.{{prefix}}_double_eq. +--! @param a public.{{prefix}}_double_eq +--! @param b public.{{prefix}}_double_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_double_eq, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_eq, b public.{{prefix}}_double_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_eq. ---! @param a public.eql_v3_double_eq +--! @brief Operator wrapper for public.{{prefix}}_double_eq. +--! @param a public.{{prefix}}_double_eq --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_double_eq, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b::public.eql_v3_double_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_double_eq) $$; ---! @brief Operator wrapper for public.eql_v3_double_eq. +--! @brief Operator wrapper for public.{{prefix}}_double_eq. --! @param a jsonb ---! @param b public.eql_v3_double_eq +--! @param b public.{{prefix}}_double_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_double_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_double_eq) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_double_eq) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_eq. ---! @param a public.eql_v3_double_eq ---! @param b public.eql_v3_double_eq +--! @brief Operator wrapper for public.{{prefix}}_double_eq. +--! @param a public.{{prefix}}_double_eq +--! @param b public.{{prefix}}_double_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_double_eq, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_eq, b public.{{prefix}}_double_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_eq. ---! @param a public.eql_v3_double_eq +--! @brief Operator wrapper for public.{{prefix}}_double_eq. +--! @param a public.{{prefix}}_double_eq --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_double_eq, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b::public.eql_v3_double_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_double_eq) $$; ---! @brief Operator wrapper for public.eql_v3_double_eq. +--! @brief Operator wrapper for public.{{prefix}}_double_eq. --! @param a jsonb ---! @param b public.eql_v3_double_eq +--! @param b public.{{prefix}}_double_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_double_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_double_eq) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_double_eq) <> {{prefix}}.eq_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator ---! @param b public.eql_v3_double_eq right operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator +--! @param b public.{{prefix}}_double_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_double_eq, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_double_eq, b public.{{prefix}}_double_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_double_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_double_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_eq right operand of the blocked operator +--! @param b public.{{prefix}}_double_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_double_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator ---! @param b public.eql_v3_double_eq right operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator +--! @param b public.{{prefix}}_double_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_double_eq, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_double_eq, b public.{{prefix}}_double_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_double_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_double_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_eq right operand of the blocked operator +--! @param b public.{{prefix}}_double_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_double_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator ---! @param b public.eql_v3_double_eq right operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator +--! @param b public.{{prefix}}_double_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_double_eq, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_double_eq, b public.{{prefix}}_double_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_double_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_double_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_eq right operand of the blocked operator +--! @param b public.{{prefix}}_double_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_double_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator ---! @param b public.eql_v3_double_eq right operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator +--! @param b public.{{prefix}}_double_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_double_eq, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_double_eq, b public.{{prefix}}_double_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_double_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_double_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_eq right operand of the blocked operator +--! @param b public.{{prefix}}_double_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_double_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator ---! @param b public.eql_v3_double_eq right operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator +--! @param b public.{{prefix}}_double_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_double_eq, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_double_eq, b public.{{prefix}}_double_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_double_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_double_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_eq right operand of the blocked operator +--! @param b public.{{prefix}}_double_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_double_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator ---! @param b public.eql_v3_double_eq right operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator +--! @param b public.{{prefix}}_double_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_double_eq, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_double_eq, b public.{{prefix}}_double_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_double_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_double_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_eq right operand of the blocked operator +--! @param b public.{{prefix}}_double_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_double_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_double_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_double_eq, selector text) -RETURNS public.eql_v3_double_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_double_eq'; END; $$ +--! @return public.{{prefix}}_double_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_double_eq, selector text) +RETURNS public.{{prefix}}_double_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_double_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_double_eq, selector integer) -RETURNS public.eql_v3_double_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_double_eq'; END; $$ +--! @return public.{{prefix}}_double_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_double_eq, selector integer) +RETURNS public.{{prefix}}_double_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_double_eq right operand of the blocked operator ---! @return public.eql_v3_double_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_double_eq) -RETURNS public.eql_v3_double_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_double_eq'; END; $$ +--! @param selector public.{{prefix}}_double_eq right operand of the blocked operator +--! @return public.{{prefix}}_double_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_double_eq) +RETURNS public.{{prefix}}_double_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_double_eq, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_double_eq, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_double_eq, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_double_eq, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_double_eq right operand of the blocked operator +--! @param selector public.{{prefix}}_double_eq right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_double_eq) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_double_eq, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_double_eq, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_double_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_double_eq, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_double_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_double_eq, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_double_eq, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_double_eq, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator ---! @param b public.eql_v3_double_eq right operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator +--! @param b public.{{prefix}}_double_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_double_eq, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_double_eq, b public.{{prefix}}_double_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_double_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_double_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_eq right operand of the blocked operator +--! @param b public.{{prefix}}_double_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_double_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_double_eq, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_double_eq, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_double_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_double_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_double_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_double_eq, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_double_eq, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_double_eq, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_double_eq, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_double_eq, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_double_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_double_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_double_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_double_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator ---! @param b public.eql_v3_double_eq right operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator +--! @param b public.{{prefix}}_double_eq right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_double_eq, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_double_eq, b public.{{prefix}}_double_eq) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_eq left operand of the blocked operator +--! @param a public.{{prefix}}_double_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_double_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_double_eq, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_eq right operand of the blocked operator +--! @param b public.{{prefix}}_double_eq right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_double_eq) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_double_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_double_eq'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/double/double_eq_operators.sql b/packages/eql/src/v3/scalars/double/double_eq_operators.sql index 46d0ae5e6..131bc0ab4 100644 --- a/packages/eql/src/v3/scalars/double/double_eq_operators.sql +++ b/packages/eql/src/v3/scalars/double/double_eq_operators.sql @@ -4,245 +4,245 @@ -- REQUIRE: src/v3/scalars/double/double_eq_functions.sql --! @file encrypted_domain/double/double_eq_operators.sql ---! @brief Operators for public.eql_v3_double_eq. +--! @brief Operators for public.{{prefix}}_double_eq. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_double_eq, RIGHTARG = public.eql_v3_double_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = public.{{prefix}}_double_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_double_eq, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_double_eq, RIGHTARG = public.eql_v3_double_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = public.{{prefix}}_double_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_double_eq, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_double_eq, RIGHTARG = public.eql_v3_double_eq + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = public.{{prefix}}_double_eq ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_double_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_eq + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_eq ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_double_eq, RIGHTARG = public.eql_v3_double_eq + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = public.{{prefix}}_double_eq ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_double_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_eq + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_eq ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_double_eq, RIGHTARG = public.eql_v3_double_eq + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = public.{{prefix}}_double_eq ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_double_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_eq + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_eq ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_double_eq, RIGHTARG = public.eql_v3_double_eq + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = public.{{prefix}}_double_eq ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_double_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_eq + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_eq ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_double_eq, RIGHTARG = public.eql_v3_double_eq + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = public.{{prefix}}_double_eq ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_double_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_eq + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_eq ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_double_eq, RIGHTARG = public.eql_v3_double_eq + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = public.{{prefix}}_double_eq ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_double_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_eq + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_eq ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_double_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_double_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_eq + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_eq ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_double_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_double_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_eq + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_eq ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_double_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_double_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_double_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_double_eq, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_double_eq, RIGHTARG = public.eql_v3_double_eq + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = public.{{prefix}}_double_eq ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_double_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_eq + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_eq ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_double_eq, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_double_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_double_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_double_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_double_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_double_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_double_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_double_eq, RIGHTARG = public.eql_v3_double_eq + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = public.{{prefix}}_double_eq ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_double_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_eq + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_eq ); diff --git a/packages/eql/src/v3/scalars/double/double_functions.sql b/packages/eql/src/v3/scalars/double/double_functions.sql index 80a425549..ea3964722 100644 --- a/packages/eql/src/v3/scalars/double/double_functions.sql +++ b/packages/eql/src/v3/scalars/double/double_functions.sql @@ -4,662 +4,662 @@ -- REQUIRE: src/v3/scalars/functions.sql --! @file encrypted_domain/double/double_functions.sql ---! @brief Functions for public.eql_v3_double. +--! @brief Functions for public.{{prefix}}_double. ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_double, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_double, b public.{{prefix}}_double) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_double, b jsonb) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_double, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a jsonb, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal.eq(a jsonb, b public.{{prefix}}_double) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_double, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_double, b public.{{prefix}}_double) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_double, b jsonb) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_double, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a jsonb, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal.neq(a jsonb, b public.{{prefix}}_double) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_double, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_double, b public.{{prefix}}_double) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_double, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_double, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_double) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_double, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_double, b public.{{prefix}}_double) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_double, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_double, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_double) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_double, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_double, b public.{{prefix}}_double) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_double, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_double, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_double) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_double, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_double, b public.{{prefix}}_double) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_double, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_double, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_double) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_double, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_double, b public.{{prefix}}_double) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_double, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_double, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_double) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_double, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_double, b public.{{prefix}}_double) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_double, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_double, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_double) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_double never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_double, selector text) -RETURNS public.eql_v3_double IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_double'; END; $$ +--! @return public.{{prefix}}_double never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_double, selector text) +RETURNS public.{{prefix}}_double IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_double never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_double, selector integer) -RETURNS public.eql_v3_double IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_double'; END; $$ +--! @return public.{{prefix}}_double never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_double, selector integer) +RETURNS public.{{prefix}}_double IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_double right operand of the blocked operator ---! @return public.eql_v3_double never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_double) -RETURNS public.eql_v3_double IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_double'; END; $$ +--! @param selector public.{{prefix}}_double right operand of the blocked operator +--! @return public.{{prefix}}_double never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_double) +RETURNS public.{{prefix}}_double IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_double, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_double, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_double, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_double, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_double right operand of the blocked operator +--! @param selector public.{{prefix}}_double right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_double) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_double, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_double, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_double, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_double, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_double, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_double, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_double, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_double, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_double, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_double, b public.{{prefix}}_double) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_double, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_double, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_double) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_double, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_double, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_double, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_double, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_double, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_double, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_double, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_double, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_double, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_double, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_double, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_double, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_double, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_double, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_double, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_double, b public.{{prefix}}_double) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double left operand of the blocked operator +--! @param a public.{{prefix}}_double left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_double, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_double, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double. +--! @brief Unsupported operator blocker for public.{{prefix}}_double. --! ---! Intercepts an operator that is not supported on public.eql_v3_double and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double right operand of the blocked operator +--! @param b public.{{prefix}}_double right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_double) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_double) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_double'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_double'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/double/double_operators.sql b/packages/eql/src/v3/scalars/double/double_operators.sql index 4e8da085a..84a00a710 100644 --- a/packages/eql/src/v3/scalars/double/double_operators.sql +++ b/packages/eql/src/v3/scalars/double/double_operators.sql @@ -4,239 +4,239 @@ -- REQUIRE: src/v3/scalars/double/double_functions.sql --! @file encrypted_domain/double/double_operators.sql ---! @brief Operators for public.eql_v3_double. +--! @brief Operators for public.{{prefix}}_double. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_double, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_double, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_double, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_double, RIGHTARG = jsonb ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_double, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_double, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_double, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_double, RIGHTARG = jsonb ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_double, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_double, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_double, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_double, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_double, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_double, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_double, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_double, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_double, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_double, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_double, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_double, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_double, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_double, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_double, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_double, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_double, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_double, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_double, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_double, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_double, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_double, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_double, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_double, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_double, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_double, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_double, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_double, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_double, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_double, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_double, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_double, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_double, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_double, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_double, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_double, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_double, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_double, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_double, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_double, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_double, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_double, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_double, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_double, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_double, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_double, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_double, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_double, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_double, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_double, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_double, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_double, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_double, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_double, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_double, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_double, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_double, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_double, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_double, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_double, RIGHTARG = public.{{prefix}}_double ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_double, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_double, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double ); diff --git a/packages/eql/src/v3/scalars/double/double_ord_aggregates.sql b/packages/eql/src/v3/scalars/double/double_ord_aggregates.sql index 3314ab536..d7b1b04cf 100644 --- a/packages/eql/src/v3/scalars/double/double_ord_aggregates.sql +++ b/packages/eql/src/v3/scalars/double/double_ord_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/double/double_ord_operators.sql --! @file encrypted_domain/double/double_ord_aggregates.sql ---! @brief Aggregates for public.eql_v3_double_ord. +--! @brief Aggregates for public.{{prefix}}_double_ord. ---! @brief State function for min on public.eql_v3_double_ord. ---! @param state public.eql_v3_double_ord ---! @param value public.eql_v3_double_ord ---! @return public.eql_v3_double_ord -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_double_ord, value public.eql_v3_double_ord) -RETURNS public.eql_v3_double_ord +--! @brief State function for min on public.{{prefix}}_double_ord. +--! @param state public.{{prefix}}_double_ord +--! @param value public.{{prefix}}_double_ord +--! @return public.{{prefix}}_double_ord +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_double_ord, value public.{{prefix}}_double_ord) +RETURNS public.{{prefix}}_double_ord LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_double_ord. ---! @param input public.eql_v3_double_ord ---! @return public.eql_v3_double_ord -CREATE AGGREGATE eql_v3.min(public.eql_v3_double_ord) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_double_ord, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_double_ord. +--! @param input public.{{prefix}}_double_ord +--! @return public.{{prefix}}_double_ord +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_double_ord) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_double_ord, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_double_ord. ---! @param state public.eql_v3_double_ord ---! @param value public.eql_v3_double_ord ---! @return public.eql_v3_double_ord -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_double_ord, value public.eql_v3_double_ord) -RETURNS public.eql_v3_double_ord +--! @brief State function for max on public.{{prefix}}_double_ord. +--! @param state public.{{prefix}}_double_ord +--! @param value public.{{prefix}}_double_ord +--! @return public.{{prefix}}_double_ord +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_double_ord, value public.{{prefix}}_double_ord) +RETURNS public.{{prefix}}_double_ord LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_double_ord. ---! @param input public.eql_v3_double_ord ---! @return public.eql_v3_double_ord -CREATE AGGREGATE eql_v3.max(public.eql_v3_double_ord) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_double_ord, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_double_ord. +--! @param input public.{{prefix}}_double_ord +--! @return public.{{prefix}}_double_ord +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_double_ord) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_double_ord, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/double/double_ord_functions.sql b/packages/eql/src/v3/scalars/double/double_ord_functions.sql index 2554ce56c..c599d065e 100644 --- a/packages/eql/src/v3/scalars/double/double_ord_functions.sql +++ b/packages/eql/src/v3/scalars/double/double_ord_functions.sql @@ -5,562 +5,562 @@ -- REQUIRE: src/v3/sem/ope_cllw/functions.sql --! @file encrypted_domain/double/double_ord_functions.sql ---! @brief Functions for public.eql_v3_double_ord. +--! @brief Functions for public.{{prefix}}_double_ord. ---! @brief Index extractor for public.eql_v3_double_ord. ---! @param a public.eql_v3_double_ord ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a public.eql_v3_double_ord) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for public.{{prefix}}_double_ord. +--! @param a public.{{prefix}}_double_ord +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a public.{{prefix}}_double_ord) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord. ---! @param a public.eql_v3_double_ord ---! @param b public.eql_v3_double_ord +--! @brief Operator wrapper for public.{{prefix}}_double_ord. +--! @param a public.{{prefix}}_double_ord +--! @param b public.{{prefix}}_double_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_double_ord, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord. ---! @param a public.eql_v3_double_ord +--! @brief Operator wrapper for public.{{prefix}}_double_ord. +--! @param a public.{{prefix}}_double_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_double_ord, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b::public.eql_v3_double_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_double_ord) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord. +--! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a jsonb ---! @param b public.eql_v3_double_ord +--! @param b public.{{prefix}}_double_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_double_ord) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord. ---! @param a public.eql_v3_double_ord ---! @param b public.eql_v3_double_ord +--! @brief Operator wrapper for public.{{prefix}}_double_ord. +--! @param a public.{{prefix}}_double_ord +--! @param b public.{{prefix}}_double_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_double_ord, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord. ---! @param a public.eql_v3_double_ord +--! @brief Operator wrapper for public.{{prefix}}_double_ord. +--! @param a public.{{prefix}}_double_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_double_ord, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b::public.eql_v3_double_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_double_ord) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord. +--! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a jsonb ---! @param b public.eql_v3_double_ord +--! @param b public.{{prefix}}_double_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_double_ord) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord. ---! @param a public.eql_v3_double_ord ---! @param b public.eql_v3_double_ord +--! @brief Operator wrapper for public.{{prefix}}_double_ord. +--! @param a public.{{prefix}}_double_ord +--! @param b public.{{prefix}}_double_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_double_ord, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord. ---! @param a public.eql_v3_double_ord +--! @brief Operator wrapper for public.{{prefix}}_double_ord. +--! @param a public.{{prefix}}_double_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_double_ord, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_double_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b::public.eql_v3_double_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_double_ord) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord. +--! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a jsonb ---! @param b public.eql_v3_double_ord +--! @param b public.{{prefix}}_double_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_double_ord) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord. ---! @param a public.eql_v3_double_ord ---! @param b public.eql_v3_double_ord +--! @brief Operator wrapper for public.{{prefix}}_double_ord. +--! @param a public.{{prefix}}_double_ord +--! @param b public.{{prefix}}_double_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_double_ord, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord. ---! @param a public.eql_v3_double_ord +--! @brief Operator wrapper for public.{{prefix}}_double_ord. +--! @param a public.{{prefix}}_double_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_double_ord, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_double_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b::public.eql_v3_double_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_double_ord) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord. +--! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a jsonb ---! @param b public.eql_v3_double_ord +--! @param b public.{{prefix}}_double_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_double_ord) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord. ---! @param a public.eql_v3_double_ord ---! @param b public.eql_v3_double_ord +--! @brief Operator wrapper for public.{{prefix}}_double_ord. +--! @param a public.{{prefix}}_double_ord +--! @param b public.{{prefix}}_double_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_double_ord, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord. ---! @param a public.eql_v3_double_ord +--! @brief Operator wrapper for public.{{prefix}}_double_ord. +--! @param a public.{{prefix}}_double_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_double_ord, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_double_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b::public.eql_v3_double_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_double_ord) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord. +--! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a jsonb ---! @param b public.eql_v3_double_ord +--! @param b public.{{prefix}}_double_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_double_ord) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord. ---! @param a public.eql_v3_double_ord ---! @param b public.eql_v3_double_ord +--! @brief Operator wrapper for public.{{prefix}}_double_ord. +--! @param a public.{{prefix}}_double_ord +--! @param b public.{{prefix}}_double_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_double_ord, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord. ---! @param a public.eql_v3_double_ord +--! @brief Operator wrapper for public.{{prefix}}_double_ord. +--! @param a public.{{prefix}}_double_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_double_ord, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_double_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b::public.eql_v3_double_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_double_ord) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord. +--! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a jsonb ---! @param b public.eql_v3_double_ord +--! @param b public.{{prefix}}_double_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_double_ord) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator ---! @param b public.eql_v3_double_ord right operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator +--! @param b public.{{prefix}}_double_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_double_ord, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_double_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_double_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_ord right operand of the blocked operator +--! @param b public.{{prefix}}_double_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_double_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator ---! @param b public.eql_v3_double_ord right operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator +--! @param b public.{{prefix}}_double_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_double_ord, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_double_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_double_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_ord right operand of the blocked operator +--! @param b public.{{prefix}}_double_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_double_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_double_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_double_ord, selector text) -RETURNS public.eql_v3_double_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_double_ord'; END; $$ +--! @return public.{{prefix}}_double_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_double_ord, selector text) +RETURNS public.{{prefix}}_double_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_double_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_double_ord, selector integer) -RETURNS public.eql_v3_double_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_double_ord'; END; $$ +--! @return public.{{prefix}}_double_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_double_ord, selector integer) +RETURNS public.{{prefix}}_double_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_double_ord right operand of the blocked operator ---! @return public.eql_v3_double_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_double_ord) -RETURNS public.eql_v3_double_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_double_ord'; END; $$ +--! @param selector public.{{prefix}}_double_ord right operand of the blocked operator +--! @return public.{{prefix}}_double_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_double_ord) +RETURNS public.{{prefix}}_double_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_double_ord, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_double_ord, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_double_ord, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_double_ord, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_double_ord right operand of the blocked operator +--! @param selector public.{{prefix}}_double_ord right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_double_ord) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_double_ord, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_double_ord, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_double_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_double_ord, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_double_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_double_ord, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_double_ord, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_double_ord, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator ---! @param b public.eql_v3_double_ord right operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator +--! @param b public.{{prefix}}_double_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_double_ord, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_double_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_double_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_ord right operand of the blocked operator +--! @param b public.{{prefix}}_double_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_double_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_double_ord, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_double_ord, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_double_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_double_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_double_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_double_ord, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_double_ord, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_double_ord, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_double_ord, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_double_ord, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_double_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_double_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_double_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_double_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator ---! @param b public.eql_v3_double_ord right operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator +--! @param b public.{{prefix}}_double_ord right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_double_ord, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_double_ord, b public.{{prefix}}_double_ord) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_double_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_double_ord, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_ord right operand of the blocked operator +--! @param b public.{{prefix}}_double_ord right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_double_ord) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_double_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_double_ord'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/double/double_ord_ope_aggregates.sql b/packages/eql/src/v3/scalars/double/double_ord_ope_aggregates.sql index c9d8fddb5..8be554877 100644 --- a/packages/eql/src/v3/scalars/double/double_ord_ope_aggregates.sql +++ b/packages/eql/src/v3/scalars/double/double_ord_ope_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/double/double_ord_ope_operators.sql --! @file encrypted_domain/double/double_ord_ope_aggregates.sql ---! @brief Aggregates for public.eql_v3_double_ord_ope. +--! @brief Aggregates for public.{{prefix}}_double_ord_ope. ---! @brief State function for min on public.eql_v3_double_ord_ope. ---! @param state public.eql_v3_double_ord_ope ---! @param value public.eql_v3_double_ord_ope ---! @return public.eql_v3_double_ord_ope -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_double_ord_ope, value public.eql_v3_double_ord_ope) -RETURNS public.eql_v3_double_ord_ope +--! @brief State function for min on public.{{prefix}}_double_ord_ope. +--! @param state public.{{prefix}}_double_ord_ope +--! @param value public.{{prefix}}_double_ord_ope +--! @return public.{{prefix}}_double_ord_ope +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_double_ord_ope, value public.{{prefix}}_double_ord_ope) +RETURNS public.{{prefix}}_double_ord_ope LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_double_ord_ope. ---! @param input public.eql_v3_double_ord_ope ---! @return public.eql_v3_double_ord_ope -CREATE AGGREGATE eql_v3.min(public.eql_v3_double_ord_ope) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_double_ord_ope, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_double_ord_ope. +--! @param input public.{{prefix}}_double_ord_ope +--! @return public.{{prefix}}_double_ord_ope +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_double_ord_ope) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_double_ord_ope, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_double_ord_ope. ---! @param state public.eql_v3_double_ord_ope ---! @param value public.eql_v3_double_ord_ope ---! @return public.eql_v3_double_ord_ope -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_double_ord_ope, value public.eql_v3_double_ord_ope) -RETURNS public.eql_v3_double_ord_ope +--! @brief State function for max on public.{{prefix}}_double_ord_ope. +--! @param state public.{{prefix}}_double_ord_ope +--! @param value public.{{prefix}}_double_ord_ope +--! @return public.{{prefix}}_double_ord_ope +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_double_ord_ope, value public.{{prefix}}_double_ord_ope) +RETURNS public.{{prefix}}_double_ord_ope LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_double_ord_ope. ---! @param input public.eql_v3_double_ord_ope ---! @return public.eql_v3_double_ord_ope -CREATE AGGREGATE eql_v3.max(public.eql_v3_double_ord_ope) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_double_ord_ope, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_double_ord_ope. +--! @param input public.{{prefix}}_double_ord_ope +--! @return public.{{prefix}}_double_ord_ope +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_double_ord_ope) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_double_ord_ope, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/double/double_ord_ope_functions.sql b/packages/eql/src/v3/scalars/double/double_ord_ope_functions.sql index b3862e5e4..62ae689f7 100644 --- a/packages/eql/src/v3/scalars/double/double_ord_ope_functions.sql +++ b/packages/eql/src/v3/scalars/double/double_ord_ope_functions.sql @@ -5,562 +5,562 @@ -- REQUIRE: src/v3/sem/ope_cllw/functions.sql --! @file encrypted_domain/double/double_ord_ope_functions.sql ---! @brief Functions for public.eql_v3_double_ord_ope. +--! @brief Functions for public.{{prefix}}_double_ord_ope. ---! @brief Index extractor for public.eql_v3_double_ord_ope. ---! @param a public.eql_v3_double_ord_ope ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a public.eql_v3_double_ord_ope) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for public.{{prefix}}_double_ord_ope. +--! @param a public.{{prefix}}_double_ord_ope +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a public.{{prefix}}_double_ord_ope) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ope. ---! @param a public.eql_v3_double_ord_ope ---! @param b public.eql_v3_double_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. +--! @param a public.{{prefix}}_double_ord_ope +--! @param b public.{{prefix}}_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_double_ord_ope, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_ord_ope, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ope. ---! @param a public.eql_v3_double_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. +--! @param a public.{{prefix}}_double_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_double_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b::public.eql_v3_double_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_double_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_double_ord_ope +--! @param b public.{{prefix}}_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_double_ord_ope) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ope. ---! @param a public.eql_v3_double_ord_ope ---! @param b public.eql_v3_double_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. +--! @param a public.{{prefix}}_double_ord_ope +--! @param b public.{{prefix}}_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_double_ord_ope, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_ord_ope, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ope. ---! @param a public.eql_v3_double_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. +--! @param a public.{{prefix}}_double_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_double_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b::public.eql_v3_double_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_double_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_double_ord_ope +--! @param b public.{{prefix}}_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_double_ord_ope) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ope. ---! @param a public.eql_v3_double_ord_ope ---! @param b public.eql_v3_double_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. +--! @param a public.{{prefix}}_double_ord_ope +--! @param b public.{{prefix}}_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_double_ord_ope, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_double_ord_ope, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ope. ---! @param a public.eql_v3_double_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. +--! @param a public.{{prefix}}_double_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_double_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_double_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b::public.eql_v3_double_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_double_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_double_ord_ope +--! @param b public.{{prefix}}_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_double_ord_ope) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ope. ---! @param a public.eql_v3_double_ord_ope ---! @param b public.eql_v3_double_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. +--! @param a public.{{prefix}}_double_ord_ope +--! @param b public.{{prefix}}_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_double_ord_ope, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_double_ord_ope, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ope. ---! @param a public.eql_v3_double_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. +--! @param a public.{{prefix}}_double_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_double_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_double_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b::public.eql_v3_double_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_double_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_double_ord_ope +--! @param b public.{{prefix}}_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_double_ord_ope) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ope. ---! @param a public.eql_v3_double_ord_ope ---! @param b public.eql_v3_double_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. +--! @param a public.{{prefix}}_double_ord_ope +--! @param b public.{{prefix}}_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_double_ord_ope, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_double_ord_ope, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ope. ---! @param a public.eql_v3_double_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. +--! @param a public.{{prefix}}_double_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_double_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_double_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b::public.eql_v3_double_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_double_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_double_ord_ope +--! @param b public.{{prefix}}_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_double_ord_ope) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ope. ---! @param a public.eql_v3_double_ord_ope ---! @param b public.eql_v3_double_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. +--! @param a public.{{prefix}}_double_ord_ope +--! @param b public.{{prefix}}_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_double_ord_ope, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_double_ord_ope, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ope. ---! @param a public.eql_v3_double_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. +--! @param a public.{{prefix}}_double_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_double_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_double_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b::public.eql_v3_double_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_double_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_double_ord_ope +--! @param b public.{{prefix}}_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_double_ord_ope) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_double_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_double_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_double_ord_ope, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_double_ord_ope, b public.{{prefix}}_double_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_double_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_double_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_double_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_double_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_double_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_double_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_double_ord_ope, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_double_ord_ope, b public.{{prefix}}_double_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_double_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_double_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_double_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_double_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_double_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_double_ord_ope, selector text) -RETURNS public.eql_v3_double_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_double_ord_ope'; END; $$ +--! @return public.{{prefix}}_double_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_double_ord_ope, selector text) +RETURNS public.{{prefix}}_double_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_double_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_double_ord_ope, selector integer) -RETURNS public.eql_v3_double_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_double_ord_ope'; END; $$ +--! @return public.{{prefix}}_double_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_double_ord_ope, selector integer) +RETURNS public.{{prefix}}_double_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_double_ord_ope right operand of the blocked operator ---! @return public.eql_v3_double_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_double_ord_ope) -RETURNS public.eql_v3_double_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_double_ord_ope'; END; $$ +--! @param selector public.{{prefix}}_double_ord_ope right operand of the blocked operator +--! @return public.{{prefix}}_double_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_double_ord_ope) +RETURNS public.{{prefix}}_double_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_double_ord_ope, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_double_ord_ope, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_double_ord_ope, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_double_ord_ope, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_double_ord_ope right operand of the blocked operator +--! @param selector public.{{prefix}}_double_ord_ope right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_double_ord_ope) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_double_ord_ope, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_double_ord_ope, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_double_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_double_ord_ope, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_double_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_double_ord_ope, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_double_ord_ope, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_double_ord_ope, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_double_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_double_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_double_ord_ope, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_double_ord_ope, b public.{{prefix}}_double_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_double_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_double_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_double_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_double_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_double_ord_ope, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_double_ord_ope, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_double_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_double_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_double_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_double_ord_ope, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_double_ord_ope, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_double_ord_ope, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_double_ord_ope, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_double_ord_ope, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_double_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_double_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_double_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_double_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_double_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_double_ord_ope right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_double_ord_ope, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_double_ord_ope, b public.{{prefix}}_double_ord_ope) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_double_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_double_ord_ope, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_double_ord_ope right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_double_ord_ope) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_double_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_double_ord_ope'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/double/double_ord_ope_operators.sql b/packages/eql/src/v3/scalars/double/double_ord_ope_operators.sql index e62acca0e..98a5eb75a 100644 --- a/packages/eql/src/v3/scalars/double/double_ord_ope_operators.sql +++ b/packages/eql/src/v3/scalars/double/double_ord_ope_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/double/double_ord_ope_functions.sql --! @file encrypted_domain/double/double_ord_ope_operators.sql ---! @brief Operators for public.eql_v3_double_ord_ope. +--! @brief Operators for public.{{prefix}}_double_ord_ope. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = public.eql_v3_double_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = public.eql_v3_double_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = public.eql_v3_double_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = public.eql_v3_double_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = public.eql_v3_double_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = public.eql_v3_double_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = public.eql_v3_double_ord_ope + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ope ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ope + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ope ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = public.eql_v3_double_ord_ope + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ope ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ope + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ope ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ope + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ope ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ope + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ope ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = public.eql_v3_double_ord_ope + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ope ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ope + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ope ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = public.eql_v3_double_ord_ope + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ope ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ope + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ope ); diff --git a/packages/eql/src/v3/scalars/double/double_ord_operators.sql b/packages/eql/src/v3/scalars/double/double_ord_operators.sql index 6178c72f9..c12695ffc 100644 --- a/packages/eql/src/v3/scalars/double/double_ord_operators.sql +++ b/packages/eql/src/v3/scalars/double/double_ord_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/double/double_ord_functions.sql --! @file encrypted_domain/double/double_ord_operators.sql ---! @brief Operators for public.eql_v3_double_ord. +--! @brief Operators for public.{{prefix}}_double_ord. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = public.eql_v3_double_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = public.{{prefix}}_double_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = public.eql_v3_double_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = public.{{prefix}}_double_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = public.eql_v3_double_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = public.{{prefix}}_double_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = public.eql_v3_double_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = public.{{prefix}}_double_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = public.eql_v3_double_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = public.{{prefix}}_double_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = public.eql_v3_double_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = public.{{prefix}}_double_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = public.eql_v3_double_ord + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = public.{{prefix}}_double_ord ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = public.eql_v3_double_ord + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = public.{{prefix}}_double_ord ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_double_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_double_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_double_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_double_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_double_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_double_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_double_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_double_ord, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_double_ord, RIGHTARG = public.eql_v3_double_ord + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = public.{{prefix}}_double_ord ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_double_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_double_ord, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_double_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_double_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_double_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_double_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_double_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_double_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_double_ord, RIGHTARG = public.eql_v3_double_ord + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = public.{{prefix}}_double_ord ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_double_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord ); diff --git a/packages/eql/src/v3/scalars/double/double_ord_ore_aggregates.sql b/packages/eql/src/v3/scalars/double/double_ord_ore_aggregates.sql index 19c60c2fd..cdf731006 100644 --- a/packages/eql/src/v3/scalars/double/double_ord_ore_aggregates.sql +++ b/packages/eql/src/v3/scalars/double/double_ord_ore_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/double/double_ord_ore_operators.sql --! @file encrypted_domain/double/double_ord_ore_aggregates.sql ---! @brief Aggregates for public.eql_v3_double_ord_ore. +--! @brief Aggregates for public.{{prefix}}_double_ord_ore. ---! @brief State function for min on public.eql_v3_double_ord_ore. ---! @param state public.eql_v3_double_ord_ore ---! @param value public.eql_v3_double_ord_ore ---! @return public.eql_v3_double_ord_ore -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_double_ord_ore, value public.eql_v3_double_ord_ore) -RETURNS public.eql_v3_double_ord_ore +--! @brief State function for min on public.{{prefix}}_double_ord_ore. +--! @param state public.{{prefix}}_double_ord_ore +--! @param value public.{{prefix}}_double_ord_ore +--! @return public.{{prefix}}_double_ord_ore +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_double_ord_ore, value public.{{prefix}}_double_ord_ore) +RETURNS public.{{prefix}}_double_ord_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_double_ord_ore. ---! @param input public.eql_v3_double_ord_ore ---! @return public.eql_v3_double_ord_ore -CREATE AGGREGATE eql_v3.min(public.eql_v3_double_ord_ore) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_double_ord_ore, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_double_ord_ore. +--! @param input public.{{prefix}}_double_ord_ore +--! @return public.{{prefix}}_double_ord_ore +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_double_ord_ore) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_double_ord_ore, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_double_ord_ore. ---! @param state public.eql_v3_double_ord_ore ---! @param value public.eql_v3_double_ord_ore ---! @return public.eql_v3_double_ord_ore -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_double_ord_ore, value public.eql_v3_double_ord_ore) -RETURNS public.eql_v3_double_ord_ore +--! @brief State function for max on public.{{prefix}}_double_ord_ore. +--! @param state public.{{prefix}}_double_ord_ore +--! @param value public.{{prefix}}_double_ord_ore +--! @return public.{{prefix}}_double_ord_ore +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_double_ord_ore, value public.{{prefix}}_double_ord_ore) +RETURNS public.{{prefix}}_double_ord_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_double_ord_ore. ---! @param input public.eql_v3_double_ord_ore ---! @return public.eql_v3_double_ord_ore -CREATE AGGREGATE eql_v3.max(public.eql_v3_double_ord_ore) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_double_ord_ore, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_double_ord_ore. +--! @param input public.{{prefix}}_double_ord_ore +--! @return public.{{prefix}}_double_ord_ore +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_double_ord_ore) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_double_ord_ore, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/double/double_ord_ore_functions.sql b/packages/eql/src/v3/scalars/double/double_ord_ore_functions.sql index 9c65feb22..8cdec0b7f 100644 --- a/packages/eql/src/v3/scalars/double/double_ord_ore_functions.sql +++ b/packages/eql/src/v3/scalars/double/double_ord_ore_functions.sql @@ -6,562 +6,562 @@ -- REQUIRE: src/v3/sem/ore_block_256/operators.sql --! @file encrypted_domain/double/double_ord_ore_functions.sql ---! @brief Functions for public.eql_v3_double_ord_ore. +--! @brief Functions for public.{{prefix}}_double_ord_ore. ---! @brief Index extractor for public.eql_v3_double_ord_ore. ---! @param a public.eql_v3_double_ord_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a public.eql_v3_double_ord_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for public.{{prefix}}_double_ord_ore. +--! @param a public.{{prefix}}_double_ord_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a public.{{prefix}}_double_ord_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ore. ---! @param a public.eql_v3_double_ord_ore ---! @param b public.eql_v3_double_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. +--! @param a public.{{prefix}}_double_ord_ore +--! @param b public.{{prefix}}_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_double_ord_ore, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_ord_ore, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ore. ---! @param a public.eql_v3_double_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. +--! @param a public.{{prefix}}_double_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_double_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b::public.eql_v3_double_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{prefix}}_double_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_double_ord_ore +--! @param b public.{{prefix}}_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_double_ord_ore) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ore. ---! @param a public.eql_v3_double_ord_ore ---! @param b public.eql_v3_double_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. +--! @param a public.{{prefix}}_double_ord_ore +--! @param b public.{{prefix}}_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_double_ord_ore, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_ord_ore, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ore. ---! @param a public.eql_v3_double_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. +--! @param a public.{{prefix}}_double_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_double_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b::public.eql_v3_double_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{prefix}}_double_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_double_ord_ore +--! @param b public.{{prefix}}_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_double_ord_ore) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ore. ---! @param a public.eql_v3_double_ord_ore ---! @param b public.eql_v3_double_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. +--! @param a public.{{prefix}}_double_ord_ore +--! @param b public.{{prefix}}_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_double_ord_ore, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_double_ord_ore, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ore. ---! @param a public.eql_v3_double_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. +--! @param a public.{{prefix}}_double_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_double_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_double_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b::public.eql_v3_double_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_double_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_double_ord_ore +--! @param b public.{{prefix}}_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_double_ord_ore) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ore. ---! @param a public.eql_v3_double_ord_ore ---! @param b public.eql_v3_double_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. +--! @param a public.{{prefix}}_double_ord_ore +--! @param b public.{{prefix}}_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_double_ord_ore, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_double_ord_ore, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ore. ---! @param a public.eql_v3_double_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. +--! @param a public.{{prefix}}_double_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_double_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_double_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b::public.eql_v3_double_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_double_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_double_ord_ore +--! @param b public.{{prefix}}_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_double_ord_ore) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ore. ---! @param a public.eql_v3_double_ord_ore ---! @param b public.eql_v3_double_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. +--! @param a public.{{prefix}}_double_ord_ore +--! @param b public.{{prefix}}_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_double_ord_ore, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_double_ord_ore, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ore. ---! @param a public.eql_v3_double_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. +--! @param a public.{{prefix}}_double_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_double_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_double_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b::public.eql_v3_double_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_double_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_double_ord_ore +--! @param b public.{{prefix}}_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_double_ord_ore) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ore. ---! @param a public.eql_v3_double_ord_ore ---! @param b public.eql_v3_double_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. +--! @param a public.{{prefix}}_double_ord_ore +--! @param b public.{{prefix}}_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_double_ord_ore, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_double_ord_ore, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ore. ---! @param a public.eql_v3_double_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. +--! @param a public.{{prefix}}_double_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_double_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_double_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b::public.eql_v3_double_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_double_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_double_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_double_ord_ore +--! @param b public.{{prefix}}_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_double_ord_ore) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_double_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_double_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_double_ord_ore, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_double_ord_ore, b public.{{prefix}}_double_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_double_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_double_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_double_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_double_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_double_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_double_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_double_ord_ore, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_double_ord_ore, b public.{{prefix}}_double_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_double_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_double_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_double_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_double_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_double_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_double_ord_ore, selector text) -RETURNS public.eql_v3_double_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_double_ord_ore'; END; $$ +--! @return public.{{prefix}}_double_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_double_ord_ore, selector text) +RETURNS public.{{prefix}}_double_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_double_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_double_ord_ore, selector integer) -RETURNS public.eql_v3_double_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_double_ord_ore'; END; $$ +--! @return public.{{prefix}}_double_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_double_ord_ore, selector integer) +RETURNS public.{{prefix}}_double_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_double_ord_ore right operand of the blocked operator ---! @return public.eql_v3_double_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_double_ord_ore) -RETURNS public.eql_v3_double_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_double_ord_ore'; END; $$ +--! @param selector public.{{prefix}}_double_ord_ore right operand of the blocked operator +--! @return public.{{prefix}}_double_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_double_ord_ore) +RETURNS public.{{prefix}}_double_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_double_ord_ore, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_double_ord_ore, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_double_ord_ore, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_double_ord_ore, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_double_ord_ore right operand of the blocked operator +--! @param selector public.{{prefix}}_double_ord_ore right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_double_ord_ore) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_double_ord_ore, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_double_ord_ore, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_double_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_double_ord_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_double_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_double_ord_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_double_ord_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_double_ord_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_double_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_double_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_double_ord_ore, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_double_ord_ore, b public.{{prefix}}_double_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_double_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_double_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_double_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_double_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_double_ord_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_double_ord_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_double_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_double_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_double_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_double_ord_ore, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_double_ord_ore, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_double_ord_ore, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_double_ord_ore, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_double_ord_ore, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_double_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_double_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_double_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_double_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_double_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_double_ord_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_double_ord_ore, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_double_ord_ore, b public.{{prefix}}_double_ord_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_double_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_double_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_double_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_double_ord_ore, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_double_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_double_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_double_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_double_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_double_ord_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_double_ord_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_double_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_double_ord_ore'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/double/double_ord_ore_operators.sql b/packages/eql/src/v3/scalars/double/double_ord_ore_operators.sql index 6057dbbe7..7928b366f 100644 --- a/packages/eql/src/v3/scalars/double/double_ord_ore_operators.sql +++ b/packages/eql/src/v3/scalars/double/double_ord_ore_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/double/double_ord_ore_functions.sql --! @file encrypted_domain/double/double_ord_ore_operators.sql ---! @brief Operators for public.eql_v3_double_ord_ore. +--! @brief Operators for public.{{prefix}}_double_ord_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = public.eql_v3_double_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = public.eql_v3_double_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = public.eql_v3_double_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = public.eql_v3_double_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = public.eql_v3_double_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = public.eql_v3_double_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = public.eql_v3_double_ord_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ore ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = public.eql_v3_double_ord_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ore ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ore + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ore ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ore + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ore ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = public.eql_v3_double_ord_ore + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ore ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ore + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ore ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = public.eql_v3_double_ord_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ore ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_double_ord_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_double_ord_ore ); diff --git a/packages/eql/src/v3/scalars/double/double_types.sql b/packages/eql/src/v3/scalars/double/double_types.sql index b76cf46b4..95c4c3d85 100644 --- a/packages/eql/src/v3/scalars/double/double_types.sql +++ b/packages/eql/src/v3/scalars/double/double_types.sql @@ -6,47 +6,47 @@ DO $$ BEGIN - --! @brief Encrypted domain public.eql_v3_double. + --! @brief Encrypted domain public.{{prefix}}_double. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_double' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_double' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_double AS jsonb + CREATE DOMAIN public.{{prefix}}_double AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_double IS 'EQL encrypted double (storage only)'; + COMMENT ON DOMAIN public.{{prefix}}_double IS 'EQL encrypted double (storage only)'; - --! @brief Encrypted domain public.eql_v3_double_eq. + --! @brief Encrypted domain public.{{prefix}}_double_eq. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_double_eq' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_double_eq' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_double_eq AS jsonb + CREATE DOMAIN public.{{prefix}}_double_eq AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'hm' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_double_eq IS 'EQL encrypted double (equality)'; + COMMENT ON DOMAIN public.{{prefix}}_double_eq IS 'EQL encrypted double (equality)'; - --! @brief Encrypted domain public.eql_v3_double_ord_ore. + --! @brief Encrypted domain public.{{prefix}}_double_ord_ore. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_double_ord_ore' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_double_ord_ore' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_double_ord_ore AS jsonb + CREATE DOMAIN public.{{prefix}}_double_ord_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -55,46 +55,46 @@ BEGIN AND VALUE ? 'ob' AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_double_ord_ore IS 'EQL encrypted double (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_double_ord_ore IS 'EQL encrypted double (equality, ordering)'; - --! @brief Encrypted domain public.eql_v3_double_ord. + --! @brief Encrypted domain public.{{prefix}}_double_ord. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_double_ord' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_double_ord' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_double_ord AS jsonb + CREATE DOMAIN public.{{prefix}}_double_ord AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'op' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_double_ord IS 'EQL encrypted double (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_double_ord IS 'EQL encrypted double (equality, ordering)'; - --! @brief Encrypted domain public.eql_v3_double_ord_ope. + --! @brief Encrypted domain public.{{prefix}}_double_ord_ope. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_double_ord_ope' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_double_ord_ope' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_double_ord_ope AS jsonb + CREATE DOMAIN public.{{prefix}}_double_ord_ope AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'op' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_double_ord_ope IS 'EQL encrypted double (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_double_ord_ope IS 'EQL encrypted double (equality, ordering)'; END $$; diff --git a/packages/eql/src/v3/scalars/double/json_entry_double_functions.sql b/packages/eql/src/v3/scalars/double/json_entry_double_functions.sql index 14d8b0d1d..ef2171dd9 100644 --- a/packages/eql/src/v3/scalars/double/json_entry_double_functions.sql +++ b/packages/eql/src/v3/scalars/double/json_entry_double_functions.sql @@ -7,244 +7,244 @@ -- REQUIRE: src/v3/scalars/double/query_double_ord_ope_functions.sql --! @file encrypted_domain/double/json_entry_double_functions.sql ---! @brief Functions for public.eql_v3_json_entry. +--! @brief Functions for public.{{prefix}}_json_entry. ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_double_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_double_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json_entry, b eql_v3.query_double_ord) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json_entry, b {{prefix}}.query_double_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_double_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_double_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a eql_v3.query_double_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_double_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_double_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_double_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json_entry, b eql_v3.query_double_ord) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json_entry, b {{prefix}}.query_double_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_double_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_double_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a eql_v3.query_double_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_double_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_double_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_double_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_json_entry, b eql_v3.query_double_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_double_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_double_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_double_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_double_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_double_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_double_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_json_entry, b eql_v3.query_double_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_double_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_double_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_double_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_double_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_double_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_double_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_json_entry, b eql_v3.query_double_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_double_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_double_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_double_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_double_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_double_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_double_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_json_entry, b eql_v3.query_double_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_double_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_double_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_double_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_double_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_double_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_double_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json_entry, b eql_v3.query_double_ord_ope) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json_entry, b {{prefix}}.query_double_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_double_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_double_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a eql_v3.query_double_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_double_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_double_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json_entry, b eql_v3.query_double_ord_ope) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json_entry, b {{prefix}}.query_double_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_double_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_double_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a eql_v3.query_double_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_double_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_json_entry, b eql_v3.query_double_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_double_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_double_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_double_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_double_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_json_entry, b eql_v3.query_double_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_double_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_double_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_double_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_double_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_json_entry, b eql_v3.query_double_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_double_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_double_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_double_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_double_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_json_entry, b eql_v3.query_double_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_double_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_double_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_double_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/double/json_entry_double_operators.sql b/packages/eql/src/v3/scalars/double/json_entry_double_operators.sql index 8ff3727dc..391e2743e 100644 --- a/packages/eql/src/v3/scalars/double/json_entry_double_operators.sql +++ b/packages/eql/src/v3/scalars/double/json_entry_double_operators.sql @@ -5,140 +5,140 @@ -- REQUIRE: src/v3/scalars/double/json_entry_double_functions.sql --! @file encrypted_domain/double/json_entry_double_operators.sql ---! @brief Operators for public.eql_v3_json_entry. +--! @brief Operators for public.{{prefix}}_json_entry. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_double_ord + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_double_ord ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = eql_v3.query_double_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_double_ord + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_double_ord ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = eql_v3.query_double_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_double_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_double_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_double_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_double_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_double_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_double_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_double_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_double_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_double_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_double_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_double_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_double_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_double_ord_ope + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_double_ord_ope ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = eql_v3.query_double_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_double_ord_ope + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_double_ord_ope ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = eql_v3.query_double_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_double_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_double_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_double_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_double_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_double_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_double_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_double_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_double_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_double_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_double_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_double_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_double_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/double/query_double_eq_functions.sql b/packages/eql/src/v3/scalars/double/query_double_eq_functions.sql index 8c1c96076..814bf588e 100644 --- a/packages/eql/src/v3/scalars/double/query_double_eq_functions.sql +++ b/packages/eql/src/v3/scalars/double/query_double_eq_functions.sql @@ -4,44 +4,44 @@ -- REQUIRE: src/v3/scalars/double/double_eq_functions.sql --! @file encrypted_domain/double/query_double_eq_functions.sql ---! @brief Functions for eql_v3.query_double_eq. +--! @brief Functions for {{prefix}}.query_double_eq. ---! @brief Index extractor for eql_v3.query_double_eq. ---! @param a eql_v3.query_double_eq ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a eql_v3.query_double_eq) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for {{prefix}}.query_double_eq. +--! @param a {{prefix}}.query_double_eq +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a {{prefix}}.query_double_eq) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_double_eq. ---! @param a public.eql_v3_double_eq ---! @param b eql_v3.query_double_eq +--! @brief Operator wrapper for {{prefix}}.query_double_eq. +--! @param a public.{{prefix}}_double_eq +--! @param b {{prefix}}.query_double_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_double_eq, b eql_v3.query_double_eq) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_eq, b {{prefix}}.query_double_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_eq. ---! @param a eql_v3.query_double_eq ---! @param b public.eql_v3_double_eq +--! @brief Operator wrapper for {{prefix}}.query_double_eq. +--! @param a {{prefix}}.query_double_eq +--! @param b public.{{prefix}}_double_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_double_eq, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_double_eq, b public.{{prefix}}_double_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_eq. ---! @param a public.eql_v3_double_eq ---! @param b eql_v3.query_double_eq +--! @brief Operator wrapper for {{prefix}}.query_double_eq. +--! @param a public.{{prefix}}_double_eq +--! @param b {{prefix}}.query_double_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_double_eq, b eql_v3.query_double_eq) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_eq, b {{prefix}}.query_double_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_eq. ---! @param a eql_v3.query_double_eq ---! @param b public.eql_v3_double_eq +--! @brief Operator wrapper for {{prefix}}.query_double_eq. +--! @param a {{prefix}}.query_double_eq +--! @param b public.{{prefix}}_double_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_double_eq, b public.eql_v3_double_eq) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_double_eq, b public.{{prefix}}_double_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; diff --git a/packages/eql/src/v3/scalars/double/query_double_eq_operators.sql b/packages/eql/src/v3/scalars/double/query_double_eq_operators.sql index d7649b103..f6294d8d4 100644 --- a/packages/eql/src/v3/scalars/double/query_double_eq_operators.sql +++ b/packages/eql/src/v3/scalars/double/query_double_eq_operators.sql @@ -4,28 +4,28 @@ -- REQUIRE: src/v3/scalars/double/query_double_eq_functions.sql --! @file encrypted_domain/double/query_double_eq_operators.sql ---! @brief Operators for eql_v3.query_double_eq. +--! @brief Operators for {{prefix}}.query_double_eq. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_double_eq, RIGHTARG = eql_v3.query_double_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = {{prefix}}.query_double_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_double_eq, RIGHTARG = public.eql_v3_double_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_double_eq, RIGHTARG = public.{{prefix}}_double_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_double_eq, RIGHTARG = eql_v3.query_double_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = {{prefix}}.query_double_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_double_eq, RIGHTARG = public.eql_v3_double_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_double_eq, RIGHTARG = public.{{prefix}}_double_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); diff --git a/packages/eql/src/v3/scalars/double/query_double_ord_functions.sql b/packages/eql/src/v3/scalars/double/query_double_ord_functions.sql index ba4719765..de3f645c5 100644 --- a/packages/eql/src/v3/scalars/double/query_double_ord_functions.sql +++ b/packages/eql/src/v3/scalars/double/query_double_ord_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/double/double_ord_functions.sql --! @file encrypted_domain/double/query_double_ord_functions.sql ---! @brief Functions for eql_v3.query_double_ord. +--! @brief Functions for {{prefix}}.query_double_ord. ---! @brief Index extractor for eql_v3.query_double_ord. ---! @param a eql_v3.query_double_ord ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a eql_v3.query_double_ord) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for {{prefix}}.query_double_ord. +--! @param a {{prefix}}.query_double_ord +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a {{prefix}}.query_double_ord) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord. ---! @param a public.eql_v3_double_ord ---! @param b eql_v3.query_double_ord +--! @brief Operator wrapper for {{prefix}}.query_double_ord. +--! @param a public.{{prefix}}_double_ord +--! @param b {{prefix}}.query_double_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_double_ord, b eql_v3.query_double_ord) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord. ---! @param a eql_v3.query_double_ord ---! @param b public.eql_v3_double_ord +--! @brief Operator wrapper for {{prefix}}.query_double_ord. +--! @param a {{prefix}}.query_double_ord +--! @param b public.{{prefix}}_double_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_double_ord, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord. ---! @param a public.eql_v3_double_ord ---! @param b eql_v3.query_double_ord +--! @brief Operator wrapper for {{prefix}}.query_double_ord. +--! @param a public.{{prefix}}_double_ord +--! @param b {{prefix}}.query_double_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_double_ord, b eql_v3.query_double_ord) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord. ---! @param a eql_v3.query_double_ord ---! @param b public.eql_v3_double_ord +--! @brief Operator wrapper for {{prefix}}.query_double_ord. +--! @param a {{prefix}}.query_double_ord +--! @param b public.{{prefix}}_double_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_double_ord, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord. ---! @param a public.eql_v3_double_ord ---! @param b eql_v3.query_double_ord +--! @brief Operator wrapper for {{prefix}}.query_double_ord. +--! @param a public.{{prefix}}_double_ord +--! @param b {{prefix}}.query_double_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_double_ord, b eql_v3.query_double_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord. ---! @param a eql_v3.query_double_ord ---! @param b public.eql_v3_double_ord +--! @brief Operator wrapper for {{prefix}}.query_double_ord. +--! @param a {{prefix}}.query_double_ord +--! @param b public.{{prefix}}_double_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_double_ord, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord. ---! @param a public.eql_v3_double_ord ---! @param b eql_v3.query_double_ord +--! @brief Operator wrapper for {{prefix}}.query_double_ord. +--! @param a public.{{prefix}}_double_ord +--! @param b {{prefix}}.query_double_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_double_ord, b eql_v3.query_double_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord. ---! @param a eql_v3.query_double_ord ---! @param b public.eql_v3_double_ord +--! @brief Operator wrapper for {{prefix}}.query_double_ord. +--! @param a {{prefix}}.query_double_ord +--! @param b public.{{prefix}}_double_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_double_ord, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord. ---! @param a public.eql_v3_double_ord ---! @param b eql_v3.query_double_ord +--! @brief Operator wrapper for {{prefix}}.query_double_ord. +--! @param a public.{{prefix}}_double_ord +--! @param b {{prefix}}.query_double_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_double_ord, b eql_v3.query_double_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord. ---! @param a eql_v3.query_double_ord ---! @param b public.eql_v3_double_ord +--! @brief Operator wrapper for {{prefix}}.query_double_ord. +--! @param a {{prefix}}.query_double_ord +--! @param b public.{{prefix}}_double_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_double_ord, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord. ---! @param a public.eql_v3_double_ord ---! @param b eql_v3.query_double_ord +--! @brief Operator wrapper for {{prefix}}.query_double_ord. +--! @param a public.{{prefix}}_double_ord +--! @param b {{prefix}}.query_double_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_double_ord, b eql_v3.query_double_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord. ---! @param a eql_v3.query_double_ord ---! @param b public.eql_v3_double_ord +--! @brief Operator wrapper for {{prefix}}.query_double_ord. +--! @param a {{prefix}}.query_double_ord +--! @param b public.{{prefix}}_double_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_double_ord, b public.eql_v3_double_ord) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/double/query_double_ord_ope_functions.sql b/packages/eql/src/v3/scalars/double/query_double_ord_ope_functions.sql index a9d2f760e..dfa4f5908 100644 --- a/packages/eql/src/v3/scalars/double/query_double_ord_ope_functions.sql +++ b/packages/eql/src/v3/scalars/double/query_double_ord_ope_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/double/double_ord_ope_functions.sql --! @file encrypted_domain/double/query_double_ord_ope_functions.sql ---! @brief Functions for eql_v3.query_double_ord_ope. +--! @brief Functions for {{prefix}}.query_double_ord_ope. ---! @brief Index extractor for eql_v3.query_double_ord_ope. ---! @param a eql_v3.query_double_ord_ope ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a eql_v3.query_double_ord_ope) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for {{prefix}}.query_double_ord_ope. +--! @param a {{prefix}}.query_double_ord_ope +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a {{prefix}}.query_double_ord_ope) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ope. ---! @param a public.eql_v3_double_ord_ope ---! @param b eql_v3.query_double_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. +--! @param a public.{{prefix}}_double_ord_ope +--! @param b {{prefix}}.query_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_double_ord_ope, b eql_v3.query_double_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ope. ---! @param a eql_v3.query_double_ord_ope ---! @param b public.eql_v3_double_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. +--! @param a {{prefix}}.query_double_ord_ope +--! @param b public.{{prefix}}_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_double_ord_ope, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ope. ---! @param a public.eql_v3_double_ord_ope ---! @param b eql_v3.query_double_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. +--! @param a public.{{prefix}}_double_ord_ope +--! @param b {{prefix}}.query_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_double_ord_ope, b eql_v3.query_double_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ope. ---! @param a eql_v3.query_double_ord_ope ---! @param b public.eql_v3_double_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. +--! @param a {{prefix}}.query_double_ord_ope +--! @param b public.{{prefix}}_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_double_ord_ope, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ope. ---! @param a public.eql_v3_double_ord_ope ---! @param b eql_v3.query_double_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. +--! @param a public.{{prefix}}_double_ord_ope +--! @param b {{prefix}}.query_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_double_ord_ope, b eql_v3.query_double_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ope. ---! @param a eql_v3.query_double_ord_ope ---! @param b public.eql_v3_double_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. +--! @param a {{prefix}}.query_double_ord_ope +--! @param b public.{{prefix}}_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_double_ord_ope, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ope. ---! @param a public.eql_v3_double_ord_ope ---! @param b eql_v3.query_double_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. +--! @param a public.{{prefix}}_double_ord_ope +--! @param b {{prefix}}.query_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_double_ord_ope, b eql_v3.query_double_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ope. ---! @param a eql_v3.query_double_ord_ope ---! @param b public.eql_v3_double_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. +--! @param a {{prefix}}.query_double_ord_ope +--! @param b public.{{prefix}}_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_double_ord_ope, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ope. ---! @param a public.eql_v3_double_ord_ope ---! @param b eql_v3.query_double_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. +--! @param a public.{{prefix}}_double_ord_ope +--! @param b {{prefix}}.query_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_double_ord_ope, b eql_v3.query_double_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ope. ---! @param a eql_v3.query_double_ord_ope ---! @param b public.eql_v3_double_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. +--! @param a {{prefix}}.query_double_ord_ope +--! @param b public.{{prefix}}_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_double_ord_ope, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ope. ---! @param a public.eql_v3_double_ord_ope ---! @param b eql_v3.query_double_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. +--! @param a public.{{prefix}}_double_ord_ope +--! @param b {{prefix}}.query_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_double_ord_ope, b eql_v3.query_double_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ope. ---! @param a eql_v3.query_double_ord_ope ---! @param b public.eql_v3_double_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. +--! @param a {{prefix}}.query_double_ord_ope +--! @param b public.{{prefix}}_double_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_double_ord_ope, b public.eql_v3_double_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/double/query_double_ord_ope_operators.sql b/packages/eql/src/v3/scalars/double/query_double_ord_ope_operators.sql index 6976b9e3b..99f6594d2 100644 --- a/packages/eql/src/v3/scalars/double/query_double_ord_ope_operators.sql +++ b/packages/eql/src/v3/scalars/double/query_double_ord_ope_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/double/query_double_ord_ope_functions.sql --! @file encrypted_domain/double/query_double_ord_ope_operators.sql ---! @brief Operators for eql_v3.query_double_ord_ope. +--! @brief Operators for {{prefix}}.query_double_ord_ope. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = eql_v3.query_double_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_double_ord_ope, RIGHTARG = public.eql_v3_double_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = eql_v3.query_double_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_double_ord_ope, RIGHTARG = public.eql_v3_double_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = eql_v3.query_double_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_double_ord_ope, RIGHTARG = public.eql_v3_double_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = eql_v3.query_double_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_double_ord_ope, RIGHTARG = public.eql_v3_double_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = eql_v3.query_double_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_double_ord_ope, RIGHTARG = public.eql_v3_double_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_double_ord_ope, RIGHTARG = eql_v3.query_double_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_double_ord_ope, RIGHTARG = public.eql_v3_double_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/double/query_double_ord_operators.sql b/packages/eql/src/v3/scalars/double/query_double_ord_operators.sql index 4f7571aa3..fe4aa9e5e 100644 --- a/packages/eql/src/v3/scalars/double/query_double_ord_operators.sql +++ b/packages/eql/src/v3/scalars/double/query_double_ord_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/double/query_double_ord_functions.sql --! @file encrypted_domain/double/query_double_ord_operators.sql ---! @brief Operators for eql_v3.query_double_ord. +--! @brief Operators for {{prefix}}.query_double_ord. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = eql_v3.query_double_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_double_ord, RIGHTARG = public.eql_v3_double_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = eql_v3.query_double_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_double_ord, RIGHTARG = public.eql_v3_double_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = eql_v3.query_double_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_double_ord, RIGHTARG = public.eql_v3_double_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = eql_v3.query_double_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_double_ord, RIGHTARG = public.eql_v3_double_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = eql_v3.query_double_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_double_ord, RIGHTARG = public.eql_v3_double_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_double_ord, RIGHTARG = eql_v3.query_double_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_double_ord, RIGHTARG = public.eql_v3_double_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/double/query_double_ord_ore_functions.sql b/packages/eql/src/v3/scalars/double/query_double_ord_ore_functions.sql index b916c2c40..e7e95f291 100644 --- a/packages/eql/src/v3/scalars/double/query_double_ord_ore_functions.sql +++ b/packages/eql/src/v3/scalars/double/query_double_ord_ore_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/double/double_ord_ore_functions.sql --! @file encrypted_domain/double/query_double_ord_ore_functions.sql ---! @brief Functions for eql_v3.query_double_ord_ore. +--! @brief Functions for {{prefix}}.query_double_ord_ore. ---! @brief Index extractor for eql_v3.query_double_ord_ore. ---! @param a eql_v3.query_double_ord_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a eql_v3.query_double_ord_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for {{prefix}}.query_double_ord_ore. +--! @param a {{prefix}}.query_double_ord_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a {{prefix}}.query_double_ord_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ore. ---! @param a public.eql_v3_double_ord_ore ---! @param b eql_v3.query_double_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. +--! @param a public.{{prefix}}_double_ord_ore +--! @param b {{prefix}}.query_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_double_ord_ore, b eql_v3.query_double_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ore. ---! @param a eql_v3.query_double_ord_ore ---! @param b public.eql_v3_double_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. +--! @param a {{prefix}}.query_double_ord_ore +--! @param b public.{{prefix}}_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_double_ord_ore, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ore. ---! @param a public.eql_v3_double_ord_ore ---! @param b eql_v3.query_double_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. +--! @param a public.{{prefix}}_double_ord_ore +--! @param b {{prefix}}.query_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_double_ord_ore, b eql_v3.query_double_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ore. ---! @param a eql_v3.query_double_ord_ore ---! @param b public.eql_v3_double_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. +--! @param a {{prefix}}.query_double_ord_ore +--! @param b public.{{prefix}}_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_double_ord_ore, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ore. ---! @param a public.eql_v3_double_ord_ore ---! @param b eql_v3.query_double_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. +--! @param a public.{{prefix}}_double_ord_ore +--! @param b {{prefix}}.query_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_double_ord_ore, b eql_v3.query_double_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ore. ---! @param a eql_v3.query_double_ord_ore ---! @param b public.eql_v3_double_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. +--! @param a {{prefix}}.query_double_ord_ore +--! @param b public.{{prefix}}_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_double_ord_ore, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ore. ---! @param a public.eql_v3_double_ord_ore ---! @param b eql_v3.query_double_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. +--! @param a public.{{prefix}}_double_ord_ore +--! @param b {{prefix}}.query_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_double_ord_ore, b eql_v3.query_double_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ore. ---! @param a eql_v3.query_double_ord_ore ---! @param b public.eql_v3_double_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. +--! @param a {{prefix}}.query_double_ord_ore +--! @param b public.{{prefix}}_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_double_ord_ore, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ore. ---! @param a public.eql_v3_double_ord_ore ---! @param b eql_v3.query_double_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. +--! @param a public.{{prefix}}_double_ord_ore +--! @param b {{prefix}}.query_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_double_ord_ore, b eql_v3.query_double_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ore. ---! @param a eql_v3.query_double_ord_ore ---! @param b public.eql_v3_double_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. +--! @param a {{prefix}}.query_double_ord_ore +--! @param b public.{{prefix}}_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_double_ord_ore, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ore. ---! @param a public.eql_v3_double_ord_ore ---! @param b eql_v3.query_double_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. +--! @param a public.{{prefix}}_double_ord_ore +--! @param b {{prefix}}.query_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_double_ord_ore, b eql_v3.query_double_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_double_ord_ore. ---! @param a eql_v3.query_double_ord_ore ---! @param b public.eql_v3_double_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. +--! @param a {{prefix}}.query_double_ord_ore +--! @param b public.{{prefix}}_double_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_double_ord_ore, b public.eql_v3_double_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; diff --git a/packages/eql/src/v3/scalars/double/query_double_ord_ore_operators.sql b/packages/eql/src/v3/scalars/double/query_double_ord_ore_operators.sql index 56ec45934..00a024cc5 100644 --- a/packages/eql/src/v3/scalars/double/query_double_ord_ore_operators.sql +++ b/packages/eql/src/v3/scalars/double/query_double_ord_ore_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/double/query_double_ord_ore_functions.sql --! @file encrypted_domain/double/query_double_ord_ore_operators.sql ---! @brief Operators for eql_v3.query_double_ord_ore. +--! @brief Operators for {{prefix}}.query_double_ord_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = eql_v3.query_double_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_double_ord_ore, RIGHTARG = public.eql_v3_double_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = eql_v3.query_double_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_double_ord_ore, RIGHTARG = public.eql_v3_double_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = eql_v3.query_double_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_double_ord_ore, RIGHTARG = public.eql_v3_double_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = eql_v3.query_double_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_double_ord_ore, RIGHTARG = public.eql_v3_double_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = eql_v3.query_double_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_double_ord_ore, RIGHTARG = public.eql_v3_double_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_double_ord_ore, RIGHTARG = eql_v3.query_double_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_double_ord_ore, RIGHTARG = public.eql_v3_double_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/double/query_double_range_functions.sql b/packages/eql/src/v3/scalars/double/query_double_range_functions.sql new file mode 100644 index 000000000..8aa8ed9eb --- /dev/null +++ b/packages/eql/src/v3/scalars/double/query_double_range_functions.sql @@ -0,0 +1,177 @@ +-- AUTOMATICALLY GENERATED FILE. +-- ONLY EQL VERSION: 4 +-- REQUIRE: src/v3/schema.sql +-- REQUIRE: src/v3/scalars/double/query_double_range_types.sql +-- REQUIRE: src/v3/scalars/double/double_ord_ore_functions.sql +-- REQUIRE: src/v3/scalars/double/double_ord_functions.sql +-- REQUIRE: src/v3/scalars/double/double_ord_ope_functions.sql +-- REQUIRE: src/v3/sem/ore_block_256/functions.sql +-- REQUIRE: src/v3/sem/ore_block_256/operators.sql +-- REQUIRE: src/v3/sem/ope_cllw/functions.sql + +--! @file v3/scalars/double/query_double_range_functions.sql +--! @brief The bound accessors and `{{prefix}}.between` for double's range query domains. +--! @note EQL version {{eql_version}} only, like the range domains themselves. + +--! @brief The low bound of a {{prefix}}.query_double_range_ore, as a block ORE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_double_range_ore Range query operand +--! @return {{prefix}}_internal.ore_block_256 The low bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.lo(r {{prefix}}.query_double_range_ore) +RETURNS {{prefix}}_internal.ore_block_256 +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ore_block_256(jsonb_build_object('ob', r::jsonb -> 'lo')) $$; + +--! @brief The high bound of a {{prefix}}.query_double_range_ore, as a block ORE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_double_range_ore Range query operand +--! @return {{prefix}}_internal.ore_block_256 The high bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.hi(r {{prefix}}.query_double_range_ore) +RETURNS {{prefix}}_internal.ore_block_256 +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ore_block_256(jsonb_build_object('ob', r::jsonb -> 'hi')) $$; + +--! @brief The low bound of a {{prefix}}.query_double_range_ope, as a CLLW OPE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_double_range_ope Range query operand +--! @return {{prefix}}_internal.ope_cllw The low bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.lo(r {{prefix}}.query_double_range_ope) +RETURNS {{prefix}}_internal.ope_cllw +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> 'lo')) $$; + +--! @brief The high bound of a {{prefix}}.query_double_range_ope, as a CLLW OPE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_double_range_ope Range query operand +--! @return {{prefix}}_internal.ope_cllw The high bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.hi(r {{prefix}}.query_double_range_ope) +RETURNS {{prefix}}_internal.ope_cllw +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> 'hi')) $$; + +--! @brief Whether a public.{{prefix}}_double_ord_ore value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_double_range_ore)`. +--! +--! @param a public.{{prefix}}_double_ord_ore Encrypted column value +--! @param r {{prefix}}.query_double_range_ore Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term_ore(a)`, which a btree index on that expression +--! serves as one range scan. For this ORE range that index needs the +--! default btree operator class on {{prefix}}_internal.ore_block_256, which the +--! installer creates only with superuser privileges. Without it (on Supabase, +--! for instance) the installer disables the ORE column domains and this ORE range, +--! so use an OPE column (`public.{{prefix}}_double_ord`, `public.{{prefix}}_double_ord_ope`) +--! and `{{prefix}}.query_double_range_ope`, which index everywhere. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_double_range_ore`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_double_ord_ore, r {{prefix}}.query_double_range_ore) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_double_ord value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_double_range_ope)`. +--! +--! @param a public.{{prefix}}_double_ord Encrypted column value +--! @param r {{prefix}}.query_double_range_ope Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term(a)`, which a btree index on that expression +--! serves as one range scan. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_double_range_ope`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_double_ord, r {{prefix}}.query_double_range_ope) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_double_ord_ope value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_double_range_ope)`. +--! +--! @param a public.{{prefix}}_double_ord_ope Encrypted column value +--! @param r {{prefix}}.query_double_range_ope Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term(a)`, which a btree index on that expression +--! serves as one range scan. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_double_range_ope`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_double_ord_ope, r {{prefix}}.query_double_range_ope) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r) $$; diff --git a/packages/eql/src/v3/scalars/double/query_double_range_types.sql b/packages/eql/src/v3/scalars/double/query_double_range_types.sql new file mode 100644 index 000000000..4939fa339 --- /dev/null +++ b/packages/eql/src/v3/scalars/double/query_double_range_types.sql @@ -0,0 +1,107 @@ +-- AUTOMATICALLY GENERATED FILE. +-- ONLY EQL VERSION: 4 +-- REQUIRE: src/v3/schema.sql +-- REQUIRE: src/v3/scalars/ore_fallback.sql + +--! @file v3/scalars/double/query_double_range_types.sql +--! @brief Range query-operand domains for double: the operand of `{{prefix}}.between`. +--! @note A range holds both bounds of one `BETWEEN` as one value: +--! `{"v": {{eql_version}}, "i": {...}, "lo": , "hi": }`. Each bound is the +--! single-bound query domain's `ob` (ORE) or `op` (OPE) value, in a +--! `{v, i, lo, hi}` envelope. Both bounds are included. There is one +--! range domain per ordering term the family stores (ADR-0009, +--! decisions 7 and 8). +--! @note Cast the range parameter to its exact range domain +--! (`$1::{{prefix}}.query_double_range_ore`). An uncast `$1`, a `jsonb` +--! parameter, or a range of another term or family fails with 42725 +--! ("function ... is not unique"); see `{{prefix}}.between`. +--! @note EQL version {{eql_version}} only: the `-- ONLY EQL VERSION:` line above keeps this +--! file out of every other version's installer. +--! @note Like every query operand, a range lives in `{{prefix}}`, not `public`, +--! and holds no ciphertext `c`. A range whose low bound is above its +--! high bound matches no row, as with SQL `BETWEEN`; the SQL does not +--! reorder the bounds. +--! @note On an install without the ORE operator class (a non-superuser +--! install, on Supabase for instance), the ORE range domain is disabled +--! as the single-bound ORE domains are: a value cast to it raises +--! `feature_not_supported`, naming the OPE range. See +--! `v3/scalars/ore_fallback.sql`. + +DO $$ +BEGIN + --! @brief Range query-operand domain {{prefix}}.query_double_range_ore (two block ORE bounds; no `c`). + IF NOT EXISTS ( + SELECT 1 FROM pg_type + WHERE typname = 'query_double_range_ore' AND typnamespace = '{{prefix}}'::regnamespace + ) THEN + CREATE DOMAIN {{prefix}}.query_double_range_ore AS jsonb + CHECK ( + jsonb_typeof(VALUE) = 'object' + AND VALUE ? 'v' + AND VALUE ? 'i' + AND VALUE ? 'lo' + AND VALUE ? 'hi' + AND NOT (VALUE ? 'c') + AND jsonb_typeof(VALUE -> 'lo') = 'array' + AND jsonb_array_length(VALUE -> 'lo') > 0 + AND jsonb_typeof(VALUE -> 'hi') = 'array' + AND jsonb_array_length(VALUE -> 'hi') > 0 + -- `"v": null` makes the comparison NULL, and a CHECK that is NULL + -- passes, so COALESCE refuses it. A NULL range still passes (no row + -- matches it). The comparison keeps the one form the v4 isolation + -- gate accepts. + AND COALESCE(VALUE->>'v' = '{{eql_version}}', VALUE IS NULL) + ); + END IF; + + COMMENT ON DOMAIN {{prefix}}.query_double_range_ore IS 'EQL double range query operand (block ORE)'; + + --! @brief Range query-operand domain {{prefix}}.query_double_range_ope (two CLLW OPE bounds; no `c`). + IF NOT EXISTS ( + SELECT 1 FROM pg_type + WHERE typname = 'query_double_range_ope' AND typnamespace = '{{prefix}}'::regnamespace + ) THEN + CREATE DOMAIN {{prefix}}.query_double_range_ope AS jsonb + CHECK ( + jsonb_typeof(VALUE) = 'object' + AND VALUE ? 'v' + AND VALUE ? 'i' + AND VALUE ? 'lo' + AND VALUE ? 'hi' + AND NOT (VALUE ? 'c') + AND jsonb_typeof(VALUE -> 'lo') = 'string' + AND jsonb_typeof(VALUE -> 'hi') = 'string' + -- `"v": null` makes the comparison NULL, and a CHECK that is NULL + -- passes, so COALESCE refuses it. A NULL range still passes (no row + -- matches it). The comparison keeps the one form the v4 isolation + -- gate accepts. + AND COALESCE(VALUE->>'v' = '{{eql_version}}', VALUE IS NULL) + ); + END IF; + + COMMENT ON DOMAIN {{prefix}}.query_double_range_ope IS 'EQL double range query operand (CLLW OPE)'; +END +$$; + +-- Without the default btree operator class on {{prefix}}_internal.ore_block_256 +-- (the installer skips it on insufficient_privilege), ore_fallback.sql has +-- created {{prefix}}_internal.ore_domain_unavailable and poisoned the +-- single-bound ORE domains. It cannot reach this ORE range, which exists in +-- EQL v4 only, so the same NOT VALID poison CHECK is added here. +DO $do$ +BEGIN + IF EXISTS ( + SELECT 1 + FROM pg_catalog.pg_opclass c + JOIN pg_catalog.pg_am am ON am.oid = c.opcmethod + WHERE am.amname = 'btree' + AND c.opcdefault + AND c.opcintype = '{{prefix}}_internal.ore_block_256'::pg_catalog.regtype + ) THEN + RETURN; + END IF; + + ALTER DOMAIN {{prefix}}.query_double_range_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, '{{prefix}}.query_double_range_ore', '{{prefix}}.query_double_range_ope (range)')) NOT VALID; +END; +$do$; diff --git a/packages/eql/src/v3/scalars/double/query_double_types.sql b/packages/eql/src/v3/scalars/double/query_double_types.sql index 87362cdfc..9ab265bf5 100644 --- a/packages/eql/src/v3/scalars/double/query_double_types.sql +++ b/packages/eql/src/v3/scalars/double/query_double_types.sql @@ -3,41 +3,41 @@ --! @file v3/scalars/double/query_double_types.sql --! @brief Query-operand domains for double (index-terms-only, no ciphertext). ---! @note Query-operand domains live in `eql_v3` (not `public`): they are +--! @note Query-operand domains live in `{{prefix}}` (not `public`): they are --! never valid column types, so they don't belong in the column-type --! namespace, and dropping the EQL-owned schema can never drop an --! application column. --! @note Cast a query operand explicitly to its `query_` domain in a predicate ---! (e.g. `WHERE col = $1::eql_v3.query_double_eq`). A bare, +--! (e.g. `WHERE col = $1::{{prefix}}.query_double_eq`). A bare, --! uncast literal RHS is ambiguous between the `query_` and `jsonb` --! operator overloads and will not resolve. DO $$ BEGIN - --! @brief Query-operand domain eql_v3.query_double_eq (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_double_eq (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_double_eq' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_double_eq' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_double_eq AS jsonb + CREATE DOMAIN {{prefix}}.query_double_eq AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'hm' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_double_eq IS 'EQL double query operand (equality)'; + COMMENT ON DOMAIN {{prefix}}.query_double_eq IS 'EQL double query operand (equality)'; - --! @brief Query-operand domain eql_v3.query_double_ord_ore (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_double_ord_ore (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_double_ord_ore' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_double_ord_ore' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_double_ord_ore AS jsonb + CREATE DOMAIN {{prefix}}.query_double_ord_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -46,46 +46,46 @@ BEGIN AND NOT (VALUE ? 'c') AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_double_ord_ore IS 'EQL double query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_double_ord_ore IS 'EQL double query operand (equality, ordering)'; - --! @brief Query-operand domain eql_v3.query_double_ord (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_double_ord (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_double_ord' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_double_ord' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_double_ord AS jsonb + CREATE DOMAIN {{prefix}}.query_double_ord AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'op' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_double_ord IS 'EQL double query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_double_ord IS 'EQL double query operand (equality, ordering)'; - --! @brief Query-operand domain eql_v3.query_double_ord_ope (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_double_ord_ope (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_double_ord_ope' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_double_ord_ope' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_double_ord_ope AS jsonb + CREATE DOMAIN {{prefix}}.query_double_ord_ope AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'op' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_double_ord_ope IS 'EQL double query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_double_ord_ope IS 'EQL double query operand (equality, ordering)'; END $$; diff --git a/packages/eql/src/v3/scalars/functions.sql b/packages/eql/src/v3/scalars/functions.sql index 3d6b7b3da..1376a4719 100644 --- a/packages/eql/src/v3/scalars/functions.sql +++ b/packages/eql/src/v3/scalars/functions.sql @@ -1,7 +1,7 @@ -- REQUIRE: src/v3/schema.sql --! @file v3/scalars/functions.sql ---! @brief Shared blocker helper for the eql_v3 encrypted-domain families. +--! @brief Shared blocker helper for the {{prefix}} encrypted-domain families. --! --! Per-domain wrapper functions live in src/v3/scalars//. --! Blockers in those files delegate to encrypted_domain_unsupported_bool @@ -12,10 +12,10 @@ --! @brief Shared blocker helper. Raises 'operator X is not supported --! for TYPE' so unsupported domain operators surface a clear --! error rather than fall through to native jsonb behaviour. ---! @param type_name Domain type name (eql_v3.*) +--! @param type_name Domain type name ({{prefix}}.*) --! @param operator_name Operator symbol (=, <, @>, ->, etc.) --! @return boolean (never returns; always raises) -CREATE FUNCTION eql_v3_internal.encrypted_domain_unsupported_bool(type_name text, operator_name text) +CREATE FUNCTION {{prefix}}_internal.encrypted_domain_unsupported_bool(type_name text, operator_name text) RETURNS boolean IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public @@ -30,10 +30,10 @@ $$ LANGUAGE plpgsql; --! native operators whose result is jsonb (#>, -, #-, ||), so composed --! expressions resolve and the body raises rather than failing earlier --! with a misleading 'operator does not exist' on a boolean result. ---! @param type_name Domain type name (eql_v3.*) +--! @param type_name Domain type name ({{prefix}}.*) --! @param operator_name Operator symbol (#>, -, #-, ||, etc.) --! @return jsonb (never returns; always raises) -CREATE FUNCTION eql_v3_internal.encrypted_domain_unsupported_jsonb(type_name text, operator_name text) +CREATE FUNCTION {{prefix}}_internal.encrypted_domain_unsupported_jsonb(type_name text, operator_name text) RETURNS jsonb IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public @@ -46,10 +46,10 @@ $$ LANGUAGE plpgsql; --! @brief Shared blocker helper returning text. Identical to --! encrypted_domain_unsupported_bool but typed for blockers shadowing --! the native #>> operator whose result is text. ---! @param type_name Domain type name (eql_v3.*) +--! @param type_name Domain type name ({{prefix}}.*) --! @param operator_name Operator symbol (#>>) --! @return text (never returns; always raises) -CREATE FUNCTION eql_v3_internal.encrypted_domain_unsupported_text(type_name text, operator_name text) +CREATE FUNCTION {{prefix}}_internal.encrypted_domain_unsupported_text(type_name text, operator_name text) RETURNS text IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public diff --git a/packages/eql/src/v3/scalars/integer/integer_eq_functions.sql b/packages/eql/src/v3/scalars/integer/integer_eq_functions.sql index 80e3e01d6..8247eb048 100644 --- a/packages/eql/src/v3/scalars/integer/integer_eq_functions.sql +++ b/packages/eql/src/v3/scalars/integer/integer_eq_functions.sql @@ -5,634 +5,634 @@ -- REQUIRE: src/v3/sem/hmac_256/functions.sql --! @file encrypted_domain/integer/integer_eq_functions.sql ---! @brief Functions for public.eql_v3_integer_eq. +--! @brief Functions for public.{{prefix}}_integer_eq. ---! @brief Index extractor for public.eql_v3_integer_eq. ---! @param a public.eql_v3_integer_eq ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a public.eql_v3_integer_eq) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for public.{{prefix}}_integer_eq. +--! @param a public.{{prefix}}_integer_eq +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a public.{{prefix}}_integer_eq) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_integer_eq. ---! @param a public.eql_v3_integer_eq ---! @param b public.eql_v3_integer_eq +--! @brief Operator wrapper for public.{{prefix}}_integer_eq. +--! @param a public.{{prefix}}_integer_eq +--! @param b public.{{prefix}}_integer_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_integer_eq, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_eq, b public.{{prefix}}_integer_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_eq. ---! @param a public.eql_v3_integer_eq +--! @brief Operator wrapper for public.{{prefix}}_integer_eq. +--! @param a public.{{prefix}}_integer_eq --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_integer_eq, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b::public.eql_v3_integer_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_integer_eq) $$; ---! @brief Operator wrapper for public.eql_v3_integer_eq. +--! @brief Operator wrapper for public.{{prefix}}_integer_eq. --! @param a jsonb ---! @param b public.eql_v3_integer_eq +--! @param b public.{{prefix}}_integer_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_integer_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_integer_eq) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_integer_eq) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_eq. ---! @param a public.eql_v3_integer_eq ---! @param b public.eql_v3_integer_eq +--! @brief Operator wrapper for public.{{prefix}}_integer_eq. +--! @param a public.{{prefix}}_integer_eq +--! @param b public.{{prefix}}_integer_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_integer_eq, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_eq, b public.{{prefix}}_integer_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_eq. ---! @param a public.eql_v3_integer_eq +--! @brief Operator wrapper for public.{{prefix}}_integer_eq. +--! @param a public.{{prefix}}_integer_eq --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_integer_eq, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b::public.eql_v3_integer_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_integer_eq) $$; ---! @brief Operator wrapper for public.eql_v3_integer_eq. +--! @brief Operator wrapper for public.{{prefix}}_integer_eq. --! @param a jsonb ---! @param b public.eql_v3_integer_eq +--! @param b public.{{prefix}}_integer_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_integer_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_integer_eq) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_integer_eq) <> {{prefix}}.eq_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator ---! @param b public.eql_v3_integer_eq right operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator +--! @param b public.{{prefix}}_integer_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_integer_eq, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_integer_eq, b public.{{prefix}}_integer_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_integer_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_integer_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_eq right operand of the blocked operator +--! @param b public.{{prefix}}_integer_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_integer_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator ---! @param b public.eql_v3_integer_eq right operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator +--! @param b public.{{prefix}}_integer_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_integer_eq, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_integer_eq, b public.{{prefix}}_integer_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_integer_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_integer_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_eq right operand of the blocked operator +--! @param b public.{{prefix}}_integer_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_integer_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator ---! @param b public.eql_v3_integer_eq right operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator +--! @param b public.{{prefix}}_integer_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_integer_eq, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_integer_eq, b public.{{prefix}}_integer_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_integer_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_integer_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_eq right operand of the blocked operator +--! @param b public.{{prefix}}_integer_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_integer_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator ---! @param b public.eql_v3_integer_eq right operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator +--! @param b public.{{prefix}}_integer_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_integer_eq, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_integer_eq, b public.{{prefix}}_integer_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_integer_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_integer_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_eq right operand of the blocked operator +--! @param b public.{{prefix}}_integer_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_integer_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator ---! @param b public.eql_v3_integer_eq right operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator +--! @param b public.{{prefix}}_integer_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_integer_eq, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_integer_eq, b public.{{prefix}}_integer_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_integer_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_integer_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_eq right operand of the blocked operator +--! @param b public.{{prefix}}_integer_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_integer_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator ---! @param b public.eql_v3_integer_eq right operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator +--! @param b public.{{prefix}}_integer_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_integer_eq, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_integer_eq, b public.{{prefix}}_integer_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_integer_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_integer_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_eq right operand of the blocked operator +--! @param b public.{{prefix}}_integer_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_integer_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_integer_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_integer_eq, selector text) -RETURNS public.eql_v3_integer_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_integer_eq'; END; $$ +--! @return public.{{prefix}}_integer_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_integer_eq, selector text) +RETURNS public.{{prefix}}_integer_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_integer_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_integer_eq, selector integer) -RETURNS public.eql_v3_integer_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_integer_eq'; END; $$ +--! @return public.{{prefix}}_integer_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_integer_eq, selector integer) +RETURNS public.{{prefix}}_integer_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_integer_eq right operand of the blocked operator ---! @return public.eql_v3_integer_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_integer_eq) -RETURNS public.eql_v3_integer_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_integer_eq'; END; $$ +--! @param selector public.{{prefix}}_integer_eq right operand of the blocked operator +--! @return public.{{prefix}}_integer_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_integer_eq) +RETURNS public.{{prefix}}_integer_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_integer_eq, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_integer_eq, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_integer_eq, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_integer_eq, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_integer_eq right operand of the blocked operator +--! @param selector public.{{prefix}}_integer_eq right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_integer_eq) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_integer_eq, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_integer_eq, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_integer_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_integer_eq, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_integer_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_integer_eq, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_integer_eq, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_integer_eq, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator ---! @param b public.eql_v3_integer_eq right operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator +--! @param b public.{{prefix}}_integer_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_integer_eq, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_integer_eq, b public.{{prefix}}_integer_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_integer_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_integer_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_eq right operand of the blocked operator +--! @param b public.{{prefix}}_integer_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_integer_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_integer_eq, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_integer_eq, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_integer_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_integer_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_integer_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_integer_eq, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_integer_eq, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_integer_eq, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_integer_eq, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_integer_eq, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_integer_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_integer_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_integer_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_integer_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator ---! @param b public.eql_v3_integer_eq right operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator +--! @param b public.{{prefix}}_integer_eq right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_integer_eq, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_integer_eq, b public.{{prefix}}_integer_eq) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_eq left operand of the blocked operator +--! @param a public.{{prefix}}_integer_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_integer_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_integer_eq, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_eq right operand of the blocked operator +--! @param b public.{{prefix}}_integer_eq right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_integer_eq) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_integer_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_integer_eq'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/integer/integer_eq_operators.sql b/packages/eql/src/v3/scalars/integer/integer_eq_operators.sql index 2848d6fe1..39a296bf6 100644 --- a/packages/eql/src/v3/scalars/integer/integer_eq_operators.sql +++ b/packages/eql/src/v3/scalars/integer/integer_eq_operators.sql @@ -4,245 +4,245 @@ -- REQUIRE: src/v3/scalars/integer/integer_eq_functions.sql --! @file encrypted_domain/integer/integer_eq_operators.sql ---! @brief Operators for public.eql_v3_integer_eq. +--! @brief Operators for public.{{prefix}}_integer_eq. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = public.eql_v3_integer_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = public.{{prefix}}_integer_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = public.eql_v3_integer_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = public.{{prefix}}_integer_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = public.eql_v3_integer_eq + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = public.{{prefix}}_integer_eq ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_eq + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_eq ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = public.eql_v3_integer_eq + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = public.{{prefix}}_integer_eq ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_eq + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_eq ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = public.eql_v3_integer_eq + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = public.{{prefix}}_integer_eq ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_eq + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_eq ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = public.eql_v3_integer_eq + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = public.{{prefix}}_integer_eq ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_eq + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_eq ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = public.eql_v3_integer_eq + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = public.{{prefix}}_integer_eq ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_eq + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_eq ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = public.eql_v3_integer_eq + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = public.{{prefix}}_integer_eq ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_eq + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_eq ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_eq + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_eq ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_eq + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_eq ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = public.eql_v3_integer_eq + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = public.{{prefix}}_integer_eq ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_eq + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_eq ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = public.eql_v3_integer_eq + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = public.{{prefix}}_integer_eq ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_eq + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_eq ); diff --git a/packages/eql/src/v3/scalars/integer/integer_functions.sql b/packages/eql/src/v3/scalars/integer/integer_functions.sql index c6fe4631d..560626ecb 100644 --- a/packages/eql/src/v3/scalars/integer/integer_functions.sql +++ b/packages/eql/src/v3/scalars/integer/integer_functions.sql @@ -4,662 +4,662 @@ -- REQUIRE: src/v3/scalars/functions.sql --! @file encrypted_domain/integer/integer_functions.sql ---! @brief Functions for public.eql_v3_integer. +--! @brief Functions for public.{{prefix}}_integer. ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_integer, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_integer, b public.{{prefix}}_integer) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_integer, b jsonb) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_integer, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a jsonb, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal.eq(a jsonb, b public.{{prefix}}_integer) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_integer, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_integer, b public.{{prefix}}_integer) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_integer, b jsonb) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_integer, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a jsonb, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal.neq(a jsonb, b public.{{prefix}}_integer) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_integer, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_integer, b public.{{prefix}}_integer) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_integer, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_integer, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_integer) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_integer, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_integer, b public.{{prefix}}_integer) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_integer, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_integer, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_integer) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_integer, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_integer, b public.{{prefix}}_integer) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_integer, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_integer, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_integer) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_integer, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_integer, b public.{{prefix}}_integer) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_integer, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_integer, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_integer) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_integer, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_integer, b public.{{prefix}}_integer) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_integer, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_integer, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_integer) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_integer, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_integer, b public.{{prefix}}_integer) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_integer, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_integer, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_integer) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_integer never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_integer, selector text) -RETURNS public.eql_v3_integer IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_integer'; END; $$ +--! @return public.{{prefix}}_integer never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_integer, selector text) +RETURNS public.{{prefix}}_integer IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_integer never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_integer, selector integer) -RETURNS public.eql_v3_integer IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_integer'; END; $$ +--! @return public.{{prefix}}_integer never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_integer, selector integer) +RETURNS public.{{prefix}}_integer IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_integer right operand of the blocked operator ---! @return public.eql_v3_integer never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_integer) -RETURNS public.eql_v3_integer IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_integer'; END; $$ +--! @param selector public.{{prefix}}_integer right operand of the blocked operator +--! @return public.{{prefix}}_integer never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_integer) +RETURNS public.{{prefix}}_integer IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_integer, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_integer, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_integer, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_integer, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_integer right operand of the blocked operator +--! @param selector public.{{prefix}}_integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_integer, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_integer, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_integer, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_integer, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_integer, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_integer, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_integer, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_integer, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_integer, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_integer, b public.{{prefix}}_integer) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_integer, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_integer, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_integer) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_integer, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_integer, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_integer, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_integer, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_integer, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_integer, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_integer, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_integer, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_integer, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_integer, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_integer, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_integer, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_integer, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_integer, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_integer, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_integer, b public.{{prefix}}_integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer left operand of the blocked operator +--! @param a public.{{prefix}}_integer left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_integer, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_integer, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer right operand of the blocked operator +--! @param b public.{{prefix}}_integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_integer) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_integer'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_integer'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/integer/integer_operators.sql b/packages/eql/src/v3/scalars/integer/integer_operators.sql index 476bbd5cf..14c37d131 100644 --- a/packages/eql/src/v3/scalars/integer/integer_operators.sql +++ b/packages/eql/src/v3/scalars/integer/integer_operators.sql @@ -4,239 +4,239 @@ -- REQUIRE: src/v3/scalars/integer/integer_functions.sql --! @file encrypted_domain/integer/integer_operators.sql ---! @brief Operators for public.eql_v3_integer. +--! @brief Operators for public.{{prefix}}_integer. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_integer, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_integer, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_integer, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_integer, RIGHTARG = jsonb ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_integer, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_integer, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_integer, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_integer, RIGHTARG = jsonb ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_integer, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_integer, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_integer, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_integer, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_integer, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_integer, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_integer, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_integer, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_integer, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_integer, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_integer, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_integer, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_integer, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_integer, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_integer, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_integer, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_integer, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_integer, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_integer, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_integer, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_integer, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_integer, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_integer, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_integer, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_integer, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_integer, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_integer, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_integer, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_integer, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_integer, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_integer, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_integer, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_integer, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_integer, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_integer, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_integer, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_integer, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_integer, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_integer, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_integer, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_integer, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_integer, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_integer, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_integer, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_integer, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_integer, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_integer, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_integer, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_integer, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_integer, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_integer, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_integer, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_integer, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_integer, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_integer, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_integer, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_integer, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_integer, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_integer, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_integer, RIGHTARG = public.{{prefix}}_integer ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_integer, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_integer, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer ); diff --git a/packages/eql/src/v3/scalars/integer/integer_ord_aggregates.sql b/packages/eql/src/v3/scalars/integer/integer_ord_aggregates.sql index 2f7ead251..7be4947f8 100644 --- a/packages/eql/src/v3/scalars/integer/integer_ord_aggregates.sql +++ b/packages/eql/src/v3/scalars/integer/integer_ord_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/integer/integer_ord_operators.sql --! @file encrypted_domain/integer/integer_ord_aggregates.sql ---! @brief Aggregates for public.eql_v3_integer_ord. +--! @brief Aggregates for public.{{prefix}}_integer_ord. ---! @brief State function for min on public.eql_v3_integer_ord. ---! @param state public.eql_v3_integer_ord ---! @param value public.eql_v3_integer_ord ---! @return public.eql_v3_integer_ord -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_integer_ord, value public.eql_v3_integer_ord) -RETURNS public.eql_v3_integer_ord +--! @brief State function for min on public.{{prefix}}_integer_ord. +--! @param state public.{{prefix}}_integer_ord +--! @param value public.{{prefix}}_integer_ord +--! @return public.{{prefix}}_integer_ord +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_integer_ord, value public.{{prefix}}_integer_ord) +RETURNS public.{{prefix}}_integer_ord LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_integer_ord. ---! @param input public.eql_v3_integer_ord ---! @return public.eql_v3_integer_ord -CREATE AGGREGATE eql_v3.min(public.eql_v3_integer_ord) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_integer_ord, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_integer_ord. +--! @param input public.{{prefix}}_integer_ord +--! @return public.{{prefix}}_integer_ord +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_integer_ord) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_integer_ord, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_integer_ord. ---! @param state public.eql_v3_integer_ord ---! @param value public.eql_v3_integer_ord ---! @return public.eql_v3_integer_ord -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_integer_ord, value public.eql_v3_integer_ord) -RETURNS public.eql_v3_integer_ord +--! @brief State function for max on public.{{prefix}}_integer_ord. +--! @param state public.{{prefix}}_integer_ord +--! @param value public.{{prefix}}_integer_ord +--! @return public.{{prefix}}_integer_ord +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_integer_ord, value public.{{prefix}}_integer_ord) +RETURNS public.{{prefix}}_integer_ord LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_integer_ord. ---! @param input public.eql_v3_integer_ord ---! @return public.eql_v3_integer_ord -CREATE AGGREGATE eql_v3.max(public.eql_v3_integer_ord) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_integer_ord, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_integer_ord. +--! @param input public.{{prefix}}_integer_ord +--! @return public.{{prefix}}_integer_ord +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_integer_ord) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_integer_ord, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/integer/integer_ord_functions.sql b/packages/eql/src/v3/scalars/integer/integer_ord_functions.sql index ae6de7ef8..b1ba2ddae 100644 --- a/packages/eql/src/v3/scalars/integer/integer_ord_functions.sql +++ b/packages/eql/src/v3/scalars/integer/integer_ord_functions.sql @@ -5,562 +5,562 @@ -- REQUIRE: src/v3/sem/ope_cllw/functions.sql --! @file encrypted_domain/integer/integer_ord_functions.sql ---! @brief Functions for public.eql_v3_integer_ord. +--! @brief Functions for public.{{prefix}}_integer_ord. ---! @brief Index extractor for public.eql_v3_integer_ord. ---! @param a public.eql_v3_integer_ord ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a public.eql_v3_integer_ord) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for public.{{prefix}}_integer_ord. +--! @param a public.{{prefix}}_integer_ord +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a public.{{prefix}}_integer_ord) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord. ---! @param a public.eql_v3_integer_ord ---! @param b public.eql_v3_integer_ord +--! @brief Operator wrapper for public.{{prefix}}_integer_ord. +--! @param a public.{{prefix}}_integer_ord +--! @param b public.{{prefix}}_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_integer_ord, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord. ---! @param a public.eql_v3_integer_ord +--! @brief Operator wrapper for public.{{prefix}}_integer_ord. +--! @param a public.{{prefix}}_integer_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_integer_ord, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b::public.eql_v3_integer_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord. +--! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a jsonb ---! @param b public.eql_v3_integer_ord +--! @param b public.{{prefix}}_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_integer_ord) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord. ---! @param a public.eql_v3_integer_ord ---! @param b public.eql_v3_integer_ord +--! @brief Operator wrapper for public.{{prefix}}_integer_ord. +--! @param a public.{{prefix}}_integer_ord +--! @param b public.{{prefix}}_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_integer_ord, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord. ---! @param a public.eql_v3_integer_ord +--! @brief Operator wrapper for public.{{prefix}}_integer_ord. +--! @param a public.{{prefix}}_integer_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_integer_ord, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b::public.eql_v3_integer_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord. +--! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a jsonb ---! @param b public.eql_v3_integer_ord +--! @param b public.{{prefix}}_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_integer_ord) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord. ---! @param a public.eql_v3_integer_ord ---! @param b public.eql_v3_integer_ord +--! @brief Operator wrapper for public.{{prefix}}_integer_ord. +--! @param a public.{{prefix}}_integer_ord +--! @param b public.{{prefix}}_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_integer_ord, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord. ---! @param a public.eql_v3_integer_ord +--! @brief Operator wrapper for public.{{prefix}}_integer_ord. +--! @param a public.{{prefix}}_integer_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_integer_ord, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_integer_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b::public.eql_v3_integer_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord. +--! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a jsonb ---! @param b public.eql_v3_integer_ord +--! @param b public.{{prefix}}_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_integer_ord) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord. ---! @param a public.eql_v3_integer_ord ---! @param b public.eql_v3_integer_ord +--! @brief Operator wrapper for public.{{prefix}}_integer_ord. +--! @param a public.{{prefix}}_integer_ord +--! @param b public.{{prefix}}_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_integer_ord, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord. ---! @param a public.eql_v3_integer_ord +--! @brief Operator wrapper for public.{{prefix}}_integer_ord. +--! @param a public.{{prefix}}_integer_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_integer_ord, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_integer_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b::public.eql_v3_integer_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord. +--! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a jsonb ---! @param b public.eql_v3_integer_ord +--! @param b public.{{prefix}}_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_integer_ord) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord. ---! @param a public.eql_v3_integer_ord ---! @param b public.eql_v3_integer_ord +--! @brief Operator wrapper for public.{{prefix}}_integer_ord. +--! @param a public.{{prefix}}_integer_ord +--! @param b public.{{prefix}}_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_integer_ord, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord. ---! @param a public.eql_v3_integer_ord +--! @brief Operator wrapper for public.{{prefix}}_integer_ord. +--! @param a public.{{prefix}}_integer_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_integer_ord, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_integer_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b::public.eql_v3_integer_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord. +--! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a jsonb ---! @param b public.eql_v3_integer_ord +--! @param b public.{{prefix}}_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_integer_ord) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord. ---! @param a public.eql_v3_integer_ord ---! @param b public.eql_v3_integer_ord +--! @brief Operator wrapper for public.{{prefix}}_integer_ord. +--! @param a public.{{prefix}}_integer_ord +--! @param b public.{{prefix}}_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_integer_ord, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord. ---! @param a public.eql_v3_integer_ord +--! @brief Operator wrapper for public.{{prefix}}_integer_ord. +--! @param a public.{{prefix}}_integer_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_integer_ord, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_integer_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b::public.eql_v3_integer_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord. +--! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a jsonb ---! @param b public.eql_v3_integer_ord +--! @param b public.{{prefix}}_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_integer_ord) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator ---! @param b public.eql_v3_integer_ord right operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_integer_ord, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_integer_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_integer_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_ord right operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_integer_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator ---! @param b public.eql_v3_integer_ord right operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_integer_ord, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_integer_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_integer_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_ord right operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_integer_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_integer_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_integer_ord, selector text) -RETURNS public.eql_v3_integer_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_integer_ord'; END; $$ +--! @return public.{{prefix}}_integer_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_integer_ord, selector text) +RETURNS public.{{prefix}}_integer_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_integer_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_integer_ord, selector integer) -RETURNS public.eql_v3_integer_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_integer_ord'; END; $$ +--! @return public.{{prefix}}_integer_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_integer_ord, selector integer) +RETURNS public.{{prefix}}_integer_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_integer_ord right operand of the blocked operator ---! @return public.eql_v3_integer_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_integer_ord) -RETURNS public.eql_v3_integer_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_integer_ord'; END; $$ +--! @param selector public.{{prefix}}_integer_ord right operand of the blocked operator +--! @return public.{{prefix}}_integer_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_integer_ord) +RETURNS public.{{prefix}}_integer_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_integer_ord, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_integer_ord, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_integer_ord, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_integer_ord, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_integer_ord right operand of the blocked operator +--! @param selector public.{{prefix}}_integer_ord right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_integer_ord) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_integer_ord, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_integer_ord, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_integer_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_integer_ord, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_integer_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_integer_ord, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_integer_ord, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_integer_ord, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator ---! @param b public.eql_v3_integer_ord right operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_integer_ord, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_integer_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_integer_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_ord right operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_integer_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_integer_ord, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_integer_ord, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_integer_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_integer_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_integer_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_integer_ord, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_integer_ord, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_integer_ord, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_integer_ord, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_integer_ord, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_integer_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_integer_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_integer_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_integer_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator ---! @param b public.eql_v3_integer_ord right operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_integer_ord, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_integer_ord, b public.{{prefix}}_integer_ord) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_integer_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_integer_ord, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_ord right operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_integer_ord) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_integer_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_integer_ord'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/integer/integer_ord_ope_aggregates.sql b/packages/eql/src/v3/scalars/integer/integer_ord_ope_aggregates.sql index 7249ef061..059178bbd 100644 --- a/packages/eql/src/v3/scalars/integer/integer_ord_ope_aggregates.sql +++ b/packages/eql/src/v3/scalars/integer/integer_ord_ope_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/integer/integer_ord_ope_operators.sql --! @file encrypted_domain/integer/integer_ord_ope_aggregates.sql ---! @brief Aggregates for public.eql_v3_integer_ord_ope. +--! @brief Aggregates for public.{{prefix}}_integer_ord_ope. ---! @brief State function for min on public.eql_v3_integer_ord_ope. ---! @param state public.eql_v3_integer_ord_ope ---! @param value public.eql_v3_integer_ord_ope ---! @return public.eql_v3_integer_ord_ope -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_integer_ord_ope, value public.eql_v3_integer_ord_ope) -RETURNS public.eql_v3_integer_ord_ope +--! @brief State function for min on public.{{prefix}}_integer_ord_ope. +--! @param state public.{{prefix}}_integer_ord_ope +--! @param value public.{{prefix}}_integer_ord_ope +--! @return public.{{prefix}}_integer_ord_ope +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_integer_ord_ope, value public.{{prefix}}_integer_ord_ope) +RETURNS public.{{prefix}}_integer_ord_ope LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_integer_ord_ope. ---! @param input public.eql_v3_integer_ord_ope ---! @return public.eql_v3_integer_ord_ope -CREATE AGGREGATE eql_v3.min(public.eql_v3_integer_ord_ope) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_integer_ord_ope, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_integer_ord_ope. +--! @param input public.{{prefix}}_integer_ord_ope +--! @return public.{{prefix}}_integer_ord_ope +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_integer_ord_ope) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_integer_ord_ope, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_integer_ord_ope. ---! @param state public.eql_v3_integer_ord_ope ---! @param value public.eql_v3_integer_ord_ope ---! @return public.eql_v3_integer_ord_ope -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_integer_ord_ope, value public.eql_v3_integer_ord_ope) -RETURNS public.eql_v3_integer_ord_ope +--! @brief State function for max on public.{{prefix}}_integer_ord_ope. +--! @param state public.{{prefix}}_integer_ord_ope +--! @param value public.{{prefix}}_integer_ord_ope +--! @return public.{{prefix}}_integer_ord_ope +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_integer_ord_ope, value public.{{prefix}}_integer_ord_ope) +RETURNS public.{{prefix}}_integer_ord_ope LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_integer_ord_ope. ---! @param input public.eql_v3_integer_ord_ope ---! @return public.eql_v3_integer_ord_ope -CREATE AGGREGATE eql_v3.max(public.eql_v3_integer_ord_ope) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_integer_ord_ope, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_integer_ord_ope. +--! @param input public.{{prefix}}_integer_ord_ope +--! @return public.{{prefix}}_integer_ord_ope +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_integer_ord_ope) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_integer_ord_ope, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/integer/integer_ord_ope_functions.sql b/packages/eql/src/v3/scalars/integer/integer_ord_ope_functions.sql index 68d4b9e2a..dc9b5a81b 100644 --- a/packages/eql/src/v3/scalars/integer/integer_ord_ope_functions.sql +++ b/packages/eql/src/v3/scalars/integer/integer_ord_ope_functions.sql @@ -5,562 +5,562 @@ -- REQUIRE: src/v3/sem/ope_cllw/functions.sql --! @file encrypted_domain/integer/integer_ord_ope_functions.sql ---! @brief Functions for public.eql_v3_integer_ord_ope. +--! @brief Functions for public.{{prefix}}_integer_ord_ope. ---! @brief Index extractor for public.eql_v3_integer_ord_ope. ---! @param a public.eql_v3_integer_ord_ope ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a public.eql_v3_integer_ord_ope) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for public.{{prefix}}_integer_ord_ope. +--! @param a public.{{prefix}}_integer_ord_ope +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a public.{{prefix}}_integer_ord_ope) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ope. ---! @param a public.eql_v3_integer_ord_ope ---! @param b public.eql_v3_integer_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. +--! @param a public.{{prefix}}_integer_ord_ope +--! @param b public.{{prefix}}_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_integer_ord_ope, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_ord_ope, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ope. ---! @param a public.eql_v3_integer_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. +--! @param a public.{{prefix}}_integer_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_integer_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b::public.eql_v3_integer_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_integer_ord_ope +--! @param b public.{{prefix}}_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_integer_ord_ope) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ope. ---! @param a public.eql_v3_integer_ord_ope ---! @param b public.eql_v3_integer_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. +--! @param a public.{{prefix}}_integer_ord_ope +--! @param b public.{{prefix}}_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_integer_ord_ope, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_ord_ope, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ope. ---! @param a public.eql_v3_integer_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. +--! @param a public.{{prefix}}_integer_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_integer_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b::public.eql_v3_integer_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_integer_ord_ope +--! @param b public.{{prefix}}_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_integer_ord_ope) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ope. ---! @param a public.eql_v3_integer_ord_ope ---! @param b public.eql_v3_integer_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. +--! @param a public.{{prefix}}_integer_ord_ope +--! @param b public.{{prefix}}_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_integer_ord_ope, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_integer_ord_ope, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ope. ---! @param a public.eql_v3_integer_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. +--! @param a public.{{prefix}}_integer_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_integer_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_integer_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b::public.eql_v3_integer_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_integer_ord_ope +--! @param b public.{{prefix}}_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_integer_ord_ope) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ope. ---! @param a public.eql_v3_integer_ord_ope ---! @param b public.eql_v3_integer_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. +--! @param a public.{{prefix}}_integer_ord_ope +--! @param b public.{{prefix}}_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_integer_ord_ope, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_integer_ord_ope, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ope. ---! @param a public.eql_v3_integer_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. +--! @param a public.{{prefix}}_integer_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_integer_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_integer_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b::public.eql_v3_integer_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_integer_ord_ope +--! @param b public.{{prefix}}_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_integer_ord_ope) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ope. ---! @param a public.eql_v3_integer_ord_ope ---! @param b public.eql_v3_integer_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. +--! @param a public.{{prefix}}_integer_ord_ope +--! @param b public.{{prefix}}_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_integer_ord_ope, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_integer_ord_ope, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ope. ---! @param a public.eql_v3_integer_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. +--! @param a public.{{prefix}}_integer_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_integer_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_integer_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b::public.eql_v3_integer_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_integer_ord_ope +--! @param b public.{{prefix}}_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_integer_ord_ope) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ope. ---! @param a public.eql_v3_integer_ord_ope ---! @param b public.eql_v3_integer_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. +--! @param a public.{{prefix}}_integer_ord_ope +--! @param b public.{{prefix}}_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_integer_ord_ope, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_integer_ord_ope, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ope. ---! @param a public.eql_v3_integer_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. +--! @param a public.{{prefix}}_integer_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_integer_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_integer_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b::public.eql_v3_integer_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_integer_ord_ope +--! @param b public.{{prefix}}_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_integer_ord_ope) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_integer_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_integer_ord_ope, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_integer_ord_ope, b public.{{prefix}}_integer_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_integer_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_integer_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_integer_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_integer_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_integer_ord_ope, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_integer_ord_ope, b public.{{prefix}}_integer_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_integer_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_integer_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_integer_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_integer_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_integer_ord_ope, selector text) -RETURNS public.eql_v3_integer_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_integer_ord_ope'; END; $$ +--! @return public.{{prefix}}_integer_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_integer_ord_ope, selector text) +RETURNS public.{{prefix}}_integer_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_integer_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_integer_ord_ope, selector integer) -RETURNS public.eql_v3_integer_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_integer_ord_ope'; END; $$ +--! @return public.{{prefix}}_integer_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_integer_ord_ope, selector integer) +RETURNS public.{{prefix}}_integer_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_integer_ord_ope right operand of the blocked operator ---! @return public.eql_v3_integer_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_integer_ord_ope) -RETURNS public.eql_v3_integer_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_integer_ord_ope'; END; $$ +--! @param selector public.{{prefix}}_integer_ord_ope right operand of the blocked operator +--! @return public.{{prefix}}_integer_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_integer_ord_ope) +RETURNS public.{{prefix}}_integer_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_integer_ord_ope, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_integer_ord_ope, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_integer_ord_ope, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_integer_ord_ope, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_integer_ord_ope right operand of the blocked operator +--! @param selector public.{{prefix}}_integer_ord_ope right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_integer_ord_ope) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_integer_ord_ope, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_integer_ord_ope, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_integer_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_integer_ord_ope, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_integer_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_integer_ord_ope, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_integer_ord_ope, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_integer_ord_ope, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_integer_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_integer_ord_ope, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_integer_ord_ope, b public.{{prefix}}_integer_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_integer_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_integer_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_integer_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_integer_ord_ope, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_integer_ord_ope, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_integer_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_integer_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_integer_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_integer_ord_ope, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_integer_ord_ope, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_integer_ord_ope, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_integer_ord_ope, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_integer_ord_ope, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_integer_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_integer_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_integer_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_integer_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_integer_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord_ope right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_integer_ord_ope, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_integer_ord_ope, b public.{{prefix}}_integer_ord_ope) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_integer_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_integer_ord_ope, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord_ope right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_integer_ord_ope) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_integer_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_integer_ord_ope'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/integer/integer_ord_ope_operators.sql b/packages/eql/src/v3/scalars/integer/integer_ord_ope_operators.sql index 8f8c319a8..7ff34c060 100644 --- a/packages/eql/src/v3/scalars/integer/integer_ord_ope_operators.sql +++ b/packages/eql/src/v3/scalars/integer/integer_ord_ope_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/integer/integer_ord_ope_functions.sql --! @file encrypted_domain/integer/integer_ord_ope_operators.sql ---! @brief Operators for public.eql_v3_integer_ord_ope. +--! @brief Operators for public.{{prefix}}_integer_ord_ope. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = public.eql_v3_integer_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = public.eql_v3_integer_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = public.eql_v3_integer_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = public.eql_v3_integer_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = public.eql_v3_integer_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = public.eql_v3_integer_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = public.eql_v3_integer_ord_ope + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ope ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ope + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ope ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = public.eql_v3_integer_ord_ope + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ope ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ope + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ope ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ope + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ope ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ope + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ope ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = public.eql_v3_integer_ord_ope + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ope ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ope + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ope ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = public.eql_v3_integer_ord_ope + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ope ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ope + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ope ); diff --git a/packages/eql/src/v3/scalars/integer/integer_ord_operators.sql b/packages/eql/src/v3/scalars/integer/integer_ord_operators.sql index f5d9dcaa5..241961bb2 100644 --- a/packages/eql/src/v3/scalars/integer/integer_ord_operators.sql +++ b/packages/eql/src/v3/scalars/integer/integer_ord_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/integer/integer_ord_functions.sql --! @file encrypted_domain/integer/integer_ord_operators.sql ---! @brief Operators for public.eql_v3_integer_ord. +--! @brief Operators for public.{{prefix}}_integer_ord. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = public.eql_v3_integer_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = public.eql_v3_integer_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = public.eql_v3_integer_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = public.eql_v3_integer_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = public.eql_v3_integer_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = public.eql_v3_integer_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = public.eql_v3_integer_ord + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = public.eql_v3_integer_ord + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = public.eql_v3_integer_ord + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = public.eql_v3_integer_ord + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord ); diff --git a/packages/eql/src/v3/scalars/integer/integer_ord_ore_aggregates.sql b/packages/eql/src/v3/scalars/integer/integer_ord_ore_aggregates.sql index d920423b0..e3a488d93 100644 --- a/packages/eql/src/v3/scalars/integer/integer_ord_ore_aggregates.sql +++ b/packages/eql/src/v3/scalars/integer/integer_ord_ore_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/integer/integer_ord_ore_operators.sql --! @file encrypted_domain/integer/integer_ord_ore_aggregates.sql ---! @brief Aggregates for public.eql_v3_integer_ord_ore. +--! @brief Aggregates for public.{{prefix}}_integer_ord_ore. ---! @brief State function for min on public.eql_v3_integer_ord_ore. ---! @param state public.eql_v3_integer_ord_ore ---! @param value public.eql_v3_integer_ord_ore ---! @return public.eql_v3_integer_ord_ore -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_integer_ord_ore, value public.eql_v3_integer_ord_ore) -RETURNS public.eql_v3_integer_ord_ore +--! @brief State function for min on public.{{prefix}}_integer_ord_ore. +--! @param state public.{{prefix}}_integer_ord_ore +--! @param value public.{{prefix}}_integer_ord_ore +--! @return public.{{prefix}}_integer_ord_ore +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_integer_ord_ore, value public.{{prefix}}_integer_ord_ore) +RETURNS public.{{prefix}}_integer_ord_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_integer_ord_ore. ---! @param input public.eql_v3_integer_ord_ore ---! @return public.eql_v3_integer_ord_ore -CREATE AGGREGATE eql_v3.min(public.eql_v3_integer_ord_ore) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_integer_ord_ore, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_integer_ord_ore. +--! @param input public.{{prefix}}_integer_ord_ore +--! @return public.{{prefix}}_integer_ord_ore +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_integer_ord_ore) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_integer_ord_ore, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_integer_ord_ore. ---! @param state public.eql_v3_integer_ord_ore ---! @param value public.eql_v3_integer_ord_ore ---! @return public.eql_v3_integer_ord_ore -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_integer_ord_ore, value public.eql_v3_integer_ord_ore) -RETURNS public.eql_v3_integer_ord_ore +--! @brief State function for max on public.{{prefix}}_integer_ord_ore. +--! @param state public.{{prefix}}_integer_ord_ore +--! @param value public.{{prefix}}_integer_ord_ore +--! @return public.{{prefix}}_integer_ord_ore +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_integer_ord_ore, value public.{{prefix}}_integer_ord_ore) +RETURNS public.{{prefix}}_integer_ord_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_integer_ord_ore. ---! @param input public.eql_v3_integer_ord_ore ---! @return public.eql_v3_integer_ord_ore -CREATE AGGREGATE eql_v3.max(public.eql_v3_integer_ord_ore) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_integer_ord_ore, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_integer_ord_ore. +--! @param input public.{{prefix}}_integer_ord_ore +--! @return public.{{prefix}}_integer_ord_ore +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_integer_ord_ore) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_integer_ord_ore, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/integer/integer_ord_ore_functions.sql b/packages/eql/src/v3/scalars/integer/integer_ord_ore_functions.sql index e4518aa9b..4bfd5d2eb 100644 --- a/packages/eql/src/v3/scalars/integer/integer_ord_ore_functions.sql +++ b/packages/eql/src/v3/scalars/integer/integer_ord_ore_functions.sql @@ -6,562 +6,562 @@ -- REQUIRE: src/v3/sem/ore_block_256/operators.sql --! @file encrypted_domain/integer/integer_ord_ore_functions.sql ---! @brief Functions for public.eql_v3_integer_ord_ore. +--! @brief Functions for public.{{prefix}}_integer_ord_ore. ---! @brief Index extractor for public.eql_v3_integer_ord_ore. ---! @param a public.eql_v3_integer_ord_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a public.eql_v3_integer_ord_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for public.{{prefix}}_integer_ord_ore. +--! @param a public.{{prefix}}_integer_ord_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a public.{{prefix}}_integer_ord_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ore. ---! @param a public.eql_v3_integer_ord_ore ---! @param b public.eql_v3_integer_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. +--! @param a public.{{prefix}}_integer_ord_ore +--! @param b public.{{prefix}}_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_integer_ord_ore, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_ord_ore, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ore. ---! @param a public.eql_v3_integer_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. +--! @param a public.{{prefix}}_integer_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_integer_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b::public.eql_v3_integer_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{prefix}}_integer_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_integer_ord_ore +--! @param b public.{{prefix}}_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_integer_ord_ore) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ore. ---! @param a public.eql_v3_integer_ord_ore ---! @param b public.eql_v3_integer_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. +--! @param a public.{{prefix}}_integer_ord_ore +--! @param b public.{{prefix}}_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_integer_ord_ore, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_ord_ore, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ore. ---! @param a public.eql_v3_integer_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. +--! @param a public.{{prefix}}_integer_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_integer_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b::public.eql_v3_integer_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{prefix}}_integer_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_integer_ord_ore +--! @param b public.{{prefix}}_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_integer_ord_ore) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ore. ---! @param a public.eql_v3_integer_ord_ore ---! @param b public.eql_v3_integer_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. +--! @param a public.{{prefix}}_integer_ord_ore +--! @param b public.{{prefix}}_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_integer_ord_ore, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_integer_ord_ore, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ore. ---! @param a public.eql_v3_integer_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. +--! @param a public.{{prefix}}_integer_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_integer_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_integer_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b::public.eql_v3_integer_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_integer_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_integer_ord_ore +--! @param b public.{{prefix}}_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_integer_ord_ore) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ore. ---! @param a public.eql_v3_integer_ord_ore ---! @param b public.eql_v3_integer_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. +--! @param a public.{{prefix}}_integer_ord_ore +--! @param b public.{{prefix}}_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_integer_ord_ore, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_integer_ord_ore, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ore. ---! @param a public.eql_v3_integer_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. +--! @param a public.{{prefix}}_integer_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_integer_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_integer_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b::public.eql_v3_integer_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_integer_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_integer_ord_ore +--! @param b public.{{prefix}}_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_integer_ord_ore) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ore. ---! @param a public.eql_v3_integer_ord_ore ---! @param b public.eql_v3_integer_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. +--! @param a public.{{prefix}}_integer_ord_ore +--! @param b public.{{prefix}}_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_integer_ord_ore, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_integer_ord_ore, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ore. ---! @param a public.eql_v3_integer_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. +--! @param a public.{{prefix}}_integer_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_integer_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_integer_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b::public.eql_v3_integer_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_integer_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_integer_ord_ore +--! @param b public.{{prefix}}_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_integer_ord_ore) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ore. ---! @param a public.eql_v3_integer_ord_ore ---! @param b public.eql_v3_integer_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. +--! @param a public.{{prefix}}_integer_ord_ore +--! @param b public.{{prefix}}_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_integer_ord_ore, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_integer_ord_ore, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ore. ---! @param a public.eql_v3_integer_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. +--! @param a public.{{prefix}}_integer_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_integer_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_integer_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b::public.eql_v3_integer_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_integer_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_integer_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_integer_ord_ore +--! @param b public.{{prefix}}_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_integer_ord_ore) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_integer_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_integer_ord_ore, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_integer_ord_ore, b public.{{prefix}}_integer_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_integer_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_integer_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_integer_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_integer_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_integer_ord_ore, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_integer_ord_ore, b public.{{prefix}}_integer_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_integer_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_integer_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_integer_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_integer_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_integer_ord_ore, selector text) -RETURNS public.eql_v3_integer_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_integer_ord_ore'; END; $$ +--! @return public.{{prefix}}_integer_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_integer_ord_ore, selector text) +RETURNS public.{{prefix}}_integer_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_integer_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_integer_ord_ore, selector integer) -RETURNS public.eql_v3_integer_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_integer_ord_ore'; END; $$ +--! @return public.{{prefix}}_integer_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_integer_ord_ore, selector integer) +RETURNS public.{{prefix}}_integer_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_integer_ord_ore right operand of the blocked operator ---! @return public.eql_v3_integer_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_integer_ord_ore) -RETURNS public.eql_v3_integer_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_integer_ord_ore'; END; $$ +--! @param selector public.{{prefix}}_integer_ord_ore right operand of the blocked operator +--! @return public.{{prefix}}_integer_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_integer_ord_ore) +RETURNS public.{{prefix}}_integer_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_integer_ord_ore, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_integer_ord_ore, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_integer_ord_ore, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_integer_ord_ore, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_integer_ord_ore right operand of the blocked operator +--! @param selector public.{{prefix}}_integer_ord_ore right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_integer_ord_ore) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_integer_ord_ore, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_integer_ord_ore, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_integer_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_integer_ord_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_integer_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_integer_ord_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_integer_ord_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_integer_ord_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_integer_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_integer_ord_ore, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_integer_ord_ore, b public.{{prefix}}_integer_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_integer_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_integer_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_integer_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_integer_ord_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_integer_ord_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_integer_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_integer_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_integer_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_integer_ord_ore, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_integer_ord_ore, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_integer_ord_ore, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_integer_ord_ore, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_integer_ord_ore, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_integer_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_integer_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_integer_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_integer_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_integer_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_integer_ord_ore, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_integer_ord_ore, b public.{{prefix}}_integer_ord_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_integer_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_integer_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_integer_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_integer_ord_ore, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_integer_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_integer_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_integer_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_integer_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_integer_ord_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_integer_ord_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_integer_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_integer_ord_ore'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/integer/integer_ord_ore_operators.sql b/packages/eql/src/v3/scalars/integer/integer_ord_ore_operators.sql index ed50f6297..16126e76c 100644 --- a/packages/eql/src/v3/scalars/integer/integer_ord_ore_operators.sql +++ b/packages/eql/src/v3/scalars/integer/integer_ord_ore_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/integer/integer_ord_ore_functions.sql --! @file encrypted_domain/integer/integer_ord_ore_operators.sql ---! @brief Operators for public.eql_v3_integer_ord_ore. +--! @brief Operators for public.{{prefix}}_integer_ord_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = public.eql_v3_integer_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = public.eql_v3_integer_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = public.eql_v3_integer_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = public.eql_v3_integer_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = public.eql_v3_integer_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = public.eql_v3_integer_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = public.eql_v3_integer_ord_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ore ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = public.eql_v3_integer_ord_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ore ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ore + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ore ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ore + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ore ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = public.eql_v3_integer_ord_ore + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ore ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ore + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ore ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = public.eql_v3_integer_ord_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ore ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_integer_ord_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_integer_ord_ore ); diff --git a/packages/eql/src/v3/scalars/integer/integer_types.sql b/packages/eql/src/v3/scalars/integer/integer_types.sql index 94e791d99..b10c0ad7f 100644 --- a/packages/eql/src/v3/scalars/integer/integer_types.sql +++ b/packages/eql/src/v3/scalars/integer/integer_types.sql @@ -6,47 +6,47 @@ DO $$ BEGIN - --! @brief Encrypted domain public.eql_v3_integer. + --! @brief Encrypted domain public.{{prefix}}_integer. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_integer' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_integer' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_integer AS jsonb + CREATE DOMAIN public.{{prefix}}_integer AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_integer IS 'EQL encrypted integer (storage only)'; + COMMENT ON DOMAIN public.{{prefix}}_integer IS 'EQL encrypted integer (storage only)'; - --! @brief Encrypted domain public.eql_v3_integer_eq. + --! @brief Encrypted domain public.{{prefix}}_integer_eq. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_integer_eq' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_integer_eq' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_integer_eq AS jsonb + CREATE DOMAIN public.{{prefix}}_integer_eq AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'hm' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_integer_eq IS 'EQL encrypted integer (equality)'; + COMMENT ON DOMAIN public.{{prefix}}_integer_eq IS 'EQL encrypted integer (equality)'; - --! @brief Encrypted domain public.eql_v3_integer_ord_ore. + --! @brief Encrypted domain public.{{prefix}}_integer_ord_ore. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_integer_ord_ore' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_integer_ord_ore' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_integer_ord_ore AS jsonb + CREATE DOMAIN public.{{prefix}}_integer_ord_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -55,46 +55,46 @@ BEGIN AND VALUE ? 'ob' AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_integer_ord_ore IS 'EQL encrypted integer (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_integer_ord_ore IS 'EQL encrypted integer (equality, ordering)'; - --! @brief Encrypted domain public.eql_v3_integer_ord. + --! @brief Encrypted domain public.{{prefix}}_integer_ord. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_integer_ord' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_integer_ord' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_integer_ord AS jsonb + CREATE DOMAIN public.{{prefix}}_integer_ord AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'op' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_integer_ord IS 'EQL encrypted integer (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_integer_ord IS 'EQL encrypted integer (equality, ordering)'; - --! @brief Encrypted domain public.eql_v3_integer_ord_ope. + --! @brief Encrypted domain public.{{prefix}}_integer_ord_ope. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_integer_ord_ope' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_integer_ord_ope' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_integer_ord_ope AS jsonb + CREATE DOMAIN public.{{prefix}}_integer_ord_ope AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'op' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_integer_ord_ope IS 'EQL encrypted integer (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_integer_ord_ope IS 'EQL encrypted integer (equality, ordering)'; END $$; diff --git a/packages/eql/src/v3/scalars/integer/json_entry_integer_functions.sql b/packages/eql/src/v3/scalars/integer/json_entry_integer_functions.sql index f48c4e855..b46db4e60 100644 --- a/packages/eql/src/v3/scalars/integer/json_entry_integer_functions.sql +++ b/packages/eql/src/v3/scalars/integer/json_entry_integer_functions.sql @@ -7,244 +7,244 @@ -- REQUIRE: src/v3/scalars/integer/query_integer_ord_ope_functions.sql --! @file encrypted_domain/integer/json_entry_integer_functions.sql ---! @brief Functions for public.eql_v3_json_entry. +--! @brief Functions for public.{{prefix}}_json_entry. ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_integer_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_integer_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json_entry, b eql_v3.query_integer_ord) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json_entry, b {{prefix}}.query_integer_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_integer_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_integer_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a eql_v3.query_integer_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_integer_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_integer_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_integer_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json_entry, b eql_v3.query_integer_ord) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json_entry, b {{prefix}}.query_integer_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_integer_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_integer_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a eql_v3.query_integer_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_integer_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_integer_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_json_entry, b eql_v3.query_integer_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_integer_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_integer_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_integer_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_integer_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_integer_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_json_entry, b eql_v3.query_integer_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_integer_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_integer_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_integer_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_integer_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_integer_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_json_entry, b eql_v3.query_integer_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_integer_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_integer_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_integer_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_integer_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_integer_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_json_entry, b eql_v3.query_integer_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_integer_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_integer_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_integer_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_integer_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_integer_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_integer_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json_entry, b eql_v3.query_integer_ord_ope) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json_entry, b {{prefix}}.query_integer_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_integer_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_integer_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a eql_v3.query_integer_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_integer_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_integer_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json_entry, b eql_v3.query_integer_ord_ope) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json_entry, b {{prefix}}.query_integer_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_integer_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_integer_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a eql_v3.query_integer_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_integer_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_json_entry, b eql_v3.query_integer_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_integer_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_integer_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_integer_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_integer_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_json_entry, b eql_v3.query_integer_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_integer_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_integer_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_integer_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_integer_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_json_entry, b eql_v3.query_integer_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_integer_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_integer_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_integer_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_integer_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_json_entry, b eql_v3.query_integer_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_integer_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_integer_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_integer_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/integer/json_entry_integer_operators.sql b/packages/eql/src/v3/scalars/integer/json_entry_integer_operators.sql index a8b63c55b..f58a9ca2c 100644 --- a/packages/eql/src/v3/scalars/integer/json_entry_integer_operators.sql +++ b/packages/eql/src/v3/scalars/integer/json_entry_integer_operators.sql @@ -5,140 +5,140 @@ -- REQUIRE: src/v3/scalars/integer/json_entry_integer_functions.sql --! @file encrypted_domain/integer/json_entry_integer_operators.sql ---! @brief Operators for public.eql_v3_json_entry. +--! @brief Operators for public.{{prefix}}_json_entry. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_integer_ord + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_integer_ord ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = eql_v3.query_integer_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_integer_ord + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_integer_ord ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = eql_v3.query_integer_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_integer_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_integer_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_integer_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_integer_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_integer_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_integer_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_integer_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_integer_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_integer_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_integer_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_integer_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_integer_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_integer_ord_ope + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_integer_ord_ope ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = eql_v3.query_integer_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_integer_ord_ope + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_integer_ord_ope ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = eql_v3.query_integer_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_integer_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_integer_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_integer_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_integer_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_integer_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_integer_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_integer_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_integer_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_integer_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_integer_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_integer_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_integer_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/integer/query_integer_eq_functions.sql b/packages/eql/src/v3/scalars/integer/query_integer_eq_functions.sql index de478f5a7..003be0b36 100644 --- a/packages/eql/src/v3/scalars/integer/query_integer_eq_functions.sql +++ b/packages/eql/src/v3/scalars/integer/query_integer_eq_functions.sql @@ -4,44 +4,44 @@ -- REQUIRE: src/v3/scalars/integer/integer_eq_functions.sql --! @file encrypted_domain/integer/query_integer_eq_functions.sql ---! @brief Functions for eql_v3.query_integer_eq. +--! @brief Functions for {{prefix}}.query_integer_eq. ---! @brief Index extractor for eql_v3.query_integer_eq. ---! @param a eql_v3.query_integer_eq ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a eql_v3.query_integer_eq) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for {{prefix}}.query_integer_eq. +--! @param a {{prefix}}.query_integer_eq +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a {{prefix}}.query_integer_eq) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_integer_eq. ---! @param a public.eql_v3_integer_eq ---! @param b eql_v3.query_integer_eq +--! @brief Operator wrapper for {{prefix}}.query_integer_eq. +--! @param a public.{{prefix}}_integer_eq +--! @param b {{prefix}}.query_integer_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_integer_eq, b eql_v3.query_integer_eq) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_eq, b {{prefix}}.query_integer_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_eq. ---! @param a eql_v3.query_integer_eq ---! @param b public.eql_v3_integer_eq +--! @brief Operator wrapper for {{prefix}}.query_integer_eq. +--! @param a {{prefix}}.query_integer_eq +--! @param b public.{{prefix}}_integer_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_integer_eq, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_integer_eq, b public.{{prefix}}_integer_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_eq. ---! @param a public.eql_v3_integer_eq ---! @param b eql_v3.query_integer_eq +--! @brief Operator wrapper for {{prefix}}.query_integer_eq. +--! @param a public.{{prefix}}_integer_eq +--! @param b {{prefix}}.query_integer_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_integer_eq, b eql_v3.query_integer_eq) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_eq, b {{prefix}}.query_integer_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_eq. ---! @param a eql_v3.query_integer_eq ---! @param b public.eql_v3_integer_eq +--! @brief Operator wrapper for {{prefix}}.query_integer_eq. +--! @param a {{prefix}}.query_integer_eq +--! @param b public.{{prefix}}_integer_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_integer_eq, b public.eql_v3_integer_eq) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_integer_eq, b public.{{prefix}}_integer_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; diff --git a/packages/eql/src/v3/scalars/integer/query_integer_eq_operators.sql b/packages/eql/src/v3/scalars/integer/query_integer_eq_operators.sql index 527d5f7eb..70693b1e7 100644 --- a/packages/eql/src/v3/scalars/integer/query_integer_eq_operators.sql +++ b/packages/eql/src/v3/scalars/integer/query_integer_eq_operators.sql @@ -4,28 +4,28 @@ -- REQUIRE: src/v3/scalars/integer/query_integer_eq_functions.sql --! @file encrypted_domain/integer/query_integer_eq_operators.sql ---! @brief Operators for eql_v3.query_integer_eq. +--! @brief Operators for {{prefix}}.query_integer_eq. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = eql_v3.query_integer_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = {{prefix}}.query_integer_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_integer_eq, RIGHTARG = public.eql_v3_integer_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_integer_eq, RIGHTARG = public.{{prefix}}_integer_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_integer_eq, RIGHTARG = eql_v3.query_integer_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = {{prefix}}.query_integer_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_integer_eq, RIGHTARG = public.eql_v3_integer_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_integer_eq, RIGHTARG = public.{{prefix}}_integer_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); diff --git a/packages/eql/src/v3/scalars/integer/query_integer_ord_functions.sql b/packages/eql/src/v3/scalars/integer/query_integer_ord_functions.sql index c730a223a..ad0592020 100644 --- a/packages/eql/src/v3/scalars/integer/query_integer_ord_functions.sql +++ b/packages/eql/src/v3/scalars/integer/query_integer_ord_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/integer/integer_ord_functions.sql --! @file encrypted_domain/integer/query_integer_ord_functions.sql ---! @brief Functions for eql_v3.query_integer_ord. +--! @brief Functions for {{prefix}}.query_integer_ord. ---! @brief Index extractor for eql_v3.query_integer_ord. ---! @param a eql_v3.query_integer_ord ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a eql_v3.query_integer_ord) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for {{prefix}}.query_integer_ord. +--! @param a {{prefix}}.query_integer_ord +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a {{prefix}}.query_integer_ord) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord. ---! @param a public.eql_v3_integer_ord ---! @param b eql_v3.query_integer_ord +--! @brief Operator wrapper for {{prefix}}.query_integer_ord. +--! @param a public.{{prefix}}_integer_ord +--! @param b {{prefix}}.query_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_integer_ord, b eql_v3.query_integer_ord) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord. ---! @param a eql_v3.query_integer_ord ---! @param b public.eql_v3_integer_ord +--! @brief Operator wrapper for {{prefix}}.query_integer_ord. +--! @param a {{prefix}}.query_integer_ord +--! @param b public.{{prefix}}_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_integer_ord, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord. ---! @param a public.eql_v3_integer_ord ---! @param b eql_v3.query_integer_ord +--! @brief Operator wrapper for {{prefix}}.query_integer_ord. +--! @param a public.{{prefix}}_integer_ord +--! @param b {{prefix}}.query_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_integer_ord, b eql_v3.query_integer_ord) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord. ---! @param a eql_v3.query_integer_ord ---! @param b public.eql_v3_integer_ord +--! @brief Operator wrapper for {{prefix}}.query_integer_ord. +--! @param a {{prefix}}.query_integer_ord +--! @param b public.{{prefix}}_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_integer_ord, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord. ---! @param a public.eql_v3_integer_ord ---! @param b eql_v3.query_integer_ord +--! @brief Operator wrapper for {{prefix}}.query_integer_ord. +--! @param a public.{{prefix}}_integer_ord +--! @param b {{prefix}}.query_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_integer_ord, b eql_v3.query_integer_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord. ---! @param a eql_v3.query_integer_ord ---! @param b public.eql_v3_integer_ord +--! @brief Operator wrapper for {{prefix}}.query_integer_ord. +--! @param a {{prefix}}.query_integer_ord +--! @param b public.{{prefix}}_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_integer_ord, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord. ---! @param a public.eql_v3_integer_ord ---! @param b eql_v3.query_integer_ord +--! @brief Operator wrapper for {{prefix}}.query_integer_ord. +--! @param a public.{{prefix}}_integer_ord +--! @param b {{prefix}}.query_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_integer_ord, b eql_v3.query_integer_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord. ---! @param a eql_v3.query_integer_ord ---! @param b public.eql_v3_integer_ord +--! @brief Operator wrapper for {{prefix}}.query_integer_ord. +--! @param a {{prefix}}.query_integer_ord +--! @param b public.{{prefix}}_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_integer_ord, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord. ---! @param a public.eql_v3_integer_ord ---! @param b eql_v3.query_integer_ord +--! @brief Operator wrapper for {{prefix}}.query_integer_ord. +--! @param a public.{{prefix}}_integer_ord +--! @param b {{prefix}}.query_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_integer_ord, b eql_v3.query_integer_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord. ---! @param a eql_v3.query_integer_ord ---! @param b public.eql_v3_integer_ord +--! @brief Operator wrapper for {{prefix}}.query_integer_ord. +--! @param a {{prefix}}.query_integer_ord +--! @param b public.{{prefix}}_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_integer_ord, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord. ---! @param a public.eql_v3_integer_ord ---! @param b eql_v3.query_integer_ord +--! @brief Operator wrapper for {{prefix}}.query_integer_ord. +--! @param a public.{{prefix}}_integer_ord +--! @param b {{prefix}}.query_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_integer_ord, b eql_v3.query_integer_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord. ---! @param a eql_v3.query_integer_ord ---! @param b public.eql_v3_integer_ord +--! @brief Operator wrapper for {{prefix}}.query_integer_ord. +--! @param a {{prefix}}.query_integer_ord +--! @param b public.{{prefix}}_integer_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_integer_ord, b public.eql_v3_integer_ord) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/integer/query_integer_ord_ope_functions.sql b/packages/eql/src/v3/scalars/integer/query_integer_ord_ope_functions.sql index 3ee5f5ad9..6f643a649 100644 --- a/packages/eql/src/v3/scalars/integer/query_integer_ord_ope_functions.sql +++ b/packages/eql/src/v3/scalars/integer/query_integer_ord_ope_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/integer/integer_ord_ope_functions.sql --! @file encrypted_domain/integer/query_integer_ord_ope_functions.sql ---! @brief Functions for eql_v3.query_integer_ord_ope. +--! @brief Functions for {{prefix}}.query_integer_ord_ope. ---! @brief Index extractor for eql_v3.query_integer_ord_ope. ---! @param a eql_v3.query_integer_ord_ope ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a eql_v3.query_integer_ord_ope) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for {{prefix}}.query_integer_ord_ope. +--! @param a {{prefix}}.query_integer_ord_ope +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a {{prefix}}.query_integer_ord_ope) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ope. ---! @param a public.eql_v3_integer_ord_ope ---! @param b eql_v3.query_integer_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. +--! @param a public.{{prefix}}_integer_ord_ope +--! @param b {{prefix}}.query_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_integer_ord_ope, b eql_v3.query_integer_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ope. ---! @param a eql_v3.query_integer_ord_ope ---! @param b public.eql_v3_integer_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. +--! @param a {{prefix}}.query_integer_ord_ope +--! @param b public.{{prefix}}_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_integer_ord_ope, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ope. ---! @param a public.eql_v3_integer_ord_ope ---! @param b eql_v3.query_integer_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. +--! @param a public.{{prefix}}_integer_ord_ope +--! @param b {{prefix}}.query_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_integer_ord_ope, b eql_v3.query_integer_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ope. ---! @param a eql_v3.query_integer_ord_ope ---! @param b public.eql_v3_integer_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. +--! @param a {{prefix}}.query_integer_ord_ope +--! @param b public.{{prefix}}_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_integer_ord_ope, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ope. ---! @param a public.eql_v3_integer_ord_ope ---! @param b eql_v3.query_integer_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. +--! @param a public.{{prefix}}_integer_ord_ope +--! @param b {{prefix}}.query_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_integer_ord_ope, b eql_v3.query_integer_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ope. ---! @param a eql_v3.query_integer_ord_ope ---! @param b public.eql_v3_integer_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. +--! @param a {{prefix}}.query_integer_ord_ope +--! @param b public.{{prefix}}_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_integer_ord_ope, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ope. ---! @param a public.eql_v3_integer_ord_ope ---! @param b eql_v3.query_integer_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. +--! @param a public.{{prefix}}_integer_ord_ope +--! @param b {{prefix}}.query_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_integer_ord_ope, b eql_v3.query_integer_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ope. ---! @param a eql_v3.query_integer_ord_ope ---! @param b public.eql_v3_integer_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. +--! @param a {{prefix}}.query_integer_ord_ope +--! @param b public.{{prefix}}_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_integer_ord_ope, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ope. ---! @param a public.eql_v3_integer_ord_ope ---! @param b eql_v3.query_integer_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. +--! @param a public.{{prefix}}_integer_ord_ope +--! @param b {{prefix}}.query_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_integer_ord_ope, b eql_v3.query_integer_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ope. ---! @param a eql_v3.query_integer_ord_ope ---! @param b public.eql_v3_integer_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. +--! @param a {{prefix}}.query_integer_ord_ope +--! @param b public.{{prefix}}_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_integer_ord_ope, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ope. ---! @param a public.eql_v3_integer_ord_ope ---! @param b eql_v3.query_integer_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. +--! @param a public.{{prefix}}_integer_ord_ope +--! @param b {{prefix}}.query_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_integer_ord_ope, b eql_v3.query_integer_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ope. ---! @param a eql_v3.query_integer_ord_ope ---! @param b public.eql_v3_integer_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. +--! @param a {{prefix}}.query_integer_ord_ope +--! @param b public.{{prefix}}_integer_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_integer_ord_ope, b public.eql_v3_integer_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/integer/query_integer_ord_ope_operators.sql b/packages/eql/src/v3/scalars/integer/query_integer_ord_ope_operators.sql index 7936100c4..fb5505e1b 100644 --- a/packages/eql/src/v3/scalars/integer/query_integer_ord_ope_operators.sql +++ b/packages/eql/src/v3/scalars/integer/query_integer_ord_ope_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/integer/query_integer_ord_ope_functions.sql --! @file encrypted_domain/integer/query_integer_ord_ope_operators.sql ---! @brief Operators for eql_v3.query_integer_ord_ope. +--! @brief Operators for {{prefix}}.query_integer_ord_ope. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = eql_v3.query_integer_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_integer_ord_ope, RIGHTARG = public.eql_v3_integer_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = eql_v3.query_integer_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_integer_ord_ope, RIGHTARG = public.eql_v3_integer_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = eql_v3.query_integer_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_integer_ord_ope, RIGHTARG = public.eql_v3_integer_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = eql_v3.query_integer_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_integer_ord_ope, RIGHTARG = public.eql_v3_integer_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = eql_v3.query_integer_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_integer_ord_ope, RIGHTARG = public.eql_v3_integer_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_integer_ord_ope, RIGHTARG = eql_v3.query_integer_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_integer_ord_ope, RIGHTARG = public.eql_v3_integer_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/integer/query_integer_ord_operators.sql b/packages/eql/src/v3/scalars/integer/query_integer_ord_operators.sql index df7da7cb5..786245e45 100644 --- a/packages/eql/src/v3/scalars/integer/query_integer_ord_operators.sql +++ b/packages/eql/src/v3/scalars/integer/query_integer_ord_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/integer/query_integer_ord_functions.sql --! @file encrypted_domain/integer/query_integer_ord_operators.sql ---! @brief Operators for eql_v3.query_integer_ord. +--! @brief Operators for {{prefix}}.query_integer_ord. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = eql_v3.query_integer_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_integer_ord, RIGHTARG = public.eql_v3_integer_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = eql_v3.query_integer_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_integer_ord, RIGHTARG = public.eql_v3_integer_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = eql_v3.query_integer_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_integer_ord, RIGHTARG = public.eql_v3_integer_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = eql_v3.query_integer_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_integer_ord, RIGHTARG = public.eql_v3_integer_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = eql_v3.query_integer_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_integer_ord, RIGHTARG = public.eql_v3_integer_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_integer_ord, RIGHTARG = eql_v3.query_integer_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_integer_ord, RIGHTARG = public.eql_v3_integer_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/integer/query_integer_ord_ore_functions.sql b/packages/eql/src/v3/scalars/integer/query_integer_ord_ore_functions.sql index c66973750..3578cfb1a 100644 --- a/packages/eql/src/v3/scalars/integer/query_integer_ord_ore_functions.sql +++ b/packages/eql/src/v3/scalars/integer/query_integer_ord_ore_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/integer/integer_ord_ore_functions.sql --! @file encrypted_domain/integer/query_integer_ord_ore_functions.sql ---! @brief Functions for eql_v3.query_integer_ord_ore. +--! @brief Functions for {{prefix}}.query_integer_ord_ore. ---! @brief Index extractor for eql_v3.query_integer_ord_ore. ---! @param a eql_v3.query_integer_ord_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a eql_v3.query_integer_ord_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for {{prefix}}.query_integer_ord_ore. +--! @param a {{prefix}}.query_integer_ord_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a {{prefix}}.query_integer_ord_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ore. ---! @param a public.eql_v3_integer_ord_ore ---! @param b eql_v3.query_integer_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. +--! @param a public.{{prefix}}_integer_ord_ore +--! @param b {{prefix}}.query_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_integer_ord_ore, b eql_v3.query_integer_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ore. ---! @param a eql_v3.query_integer_ord_ore ---! @param b public.eql_v3_integer_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. +--! @param a {{prefix}}.query_integer_ord_ore +--! @param b public.{{prefix}}_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_integer_ord_ore, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ore. ---! @param a public.eql_v3_integer_ord_ore ---! @param b eql_v3.query_integer_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. +--! @param a public.{{prefix}}_integer_ord_ore +--! @param b {{prefix}}.query_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_integer_ord_ore, b eql_v3.query_integer_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ore. ---! @param a eql_v3.query_integer_ord_ore ---! @param b public.eql_v3_integer_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. +--! @param a {{prefix}}.query_integer_ord_ore +--! @param b public.{{prefix}}_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_integer_ord_ore, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ore. ---! @param a public.eql_v3_integer_ord_ore ---! @param b eql_v3.query_integer_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. +--! @param a public.{{prefix}}_integer_ord_ore +--! @param b {{prefix}}.query_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_integer_ord_ore, b eql_v3.query_integer_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ore. ---! @param a eql_v3.query_integer_ord_ore ---! @param b public.eql_v3_integer_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. +--! @param a {{prefix}}.query_integer_ord_ore +--! @param b public.{{prefix}}_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_integer_ord_ore, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ore. ---! @param a public.eql_v3_integer_ord_ore ---! @param b eql_v3.query_integer_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. +--! @param a public.{{prefix}}_integer_ord_ore +--! @param b {{prefix}}.query_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_integer_ord_ore, b eql_v3.query_integer_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ore. ---! @param a eql_v3.query_integer_ord_ore ---! @param b public.eql_v3_integer_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. +--! @param a {{prefix}}.query_integer_ord_ore +--! @param b public.{{prefix}}_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_integer_ord_ore, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ore. ---! @param a public.eql_v3_integer_ord_ore ---! @param b eql_v3.query_integer_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. +--! @param a public.{{prefix}}_integer_ord_ore +--! @param b {{prefix}}.query_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_integer_ord_ore, b eql_v3.query_integer_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ore. ---! @param a eql_v3.query_integer_ord_ore ---! @param b public.eql_v3_integer_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. +--! @param a {{prefix}}.query_integer_ord_ore +--! @param b public.{{prefix}}_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_integer_ord_ore, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ore. ---! @param a public.eql_v3_integer_ord_ore ---! @param b eql_v3.query_integer_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. +--! @param a public.{{prefix}}_integer_ord_ore +--! @param b {{prefix}}.query_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_integer_ord_ore, b eql_v3.query_integer_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_integer_ord_ore. ---! @param a eql_v3.query_integer_ord_ore ---! @param b public.eql_v3_integer_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. +--! @param a {{prefix}}.query_integer_ord_ore +--! @param b public.{{prefix}}_integer_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_integer_ord_ore, b public.eql_v3_integer_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; diff --git a/packages/eql/src/v3/scalars/integer/query_integer_ord_ore_operators.sql b/packages/eql/src/v3/scalars/integer/query_integer_ord_ore_operators.sql index c1a6b6025..d897eac84 100644 --- a/packages/eql/src/v3/scalars/integer/query_integer_ord_ore_operators.sql +++ b/packages/eql/src/v3/scalars/integer/query_integer_ord_ore_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/integer/query_integer_ord_ore_functions.sql --! @file encrypted_domain/integer/query_integer_ord_ore_operators.sql ---! @brief Operators for eql_v3.query_integer_ord_ore. +--! @brief Operators for {{prefix}}.query_integer_ord_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = eql_v3.query_integer_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_integer_ord_ore, RIGHTARG = public.eql_v3_integer_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = eql_v3.query_integer_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_integer_ord_ore, RIGHTARG = public.eql_v3_integer_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = eql_v3.query_integer_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_integer_ord_ore, RIGHTARG = public.eql_v3_integer_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = eql_v3.query_integer_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_integer_ord_ore, RIGHTARG = public.eql_v3_integer_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = eql_v3.query_integer_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_integer_ord_ore, RIGHTARG = public.eql_v3_integer_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_integer_ord_ore, RIGHTARG = eql_v3.query_integer_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_integer_ord_ore, RIGHTARG = public.eql_v3_integer_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/integer/query_integer_range_functions.sql b/packages/eql/src/v3/scalars/integer/query_integer_range_functions.sql new file mode 100644 index 000000000..d05e5c03a --- /dev/null +++ b/packages/eql/src/v3/scalars/integer/query_integer_range_functions.sql @@ -0,0 +1,177 @@ +-- AUTOMATICALLY GENERATED FILE. +-- ONLY EQL VERSION: 4 +-- REQUIRE: src/v3/schema.sql +-- REQUIRE: src/v3/scalars/integer/query_integer_range_types.sql +-- REQUIRE: src/v3/scalars/integer/integer_ord_ore_functions.sql +-- REQUIRE: src/v3/scalars/integer/integer_ord_functions.sql +-- REQUIRE: src/v3/scalars/integer/integer_ord_ope_functions.sql +-- REQUIRE: src/v3/sem/ore_block_256/functions.sql +-- REQUIRE: src/v3/sem/ore_block_256/operators.sql +-- REQUIRE: src/v3/sem/ope_cllw/functions.sql + +--! @file v3/scalars/integer/query_integer_range_functions.sql +--! @brief The bound accessors and `{{prefix}}.between` for integer's range query domains. +--! @note EQL version {{eql_version}} only, like the range domains themselves. + +--! @brief The low bound of a {{prefix}}.query_integer_range_ore, as a block ORE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_integer_range_ore Range query operand +--! @return {{prefix}}_internal.ore_block_256 The low bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.lo(r {{prefix}}.query_integer_range_ore) +RETURNS {{prefix}}_internal.ore_block_256 +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ore_block_256(jsonb_build_object('ob', r::jsonb -> 'lo')) $$; + +--! @brief The high bound of a {{prefix}}.query_integer_range_ore, as a block ORE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_integer_range_ore Range query operand +--! @return {{prefix}}_internal.ore_block_256 The high bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.hi(r {{prefix}}.query_integer_range_ore) +RETURNS {{prefix}}_internal.ore_block_256 +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ore_block_256(jsonb_build_object('ob', r::jsonb -> 'hi')) $$; + +--! @brief The low bound of a {{prefix}}.query_integer_range_ope, as a CLLW OPE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_integer_range_ope Range query operand +--! @return {{prefix}}_internal.ope_cllw The low bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.lo(r {{prefix}}.query_integer_range_ope) +RETURNS {{prefix}}_internal.ope_cllw +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> 'lo')) $$; + +--! @brief The high bound of a {{prefix}}.query_integer_range_ope, as a CLLW OPE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_integer_range_ope Range query operand +--! @return {{prefix}}_internal.ope_cllw The high bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.hi(r {{prefix}}.query_integer_range_ope) +RETURNS {{prefix}}_internal.ope_cllw +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> 'hi')) $$; + +--! @brief Whether a public.{{prefix}}_integer_ord_ore value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_integer_range_ore)`. +--! +--! @param a public.{{prefix}}_integer_ord_ore Encrypted column value +--! @param r {{prefix}}.query_integer_range_ore Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term_ore(a)`, which a btree index on that expression +--! serves as one range scan. For this ORE range that index needs the +--! default btree operator class on {{prefix}}_internal.ore_block_256, which the +--! installer creates only with superuser privileges. Without it (on Supabase, +--! for instance) the installer disables the ORE column domains and this ORE range, +--! so use an OPE column (`public.{{prefix}}_integer_ord`, `public.{{prefix}}_integer_ord_ope`) +--! and `{{prefix}}.query_integer_range_ope`, which index everywhere. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_integer_range_ore`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_integer_ord_ore, r {{prefix}}.query_integer_range_ore) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_integer_ord value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_integer_range_ope)`. +--! +--! @param a public.{{prefix}}_integer_ord Encrypted column value +--! @param r {{prefix}}.query_integer_range_ope Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term(a)`, which a btree index on that expression +--! serves as one range scan. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_integer_range_ope`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_integer_ord, r {{prefix}}.query_integer_range_ope) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_integer_ord_ope value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_integer_range_ope)`. +--! +--! @param a public.{{prefix}}_integer_ord_ope Encrypted column value +--! @param r {{prefix}}.query_integer_range_ope Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term(a)`, which a btree index on that expression +--! serves as one range scan. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_integer_range_ope`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_integer_ord_ope, r {{prefix}}.query_integer_range_ope) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r) $$; diff --git a/packages/eql/src/v3/scalars/integer/query_integer_range_types.sql b/packages/eql/src/v3/scalars/integer/query_integer_range_types.sql new file mode 100644 index 000000000..c32c1be6c --- /dev/null +++ b/packages/eql/src/v3/scalars/integer/query_integer_range_types.sql @@ -0,0 +1,107 @@ +-- AUTOMATICALLY GENERATED FILE. +-- ONLY EQL VERSION: 4 +-- REQUIRE: src/v3/schema.sql +-- REQUIRE: src/v3/scalars/ore_fallback.sql + +--! @file v3/scalars/integer/query_integer_range_types.sql +--! @brief Range query-operand domains for integer: the operand of `{{prefix}}.between`. +--! @note A range holds both bounds of one `BETWEEN` as one value: +--! `{"v": {{eql_version}}, "i": {...}, "lo": , "hi": }`. Each bound is the +--! single-bound query domain's `ob` (ORE) or `op` (OPE) value, in a +--! `{v, i, lo, hi}` envelope. Both bounds are included. There is one +--! range domain per ordering term the family stores (ADR-0009, +--! decisions 7 and 8). +--! @note Cast the range parameter to its exact range domain +--! (`$1::{{prefix}}.query_integer_range_ore`). An uncast `$1`, a `jsonb` +--! parameter, or a range of another term or family fails with 42725 +--! ("function ... is not unique"); see `{{prefix}}.between`. +--! @note EQL version {{eql_version}} only: the `-- ONLY EQL VERSION:` line above keeps this +--! file out of every other version's installer. +--! @note Like every query operand, a range lives in `{{prefix}}`, not `public`, +--! and holds no ciphertext `c`. A range whose low bound is above its +--! high bound matches no row, as with SQL `BETWEEN`; the SQL does not +--! reorder the bounds. +--! @note On an install without the ORE operator class (a non-superuser +--! install, on Supabase for instance), the ORE range domain is disabled +--! as the single-bound ORE domains are: a value cast to it raises +--! `feature_not_supported`, naming the OPE range. See +--! `v3/scalars/ore_fallback.sql`. + +DO $$ +BEGIN + --! @brief Range query-operand domain {{prefix}}.query_integer_range_ore (two block ORE bounds; no `c`). + IF NOT EXISTS ( + SELECT 1 FROM pg_type + WHERE typname = 'query_integer_range_ore' AND typnamespace = '{{prefix}}'::regnamespace + ) THEN + CREATE DOMAIN {{prefix}}.query_integer_range_ore AS jsonb + CHECK ( + jsonb_typeof(VALUE) = 'object' + AND VALUE ? 'v' + AND VALUE ? 'i' + AND VALUE ? 'lo' + AND VALUE ? 'hi' + AND NOT (VALUE ? 'c') + AND jsonb_typeof(VALUE -> 'lo') = 'array' + AND jsonb_array_length(VALUE -> 'lo') > 0 + AND jsonb_typeof(VALUE -> 'hi') = 'array' + AND jsonb_array_length(VALUE -> 'hi') > 0 + -- `"v": null` makes the comparison NULL, and a CHECK that is NULL + -- passes, so COALESCE refuses it. A NULL range still passes (no row + -- matches it). The comparison keeps the one form the v4 isolation + -- gate accepts. + AND COALESCE(VALUE->>'v' = '{{eql_version}}', VALUE IS NULL) + ); + END IF; + + COMMENT ON DOMAIN {{prefix}}.query_integer_range_ore IS 'EQL integer range query operand (block ORE)'; + + --! @brief Range query-operand domain {{prefix}}.query_integer_range_ope (two CLLW OPE bounds; no `c`). + IF NOT EXISTS ( + SELECT 1 FROM pg_type + WHERE typname = 'query_integer_range_ope' AND typnamespace = '{{prefix}}'::regnamespace + ) THEN + CREATE DOMAIN {{prefix}}.query_integer_range_ope AS jsonb + CHECK ( + jsonb_typeof(VALUE) = 'object' + AND VALUE ? 'v' + AND VALUE ? 'i' + AND VALUE ? 'lo' + AND VALUE ? 'hi' + AND NOT (VALUE ? 'c') + AND jsonb_typeof(VALUE -> 'lo') = 'string' + AND jsonb_typeof(VALUE -> 'hi') = 'string' + -- `"v": null` makes the comparison NULL, and a CHECK that is NULL + -- passes, so COALESCE refuses it. A NULL range still passes (no row + -- matches it). The comparison keeps the one form the v4 isolation + -- gate accepts. + AND COALESCE(VALUE->>'v' = '{{eql_version}}', VALUE IS NULL) + ); + END IF; + + COMMENT ON DOMAIN {{prefix}}.query_integer_range_ope IS 'EQL integer range query operand (CLLW OPE)'; +END +$$; + +-- Without the default btree operator class on {{prefix}}_internal.ore_block_256 +-- (the installer skips it on insufficient_privilege), ore_fallback.sql has +-- created {{prefix}}_internal.ore_domain_unavailable and poisoned the +-- single-bound ORE domains. It cannot reach this ORE range, which exists in +-- EQL v4 only, so the same NOT VALID poison CHECK is added here. +DO $do$ +BEGIN + IF EXISTS ( + SELECT 1 + FROM pg_catalog.pg_opclass c + JOIN pg_catalog.pg_am am ON am.oid = c.opcmethod + WHERE am.amname = 'btree' + AND c.opcdefault + AND c.opcintype = '{{prefix}}_internal.ore_block_256'::pg_catalog.regtype + ) THEN + RETURN; + END IF; + + ALTER DOMAIN {{prefix}}.query_integer_range_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, '{{prefix}}.query_integer_range_ore', '{{prefix}}.query_integer_range_ope (range)')) NOT VALID; +END; +$do$; diff --git a/packages/eql/src/v3/scalars/integer/query_integer_types.sql b/packages/eql/src/v3/scalars/integer/query_integer_types.sql index 697581072..62eb3a3f1 100644 --- a/packages/eql/src/v3/scalars/integer/query_integer_types.sql +++ b/packages/eql/src/v3/scalars/integer/query_integer_types.sql @@ -3,41 +3,41 @@ --! @file v3/scalars/integer/query_integer_types.sql --! @brief Query-operand domains for integer (index-terms-only, no ciphertext). ---! @note Query-operand domains live in `eql_v3` (not `public`): they are +--! @note Query-operand domains live in `{{prefix}}` (not `public`): they are --! never valid column types, so they don't belong in the column-type --! namespace, and dropping the EQL-owned schema can never drop an --! application column. --! @note Cast a query operand explicitly to its `query_` domain in a predicate ---! (e.g. `WHERE col = $1::eql_v3.query_integer_eq`). A bare, +--! (e.g. `WHERE col = $1::{{prefix}}.query_integer_eq`). A bare, --! uncast literal RHS is ambiguous between the `query_` and `jsonb` --! operator overloads and will not resolve. DO $$ BEGIN - --! @brief Query-operand domain eql_v3.query_integer_eq (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_integer_eq (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_integer_eq' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_integer_eq' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_integer_eq AS jsonb + CREATE DOMAIN {{prefix}}.query_integer_eq AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'hm' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_integer_eq IS 'EQL integer query operand (equality)'; + COMMENT ON DOMAIN {{prefix}}.query_integer_eq IS 'EQL integer query operand (equality)'; - --! @brief Query-operand domain eql_v3.query_integer_ord_ore (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_integer_ord_ore (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_integer_ord_ore' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_integer_ord_ore' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_integer_ord_ore AS jsonb + CREATE DOMAIN {{prefix}}.query_integer_ord_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -46,46 +46,46 @@ BEGIN AND NOT (VALUE ? 'c') AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_integer_ord_ore IS 'EQL integer query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_integer_ord_ore IS 'EQL integer query operand (equality, ordering)'; - --! @brief Query-operand domain eql_v3.query_integer_ord (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_integer_ord (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_integer_ord' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_integer_ord' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_integer_ord AS jsonb + CREATE DOMAIN {{prefix}}.query_integer_ord AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'op' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_integer_ord IS 'EQL integer query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_integer_ord IS 'EQL integer query operand (equality, ordering)'; - --! @brief Query-operand domain eql_v3.query_integer_ord_ope (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_integer_ord_ope (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_integer_ord_ope' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_integer_ord_ope' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_integer_ord_ope AS jsonb + CREATE DOMAIN {{prefix}}.query_integer_ord_ope AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'op' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_integer_ord_ope IS 'EQL integer query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_integer_ord_ope IS 'EQL integer query operand (equality, ordering)'; END $$; diff --git a/packages/eql/src/v3/scalars/json/json_functions.sql b/packages/eql/src/v3/scalars/json/json_functions.sql index ad5ca52a7..ee6cf992f 100644 --- a/packages/eql/src/v3/scalars/json/json_functions.sql +++ b/packages/eql/src/v3/scalars/json/json_functions.sql @@ -4,662 +4,662 @@ -- REQUIRE: src/v3/scalars/functions.sql --! @file encrypted_domain/json/json_functions.sql ---! @brief Functions for public.eql_v3_json. +--! @brief Functions for public.{{prefix}}_json. ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json, b public.{{prefix}}_json) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json, b jsonb) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a jsonb, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal.eq(a jsonb, b public.{{prefix}}_json) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json, b public.{{prefix}}_json) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json, b jsonb) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a jsonb, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal.neq(a jsonb, b public.{{prefix}}_json) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_json, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_json, b public.{{prefix}}_json) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_json, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_json, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_json) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_json, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_json, b public.{{prefix}}_json) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_json, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_json, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_json) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_json, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_json, b public.{{prefix}}_json) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_json, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_json, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_json) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_json, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_json, b public.{{prefix}}_json) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_json, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_json, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_json) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_json, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_json, b public.{{prefix}}_json) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_json, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_json, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_json) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_json, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_json, b public.{{prefix}}_json) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_json, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_json, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_json) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_json never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_json, selector text) -RETURNS public.eql_v3_json IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_json'; END; $$ +--! @return public.{{prefix}}_json never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_json, selector text) +RETURNS public.{{prefix}}_json IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_json never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_json, selector integer) -RETURNS public.eql_v3_json IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_json'; END; $$ +--! @return public.{{prefix}}_json never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_json, selector integer) +RETURNS public.{{prefix}}_json IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_json right operand of the blocked operator ---! @return public.eql_v3_json never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_json) -RETURNS public.eql_v3_json IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_json'; END; $$ +--! @param selector public.{{prefix}}_json right operand of the blocked operator +--! @return public.{{prefix}}_json never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_json) +RETURNS public.{{prefix}}_json IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_json, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_json, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_json, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_json, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_json right operand of the blocked operator +--! @param selector public.{{prefix}}_json right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_json) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_json, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_json, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_json, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_json, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_json, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_json, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_json, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_json, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_json, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_json, b public.{{prefix}}_json) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_json, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_json, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_json) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_json, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_json, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_json, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_json, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_json, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_json, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_json, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_json, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_json, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_json, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_json, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_json, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_json, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_json, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_json, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_json, b public.{{prefix}}_json) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json left operand of the blocked operator +--! @param a public.{{prefix}}_json left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_json, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_json, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json. +--! @brief Unsupported operator blocker for public.{{prefix}}_json. --! ---! Intercepts an operator that is not supported on public.eql_v3_json and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_json right operand of the blocked operator +--! @param b public.{{prefix}}_json right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_json) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_json) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_json'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_json'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/json/json_operators.sql b/packages/eql/src/v3/scalars/json/json_operators.sql index 21cdfd15b..e3937f294 100644 --- a/packages/eql/src/v3/scalars/json/json_operators.sql +++ b/packages/eql/src/v3/scalars/json/json_operators.sql @@ -4,239 +4,239 @@ -- REQUIRE: src/v3/scalars/json/json_functions.sql --! @file encrypted_domain/json/json_operators.sql ---! @brief Operators for public.eql_v3_json. +--! @brief Operators for public.{{prefix}}_json. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json, RIGHTARG = jsonb ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json, RIGHTARG = jsonb ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_json, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_json, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_json, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_json, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_json, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_json, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_json, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_json, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_json, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_json, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_json, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_json, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_json, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_json, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_json, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_json, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_json, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_json, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_json, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_json, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_json, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_json, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_json, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_json, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_json, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_json, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_json, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_json, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_json, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_json, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_json, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_json, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_json, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_json, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_json, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_json, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_json, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_json, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_json, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_json, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_json, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_json, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_json, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_json, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_json, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_json, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_json, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_json, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_json, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_json, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_json, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_json, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_json, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_json, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_json, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_json, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_json, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_json, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_json, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_json, RIGHTARG = public.{{prefix}}_json ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_json, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_json, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_json + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_json ); diff --git a/packages/eql/src/v3/scalars/json/json_types.sql b/packages/eql/src/v3/scalars/json/json_types.sql index bebe5d0b6..047dc2091 100644 --- a/packages/eql/src/v3/scalars/json/json_types.sql +++ b/packages/eql/src/v3/scalars/json/json_types.sql @@ -6,21 +6,21 @@ DO $$ BEGIN - --! @brief Encrypted domain public.eql_v3_json. + --! @brief Encrypted domain public.{{prefix}}_json. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_json' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_json' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_json AS jsonb + CREATE DOMAIN public.{{prefix}}_json AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_json IS 'EQL encrypted json (storage only)'; + COMMENT ON DOMAIN public.{{prefix}}_json IS 'EQL encrypted json (storage only)'; END $$; diff --git a/packages/eql/src/v3/scalars/numeric/json_entry_numeric_functions.sql b/packages/eql/src/v3/scalars/numeric/json_entry_numeric_functions.sql index fd20146ea..4d32069a1 100644 --- a/packages/eql/src/v3/scalars/numeric/json_entry_numeric_functions.sql +++ b/packages/eql/src/v3/scalars/numeric/json_entry_numeric_functions.sql @@ -7,244 +7,244 @@ -- REQUIRE: src/v3/scalars/numeric/query_numeric_ord_ope_functions.sql --! @file encrypted_domain/numeric/json_entry_numeric_functions.sql ---! @brief Functions for public.eql_v3_json_entry. +--! @brief Functions for public.{{prefix}}_json_entry. ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_numeric_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_numeric_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json_entry, b eql_v3.query_numeric_ord) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json_entry, b {{prefix}}.query_numeric_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_numeric_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_numeric_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a eql_v3.query_numeric_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_numeric_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_numeric_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json_entry, b eql_v3.query_numeric_ord) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json_entry, b {{prefix}}.query_numeric_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_numeric_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_numeric_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a eql_v3.query_numeric_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_numeric_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_json_entry, b eql_v3.query_numeric_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_numeric_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_numeric_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_numeric_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_numeric_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_json_entry, b eql_v3.query_numeric_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_numeric_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_numeric_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_numeric_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_numeric_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_json_entry, b eql_v3.query_numeric_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_numeric_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_numeric_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_numeric_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_numeric_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_json_entry, b eql_v3.query_numeric_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_numeric_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_numeric_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_numeric_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_numeric_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_numeric_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json_entry, b eql_v3.query_numeric_ord_ope) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json_entry, b {{prefix}}.query_numeric_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_numeric_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_numeric_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a eql_v3.query_numeric_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_numeric_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_numeric_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json_entry, b eql_v3.query_numeric_ord_ope) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json_entry, b {{prefix}}.query_numeric_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_numeric_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_numeric_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a eql_v3.query_numeric_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_numeric_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_json_entry, b eql_v3.query_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_numeric_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_numeric_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_numeric_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_numeric_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_json_entry, b eql_v3.query_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_numeric_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_numeric_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_numeric_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_numeric_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_json_entry, b eql_v3.query_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_numeric_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_numeric_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_numeric_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_numeric_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_json_entry, b eql_v3.query_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_numeric_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_numeric_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_numeric_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/numeric/json_entry_numeric_operators.sql b/packages/eql/src/v3/scalars/numeric/json_entry_numeric_operators.sql index 2f204e242..49aad090b 100644 --- a/packages/eql/src/v3/scalars/numeric/json_entry_numeric_operators.sql +++ b/packages/eql/src/v3/scalars/numeric/json_entry_numeric_operators.sql @@ -5,140 +5,140 @@ -- REQUIRE: src/v3/scalars/numeric/json_entry_numeric_functions.sql --! @file encrypted_domain/numeric/json_entry_numeric_operators.sql ---! @brief Operators for public.eql_v3_json_entry. +--! @brief Operators for public.{{prefix}}_json_entry. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_numeric_ord + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_numeric_ord ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = eql_v3.query_numeric_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_numeric_ord + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_numeric_ord ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = eql_v3.query_numeric_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_numeric_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_numeric_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_numeric_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_numeric_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_numeric_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_numeric_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_numeric_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_numeric_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_numeric_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_numeric_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_numeric_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_numeric_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_numeric_ord_ope + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_numeric_ord_ope ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = eql_v3.query_numeric_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_numeric_ord_ope + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_numeric_ord_ope ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = eql_v3.query_numeric_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_numeric_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_numeric_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_numeric_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_numeric_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_numeric_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_numeric_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_numeric_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_numeric_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_numeric_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_numeric_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_numeric_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_numeric_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/numeric/numeric_eq_functions.sql b/packages/eql/src/v3/scalars/numeric/numeric_eq_functions.sql index fe3ebd54f..a69b33759 100644 --- a/packages/eql/src/v3/scalars/numeric/numeric_eq_functions.sql +++ b/packages/eql/src/v3/scalars/numeric/numeric_eq_functions.sql @@ -5,634 +5,634 @@ -- REQUIRE: src/v3/sem/hmac_256/functions.sql --! @file encrypted_domain/numeric/numeric_eq_functions.sql ---! @brief Functions for public.eql_v3_numeric_eq. +--! @brief Functions for public.{{prefix}}_numeric_eq. ---! @brief Index extractor for public.eql_v3_numeric_eq. ---! @param a public.eql_v3_numeric_eq ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a public.eql_v3_numeric_eq) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for public.{{prefix}}_numeric_eq. +--! @param a public.{{prefix}}_numeric_eq +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a public.{{prefix}}_numeric_eq) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_eq. ---! @param a public.eql_v3_numeric_eq ---! @param b public.eql_v3_numeric_eq +--! @brief Operator wrapper for public.{{prefix}}_numeric_eq. +--! @param a public.{{prefix}}_numeric_eq +--! @param b public.{{prefix}}_numeric_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_numeric_eq, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_eq, b public.{{prefix}}_numeric_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_eq. ---! @param a public.eql_v3_numeric_eq +--! @brief Operator wrapper for public.{{prefix}}_numeric_eq. +--! @param a public.{{prefix}}_numeric_eq --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_numeric_eq, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b::public.eql_v3_numeric_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_numeric_eq) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_eq. +--! @brief Operator wrapper for public.{{prefix}}_numeric_eq. --! @param a jsonb ---! @param b public.eql_v3_numeric_eq +--! @param b public.{{prefix}}_numeric_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_numeric_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_numeric_eq) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_numeric_eq) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_eq. ---! @param a public.eql_v3_numeric_eq ---! @param b public.eql_v3_numeric_eq +--! @brief Operator wrapper for public.{{prefix}}_numeric_eq. +--! @param a public.{{prefix}}_numeric_eq +--! @param b public.{{prefix}}_numeric_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_numeric_eq, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_eq, b public.{{prefix}}_numeric_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_eq. ---! @param a public.eql_v3_numeric_eq +--! @brief Operator wrapper for public.{{prefix}}_numeric_eq. +--! @param a public.{{prefix}}_numeric_eq --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_numeric_eq, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b::public.eql_v3_numeric_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_numeric_eq) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_eq. +--! @brief Operator wrapper for public.{{prefix}}_numeric_eq. --! @param a jsonb ---! @param b public.eql_v3_numeric_eq +--! @param b public.{{prefix}}_numeric_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_numeric_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_numeric_eq) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_numeric_eq) <> {{prefix}}.eq_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator ---! @param b public.eql_v3_numeric_eq right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_numeric_eq, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_numeric_eq, b public.{{prefix}}_numeric_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_numeric_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_numeric_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_eq right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_numeric_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator ---! @param b public.eql_v3_numeric_eq right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_numeric_eq, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_numeric_eq, b public.{{prefix}}_numeric_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_numeric_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_numeric_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_eq right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_numeric_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator ---! @param b public.eql_v3_numeric_eq right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_numeric_eq, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_numeric_eq, b public.{{prefix}}_numeric_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_numeric_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_numeric_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_eq right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_numeric_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator ---! @param b public.eql_v3_numeric_eq right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_numeric_eq, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_numeric_eq, b public.{{prefix}}_numeric_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_numeric_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_numeric_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_eq right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_numeric_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator ---! @param b public.eql_v3_numeric_eq right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_numeric_eq, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_numeric_eq, b public.{{prefix}}_numeric_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_numeric_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_numeric_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_eq right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_numeric_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator ---! @param b public.eql_v3_numeric_eq right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_numeric_eq, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_numeric_eq, b public.{{prefix}}_numeric_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_numeric_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_numeric_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_eq right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_numeric_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_numeric_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_numeric_eq, selector text) -RETURNS public.eql_v3_numeric_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_numeric_eq'; END; $$ +--! @return public.{{prefix}}_numeric_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_numeric_eq, selector text) +RETURNS public.{{prefix}}_numeric_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_numeric_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_numeric_eq, selector integer) -RETURNS public.eql_v3_numeric_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_numeric_eq'; END; $$ +--! @return public.{{prefix}}_numeric_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_numeric_eq, selector integer) +RETURNS public.{{prefix}}_numeric_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_numeric_eq right operand of the blocked operator ---! @return public.eql_v3_numeric_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_numeric_eq) -RETURNS public.eql_v3_numeric_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_numeric_eq'; END; $$ +--! @param selector public.{{prefix}}_numeric_eq right operand of the blocked operator +--! @return public.{{prefix}}_numeric_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_numeric_eq) +RETURNS public.{{prefix}}_numeric_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_numeric_eq, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_numeric_eq, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_numeric_eq, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_numeric_eq, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_numeric_eq right operand of the blocked operator +--! @param selector public.{{prefix}}_numeric_eq right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_numeric_eq) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_numeric_eq, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_numeric_eq, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_numeric_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_numeric_eq, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_numeric_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_numeric_eq, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_numeric_eq, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_numeric_eq, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator ---! @param b public.eql_v3_numeric_eq right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_numeric_eq, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_numeric_eq, b public.{{prefix}}_numeric_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_numeric_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_numeric_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_eq right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_numeric_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_numeric_eq, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_numeric_eq, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_numeric_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_numeric_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_numeric_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_numeric_eq, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_numeric_eq, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_numeric_eq, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_numeric_eq, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_numeric_eq, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_numeric_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_numeric_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_numeric_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_numeric_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator ---! @param b public.eql_v3_numeric_eq right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_eq right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_numeric_eq, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_numeric_eq, b public.{{prefix}}_numeric_eq) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_eq left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_numeric_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_numeric_eq, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_eq right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_eq right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_numeric_eq) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_numeric_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_numeric_eq'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/numeric/numeric_eq_operators.sql b/packages/eql/src/v3/scalars/numeric/numeric_eq_operators.sql index 1b9a16b7c..b606cae88 100644 --- a/packages/eql/src/v3/scalars/numeric/numeric_eq_operators.sql +++ b/packages/eql/src/v3/scalars/numeric/numeric_eq_operators.sql @@ -4,245 +4,245 @@ -- REQUIRE: src/v3/scalars/numeric/numeric_eq_functions.sql --! @file encrypted_domain/numeric/numeric_eq_operators.sql ---! @brief Operators for public.eql_v3_numeric_eq. +--! @brief Operators for public.{{prefix}}_numeric_eq. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = public.eql_v3_numeric_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = public.{{prefix}}_numeric_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = public.eql_v3_numeric_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = public.{{prefix}}_numeric_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = public.eql_v3_numeric_eq + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = public.{{prefix}}_numeric_eq ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_eq + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_eq ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = public.eql_v3_numeric_eq + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = public.{{prefix}}_numeric_eq ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_eq + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_eq ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = public.eql_v3_numeric_eq + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = public.{{prefix}}_numeric_eq ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_eq + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_eq ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = public.eql_v3_numeric_eq + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = public.{{prefix}}_numeric_eq ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_eq + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_eq ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = public.eql_v3_numeric_eq + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = public.{{prefix}}_numeric_eq ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_eq + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_eq ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = public.eql_v3_numeric_eq + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = public.{{prefix}}_numeric_eq ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_eq + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_eq ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_eq + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_eq ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_eq + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_eq ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = public.eql_v3_numeric_eq + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = public.{{prefix}}_numeric_eq ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_eq + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_eq ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = public.eql_v3_numeric_eq + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = public.{{prefix}}_numeric_eq ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_eq + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_eq ); diff --git a/packages/eql/src/v3/scalars/numeric/numeric_functions.sql b/packages/eql/src/v3/scalars/numeric/numeric_functions.sql index 82001f519..7b591444a 100644 --- a/packages/eql/src/v3/scalars/numeric/numeric_functions.sql +++ b/packages/eql/src/v3/scalars/numeric/numeric_functions.sql @@ -4,662 +4,662 @@ -- REQUIRE: src/v3/scalars/functions.sql --! @file encrypted_domain/numeric/numeric_functions.sql ---! @brief Functions for public.eql_v3_numeric. +--! @brief Functions for public.{{prefix}}_numeric. ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_numeric, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_numeric, b public.{{prefix}}_numeric) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_numeric, b jsonb) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_numeric, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a jsonb, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal.eq(a jsonb, b public.{{prefix}}_numeric) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_numeric, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_numeric, b public.{{prefix}}_numeric) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_numeric, b jsonb) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_numeric, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a jsonb, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal.neq(a jsonb, b public.{{prefix}}_numeric) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_numeric, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_numeric, b public.{{prefix}}_numeric) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_numeric, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_numeric, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_numeric) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_numeric, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_numeric, b public.{{prefix}}_numeric) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_numeric, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_numeric, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_numeric) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_numeric, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_numeric, b public.{{prefix}}_numeric) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_numeric, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_numeric, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_numeric) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_numeric, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_numeric, b public.{{prefix}}_numeric) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_numeric, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_numeric, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_numeric) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_numeric, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_numeric, b public.{{prefix}}_numeric) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_numeric, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_numeric, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_numeric) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_numeric, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_numeric, b public.{{prefix}}_numeric) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_numeric, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_numeric, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_numeric) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_numeric never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_numeric, selector text) -RETURNS public.eql_v3_numeric IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_numeric'; END; $$ +--! @return public.{{prefix}}_numeric never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_numeric, selector text) +RETURNS public.{{prefix}}_numeric IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_numeric never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_numeric, selector integer) -RETURNS public.eql_v3_numeric IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_numeric'; END; $$ +--! @return public.{{prefix}}_numeric never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_numeric, selector integer) +RETURNS public.{{prefix}}_numeric IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_numeric right operand of the blocked operator ---! @return public.eql_v3_numeric never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_numeric) -RETURNS public.eql_v3_numeric IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_numeric'; END; $$ +--! @param selector public.{{prefix}}_numeric right operand of the blocked operator +--! @return public.{{prefix}}_numeric never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_numeric) +RETURNS public.{{prefix}}_numeric IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_numeric, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_numeric, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_numeric, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_numeric, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_numeric right operand of the blocked operator +--! @param selector public.{{prefix}}_numeric right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_numeric) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_numeric, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_numeric, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_numeric, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_numeric, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_numeric, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_numeric, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_numeric, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_numeric, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_numeric, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_numeric, b public.{{prefix}}_numeric) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_numeric, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_numeric, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_numeric) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_numeric, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_numeric, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_numeric, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_numeric, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_numeric, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_numeric, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_numeric, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_numeric, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_numeric, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_numeric, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_numeric, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_numeric, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_numeric, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_numeric, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_numeric, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_numeric, b public.{{prefix}}_numeric) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric left operand of the blocked operator +--! @param a public.{{prefix}}_numeric left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_numeric, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_numeric, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric right operand of the blocked operator +--! @param b public.{{prefix}}_numeric right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_numeric) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_numeric) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_numeric'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_numeric'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/numeric/numeric_operators.sql b/packages/eql/src/v3/scalars/numeric/numeric_operators.sql index 9beeedd2b..fe88b6086 100644 --- a/packages/eql/src/v3/scalars/numeric/numeric_operators.sql +++ b/packages/eql/src/v3/scalars/numeric/numeric_operators.sql @@ -4,239 +4,239 @@ -- REQUIRE: src/v3/scalars/numeric/numeric_functions.sql --! @file encrypted_domain/numeric/numeric_operators.sql ---! @brief Operators for public.eql_v3_numeric. +--! @brief Operators for public.{{prefix}}_numeric. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_numeric, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_numeric, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = jsonb ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_numeric, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_numeric, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = jsonb ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_numeric, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_numeric, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_numeric, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_numeric, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_numeric, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_numeric, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_numeric, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_numeric, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_numeric, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_numeric, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_numeric, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_numeric, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_numeric, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_numeric, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_numeric, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_numeric, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_numeric, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_numeric, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_numeric, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_numeric, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_numeric, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_numeric, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_numeric, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_numeric, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_numeric, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_numeric, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_numeric, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_numeric, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_numeric, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_numeric, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = public.{{prefix}}_numeric ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_numeric, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_numeric, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric ); diff --git a/packages/eql/src/v3/scalars/numeric/numeric_ord_aggregates.sql b/packages/eql/src/v3/scalars/numeric/numeric_ord_aggregates.sql index 428a5cc00..2d76d14ed 100644 --- a/packages/eql/src/v3/scalars/numeric/numeric_ord_aggregates.sql +++ b/packages/eql/src/v3/scalars/numeric/numeric_ord_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/numeric/numeric_ord_operators.sql --! @file encrypted_domain/numeric/numeric_ord_aggregates.sql ---! @brief Aggregates for public.eql_v3_numeric_ord. +--! @brief Aggregates for public.{{prefix}}_numeric_ord. ---! @brief State function for min on public.eql_v3_numeric_ord. ---! @param state public.eql_v3_numeric_ord ---! @param value public.eql_v3_numeric_ord ---! @return public.eql_v3_numeric_ord -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_numeric_ord, value public.eql_v3_numeric_ord) -RETURNS public.eql_v3_numeric_ord +--! @brief State function for min on public.{{prefix}}_numeric_ord. +--! @param state public.{{prefix}}_numeric_ord +--! @param value public.{{prefix}}_numeric_ord +--! @return public.{{prefix}}_numeric_ord +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_numeric_ord, value public.{{prefix}}_numeric_ord) +RETURNS public.{{prefix}}_numeric_ord LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_numeric_ord. ---! @param input public.eql_v3_numeric_ord ---! @return public.eql_v3_numeric_ord -CREATE AGGREGATE eql_v3.min(public.eql_v3_numeric_ord) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_numeric_ord, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_numeric_ord. +--! @param input public.{{prefix}}_numeric_ord +--! @return public.{{prefix}}_numeric_ord +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_numeric_ord) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_numeric_ord, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_numeric_ord. ---! @param state public.eql_v3_numeric_ord ---! @param value public.eql_v3_numeric_ord ---! @return public.eql_v3_numeric_ord -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_numeric_ord, value public.eql_v3_numeric_ord) -RETURNS public.eql_v3_numeric_ord +--! @brief State function for max on public.{{prefix}}_numeric_ord. +--! @param state public.{{prefix}}_numeric_ord +--! @param value public.{{prefix}}_numeric_ord +--! @return public.{{prefix}}_numeric_ord +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_numeric_ord, value public.{{prefix}}_numeric_ord) +RETURNS public.{{prefix}}_numeric_ord LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_numeric_ord. ---! @param input public.eql_v3_numeric_ord ---! @return public.eql_v3_numeric_ord -CREATE AGGREGATE eql_v3.max(public.eql_v3_numeric_ord) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_numeric_ord, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_numeric_ord. +--! @param input public.{{prefix}}_numeric_ord +--! @return public.{{prefix}}_numeric_ord +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_numeric_ord) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_numeric_ord, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/numeric/numeric_ord_functions.sql b/packages/eql/src/v3/scalars/numeric/numeric_ord_functions.sql index bd7d97471..079c1be40 100644 --- a/packages/eql/src/v3/scalars/numeric/numeric_ord_functions.sql +++ b/packages/eql/src/v3/scalars/numeric/numeric_ord_functions.sql @@ -5,562 +5,562 @@ -- REQUIRE: src/v3/sem/ope_cllw/functions.sql --! @file encrypted_domain/numeric/numeric_ord_functions.sql ---! @brief Functions for public.eql_v3_numeric_ord. +--! @brief Functions for public.{{prefix}}_numeric_ord. ---! @brief Index extractor for public.eql_v3_numeric_ord. ---! @param a public.eql_v3_numeric_ord ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a public.eql_v3_numeric_ord) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for public.{{prefix}}_numeric_ord. +--! @param a public.{{prefix}}_numeric_ord +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a public.{{prefix}}_numeric_ord) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord. ---! @param a public.eql_v3_numeric_ord ---! @param b public.eql_v3_numeric_ord +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord. +--! @param a public.{{prefix}}_numeric_ord +--! @param b public.{{prefix}}_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_numeric_ord, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord. ---! @param a public.eql_v3_numeric_ord +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord. +--! @param a public.{{prefix}}_numeric_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_numeric_ord, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b::public.eql_v3_numeric_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord. +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a jsonb ---! @param b public.eql_v3_numeric_ord +--! @param b public.{{prefix}}_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_numeric_ord) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord. ---! @param a public.eql_v3_numeric_ord ---! @param b public.eql_v3_numeric_ord +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord. +--! @param a public.{{prefix}}_numeric_ord +--! @param b public.{{prefix}}_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_numeric_ord, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord. ---! @param a public.eql_v3_numeric_ord +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord. +--! @param a public.{{prefix}}_numeric_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_numeric_ord, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b::public.eql_v3_numeric_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord. +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a jsonb ---! @param b public.eql_v3_numeric_ord +--! @param b public.{{prefix}}_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_numeric_ord) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord. ---! @param a public.eql_v3_numeric_ord ---! @param b public.eql_v3_numeric_ord +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord. +--! @param a public.{{prefix}}_numeric_ord +--! @param b public.{{prefix}}_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_numeric_ord, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord. ---! @param a public.eql_v3_numeric_ord +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord. +--! @param a public.{{prefix}}_numeric_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_numeric_ord, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_numeric_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b::public.eql_v3_numeric_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord. +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a jsonb ---! @param b public.eql_v3_numeric_ord +--! @param b public.{{prefix}}_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_numeric_ord) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord. ---! @param a public.eql_v3_numeric_ord ---! @param b public.eql_v3_numeric_ord +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord. +--! @param a public.{{prefix}}_numeric_ord +--! @param b public.{{prefix}}_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_numeric_ord, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord. ---! @param a public.eql_v3_numeric_ord +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord. +--! @param a public.{{prefix}}_numeric_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_numeric_ord, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_numeric_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b::public.eql_v3_numeric_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord. +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a jsonb ---! @param b public.eql_v3_numeric_ord +--! @param b public.{{prefix}}_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_numeric_ord) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord. ---! @param a public.eql_v3_numeric_ord ---! @param b public.eql_v3_numeric_ord +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord. +--! @param a public.{{prefix}}_numeric_ord +--! @param b public.{{prefix}}_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_numeric_ord, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord. ---! @param a public.eql_v3_numeric_ord +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord. +--! @param a public.{{prefix}}_numeric_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_numeric_ord, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_numeric_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b::public.eql_v3_numeric_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord. +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a jsonb ---! @param b public.eql_v3_numeric_ord +--! @param b public.{{prefix}}_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_numeric_ord) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord. ---! @param a public.eql_v3_numeric_ord ---! @param b public.eql_v3_numeric_ord +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord. +--! @param a public.{{prefix}}_numeric_ord +--! @param b public.{{prefix}}_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_numeric_ord, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord. ---! @param a public.eql_v3_numeric_ord +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord. +--! @param a public.{{prefix}}_numeric_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_numeric_ord, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_numeric_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b::public.eql_v3_numeric_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord. +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a jsonb ---! @param b public.eql_v3_numeric_ord +--! @param b public.{{prefix}}_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_numeric_ord) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_numeric_ord, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_numeric_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_numeric_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_numeric_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_numeric_ord, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_numeric_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_numeric_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_numeric_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_numeric_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_numeric_ord, selector text) -RETURNS public.eql_v3_numeric_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_numeric_ord'; END; $$ +--! @return public.{{prefix}}_numeric_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_numeric_ord, selector text) +RETURNS public.{{prefix}}_numeric_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_numeric_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_numeric_ord, selector integer) -RETURNS public.eql_v3_numeric_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_numeric_ord'; END; $$ +--! @return public.{{prefix}}_numeric_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_numeric_ord, selector integer) +RETURNS public.{{prefix}}_numeric_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_numeric_ord right operand of the blocked operator ---! @return public.eql_v3_numeric_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_numeric_ord) -RETURNS public.eql_v3_numeric_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_numeric_ord'; END; $$ +--! @param selector public.{{prefix}}_numeric_ord right operand of the blocked operator +--! @return public.{{prefix}}_numeric_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_numeric_ord) +RETURNS public.{{prefix}}_numeric_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_numeric_ord, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_numeric_ord, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_numeric_ord, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_numeric_ord, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_numeric_ord right operand of the blocked operator +--! @param selector public.{{prefix}}_numeric_ord right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_numeric_ord) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_numeric_ord, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_numeric_ord, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_numeric_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_numeric_ord, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_numeric_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_numeric_ord, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_numeric_ord, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_numeric_ord, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_numeric_ord, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_numeric_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_numeric_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_numeric_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_numeric_ord, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_numeric_ord, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_numeric_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_numeric_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_numeric_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_numeric_ord, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_numeric_ord, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_numeric_ord, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_numeric_ord, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_numeric_ord, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_numeric_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_numeric_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_numeric_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_numeric_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_numeric_ord, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_numeric_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_numeric_ord, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_numeric_ord) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_numeric_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_numeric_ord'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/numeric/numeric_ord_ope_aggregates.sql b/packages/eql/src/v3/scalars/numeric/numeric_ord_ope_aggregates.sql index 4190c25d9..f0627aafc 100644 --- a/packages/eql/src/v3/scalars/numeric/numeric_ord_ope_aggregates.sql +++ b/packages/eql/src/v3/scalars/numeric/numeric_ord_ope_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/numeric/numeric_ord_ope_operators.sql --! @file encrypted_domain/numeric/numeric_ord_ope_aggregates.sql ---! @brief Aggregates for public.eql_v3_numeric_ord_ope. +--! @brief Aggregates for public.{{prefix}}_numeric_ord_ope. ---! @brief State function for min on public.eql_v3_numeric_ord_ope. ---! @param state public.eql_v3_numeric_ord_ope ---! @param value public.eql_v3_numeric_ord_ope ---! @return public.eql_v3_numeric_ord_ope -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_numeric_ord_ope, value public.eql_v3_numeric_ord_ope) -RETURNS public.eql_v3_numeric_ord_ope +--! @brief State function for min on public.{{prefix}}_numeric_ord_ope. +--! @param state public.{{prefix}}_numeric_ord_ope +--! @param value public.{{prefix}}_numeric_ord_ope +--! @return public.{{prefix}}_numeric_ord_ope +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_numeric_ord_ope, value public.{{prefix}}_numeric_ord_ope) +RETURNS public.{{prefix}}_numeric_ord_ope LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_numeric_ord_ope. ---! @param input public.eql_v3_numeric_ord_ope ---! @return public.eql_v3_numeric_ord_ope -CREATE AGGREGATE eql_v3.min(public.eql_v3_numeric_ord_ope) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_numeric_ord_ope, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_numeric_ord_ope. +--! @param input public.{{prefix}}_numeric_ord_ope +--! @return public.{{prefix}}_numeric_ord_ope +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_numeric_ord_ope) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_numeric_ord_ope, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_numeric_ord_ope. ---! @param state public.eql_v3_numeric_ord_ope ---! @param value public.eql_v3_numeric_ord_ope ---! @return public.eql_v3_numeric_ord_ope -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_numeric_ord_ope, value public.eql_v3_numeric_ord_ope) -RETURNS public.eql_v3_numeric_ord_ope +--! @brief State function for max on public.{{prefix}}_numeric_ord_ope. +--! @param state public.{{prefix}}_numeric_ord_ope +--! @param value public.{{prefix}}_numeric_ord_ope +--! @return public.{{prefix}}_numeric_ord_ope +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_numeric_ord_ope, value public.{{prefix}}_numeric_ord_ope) +RETURNS public.{{prefix}}_numeric_ord_ope LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_numeric_ord_ope. ---! @param input public.eql_v3_numeric_ord_ope ---! @return public.eql_v3_numeric_ord_ope -CREATE AGGREGATE eql_v3.max(public.eql_v3_numeric_ord_ope) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_numeric_ord_ope, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_numeric_ord_ope. +--! @param input public.{{prefix}}_numeric_ord_ope +--! @return public.{{prefix}}_numeric_ord_ope +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_numeric_ord_ope) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_numeric_ord_ope, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/numeric/numeric_ord_ope_functions.sql b/packages/eql/src/v3/scalars/numeric/numeric_ord_ope_functions.sql index 5f2f4ec32..4ca0974f4 100644 --- a/packages/eql/src/v3/scalars/numeric/numeric_ord_ope_functions.sql +++ b/packages/eql/src/v3/scalars/numeric/numeric_ord_ope_functions.sql @@ -5,562 +5,562 @@ -- REQUIRE: src/v3/sem/ope_cllw/functions.sql --! @file encrypted_domain/numeric/numeric_ord_ope_functions.sql ---! @brief Functions for public.eql_v3_numeric_ord_ope. +--! @brief Functions for public.{{prefix}}_numeric_ord_ope. ---! @brief Index extractor for public.eql_v3_numeric_ord_ope. ---! @param a public.eql_v3_numeric_ord_ope ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a public.eql_v3_numeric_ord_ope) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for public.{{prefix}}_numeric_ord_ope. +--! @param a public.{{prefix}}_numeric_ord_ope +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a public.{{prefix}}_numeric_ord_ope) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ope. ---! @param a public.eql_v3_numeric_ord_ope ---! @param b public.eql_v3_numeric_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. +--! @param a public.{{prefix}}_numeric_ord_ope +--! @param b public.{{prefix}}_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_numeric_ord_ope, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ope. ---! @param a public.eql_v3_numeric_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. +--! @param a public.{{prefix}}_numeric_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_numeric_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b::public.eql_v3_numeric_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_numeric_ord_ope +--! @param b public.{{prefix}}_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_numeric_ord_ope) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ope. ---! @param a public.eql_v3_numeric_ord_ope ---! @param b public.eql_v3_numeric_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. +--! @param a public.{{prefix}}_numeric_ord_ope +--! @param b public.{{prefix}}_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_numeric_ord_ope, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ope. ---! @param a public.eql_v3_numeric_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. +--! @param a public.{{prefix}}_numeric_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_numeric_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b::public.eql_v3_numeric_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_numeric_ord_ope +--! @param b public.{{prefix}}_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_numeric_ord_ope) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ope. ---! @param a public.eql_v3_numeric_ord_ope ---! @param b public.eql_v3_numeric_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. +--! @param a public.{{prefix}}_numeric_ord_ope +--! @param b public.{{prefix}}_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_numeric_ord_ope, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ope. ---! @param a public.eql_v3_numeric_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. +--! @param a public.{{prefix}}_numeric_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_numeric_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_numeric_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b::public.eql_v3_numeric_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_numeric_ord_ope +--! @param b public.{{prefix}}_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_numeric_ord_ope) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ope. ---! @param a public.eql_v3_numeric_ord_ope ---! @param b public.eql_v3_numeric_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. +--! @param a public.{{prefix}}_numeric_ord_ope +--! @param b public.{{prefix}}_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_numeric_ord_ope, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ope. ---! @param a public.eql_v3_numeric_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. +--! @param a public.{{prefix}}_numeric_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_numeric_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_numeric_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b::public.eql_v3_numeric_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_numeric_ord_ope +--! @param b public.{{prefix}}_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_numeric_ord_ope) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ope. ---! @param a public.eql_v3_numeric_ord_ope ---! @param b public.eql_v3_numeric_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. +--! @param a public.{{prefix}}_numeric_ord_ope +--! @param b public.{{prefix}}_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_numeric_ord_ope, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ope. ---! @param a public.eql_v3_numeric_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. +--! @param a public.{{prefix}}_numeric_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_numeric_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_numeric_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b::public.eql_v3_numeric_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_numeric_ord_ope +--! @param b public.{{prefix}}_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_numeric_ord_ope) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ope. ---! @param a public.eql_v3_numeric_ord_ope ---! @param b public.eql_v3_numeric_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. +--! @param a public.{{prefix}}_numeric_ord_ope +--! @param b public.{{prefix}}_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_numeric_ord_ope, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ope. ---! @param a public.eql_v3_numeric_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. +--! @param a public.{{prefix}}_numeric_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_numeric_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_numeric_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b::public.eql_v3_numeric_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_numeric_ord_ope +--! @param b public.{{prefix}}_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_numeric_ord_ope) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_numeric_ord_ope, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_numeric_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_numeric_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_numeric_ord_ope, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_numeric_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_numeric_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_numeric_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_numeric_ord_ope, selector text) -RETURNS public.eql_v3_numeric_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_numeric_ord_ope'; END; $$ +--! @return public.{{prefix}}_numeric_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_numeric_ord_ope, selector text) +RETURNS public.{{prefix}}_numeric_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_numeric_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_numeric_ord_ope, selector integer) -RETURNS public.eql_v3_numeric_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_numeric_ord_ope'; END; $$ +--! @return public.{{prefix}}_numeric_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_numeric_ord_ope, selector integer) +RETURNS public.{{prefix}}_numeric_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_numeric_ord_ope right operand of the blocked operator ---! @return public.eql_v3_numeric_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_numeric_ord_ope) -RETURNS public.eql_v3_numeric_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_numeric_ord_ope'; END; $$ +--! @param selector public.{{prefix}}_numeric_ord_ope right operand of the blocked operator +--! @return public.{{prefix}}_numeric_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_numeric_ord_ope) +RETURNS public.{{prefix}}_numeric_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_numeric_ord_ope, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_numeric_ord_ope, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_numeric_ord_ope, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_numeric_ord_ope, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_numeric_ord_ope right operand of the blocked operator +--! @param selector public.{{prefix}}_numeric_ord_ope right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_numeric_ord_ope) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_numeric_ord_ope, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_numeric_ord_ope, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_numeric_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_numeric_ord_ope, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_numeric_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_numeric_ord_ope, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_numeric_ord_ope, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_numeric_ord_ope, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_numeric_ord_ope, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_numeric_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_numeric_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_numeric_ord_ope, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_numeric_ord_ope, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_numeric_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_numeric_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_numeric_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_numeric_ord_ope, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_numeric_ord_ope, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_numeric_ord_ope, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_numeric_ord_ope, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_numeric_ord_ope, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_numeric_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_numeric_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_numeric_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_numeric_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord_ope right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_numeric_ord_ope, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ope) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_numeric_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_numeric_ord_ope, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord_ope right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_numeric_ord_ope) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_numeric_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_numeric_ord_ope'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/numeric/numeric_ord_ope_operators.sql b/packages/eql/src/v3/scalars/numeric/numeric_ord_ope_operators.sql index 26f446e46..ab374cb5f 100644 --- a/packages/eql/src/v3/scalars/numeric/numeric_ord_ope_operators.sql +++ b/packages/eql/src/v3/scalars/numeric/numeric_ord_ope_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/numeric/numeric_ord_ope_functions.sql --! @file encrypted_domain/numeric/numeric_ord_ope_operators.sql ---! @brief Operators for public.eql_v3_numeric_ord_ope. +--! @brief Operators for public.{{prefix}}_numeric_ord_ope. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = public.eql_v3_numeric_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = public.eql_v3_numeric_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = public.eql_v3_numeric_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = public.eql_v3_numeric_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = public.eql_v3_numeric_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = public.eql_v3_numeric_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = public.eql_v3_numeric_ord_ope + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ope ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ope + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ope ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = public.eql_v3_numeric_ord_ope + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ope ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ope + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ope ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ope + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ope ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ope + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ope ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = public.eql_v3_numeric_ord_ope + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ope ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ope + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ope ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = public.eql_v3_numeric_ord_ope + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ope ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ope + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ope ); diff --git a/packages/eql/src/v3/scalars/numeric/numeric_ord_operators.sql b/packages/eql/src/v3/scalars/numeric/numeric_ord_operators.sql index c3f29d217..7fb87b0c1 100644 --- a/packages/eql/src/v3/scalars/numeric/numeric_ord_operators.sql +++ b/packages/eql/src/v3/scalars/numeric/numeric_ord_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/numeric/numeric_ord_functions.sql --! @file encrypted_domain/numeric/numeric_ord_operators.sql ---! @brief Operators for public.eql_v3_numeric_ord. +--! @brief Operators for public.{{prefix}}_numeric_ord. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = public.eql_v3_numeric_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = public.eql_v3_numeric_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = public.eql_v3_numeric_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = public.eql_v3_numeric_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = public.eql_v3_numeric_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = public.eql_v3_numeric_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = public.eql_v3_numeric_ord + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = public.eql_v3_numeric_ord + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = public.eql_v3_numeric_ord + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = public.eql_v3_numeric_ord + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord ); diff --git a/packages/eql/src/v3/scalars/numeric/numeric_ord_ore_aggregates.sql b/packages/eql/src/v3/scalars/numeric/numeric_ord_ore_aggregates.sql index 83f2c2f2a..76db0474c 100644 --- a/packages/eql/src/v3/scalars/numeric/numeric_ord_ore_aggregates.sql +++ b/packages/eql/src/v3/scalars/numeric/numeric_ord_ore_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/numeric/numeric_ord_ore_operators.sql --! @file encrypted_domain/numeric/numeric_ord_ore_aggregates.sql ---! @brief Aggregates for public.eql_v3_numeric_ord_ore. +--! @brief Aggregates for public.{{prefix}}_numeric_ord_ore. ---! @brief State function for min on public.eql_v3_numeric_ord_ore. ---! @param state public.eql_v3_numeric_ord_ore ---! @param value public.eql_v3_numeric_ord_ore ---! @return public.eql_v3_numeric_ord_ore -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_numeric_ord_ore, value public.eql_v3_numeric_ord_ore) -RETURNS public.eql_v3_numeric_ord_ore +--! @brief State function for min on public.{{prefix}}_numeric_ord_ore. +--! @param state public.{{prefix}}_numeric_ord_ore +--! @param value public.{{prefix}}_numeric_ord_ore +--! @return public.{{prefix}}_numeric_ord_ore +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_numeric_ord_ore, value public.{{prefix}}_numeric_ord_ore) +RETURNS public.{{prefix}}_numeric_ord_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_numeric_ord_ore. ---! @param input public.eql_v3_numeric_ord_ore ---! @return public.eql_v3_numeric_ord_ore -CREATE AGGREGATE eql_v3.min(public.eql_v3_numeric_ord_ore) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_numeric_ord_ore, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_numeric_ord_ore. +--! @param input public.{{prefix}}_numeric_ord_ore +--! @return public.{{prefix}}_numeric_ord_ore +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_numeric_ord_ore) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_numeric_ord_ore, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_numeric_ord_ore. ---! @param state public.eql_v3_numeric_ord_ore ---! @param value public.eql_v3_numeric_ord_ore ---! @return public.eql_v3_numeric_ord_ore -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_numeric_ord_ore, value public.eql_v3_numeric_ord_ore) -RETURNS public.eql_v3_numeric_ord_ore +--! @brief State function for max on public.{{prefix}}_numeric_ord_ore. +--! @param state public.{{prefix}}_numeric_ord_ore +--! @param value public.{{prefix}}_numeric_ord_ore +--! @return public.{{prefix}}_numeric_ord_ore +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_numeric_ord_ore, value public.{{prefix}}_numeric_ord_ore) +RETURNS public.{{prefix}}_numeric_ord_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_numeric_ord_ore. ---! @param input public.eql_v3_numeric_ord_ore ---! @return public.eql_v3_numeric_ord_ore -CREATE AGGREGATE eql_v3.max(public.eql_v3_numeric_ord_ore) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_numeric_ord_ore, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_numeric_ord_ore. +--! @param input public.{{prefix}}_numeric_ord_ore +--! @return public.{{prefix}}_numeric_ord_ore +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_numeric_ord_ore) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_numeric_ord_ore, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/numeric/numeric_ord_ore_functions.sql b/packages/eql/src/v3/scalars/numeric/numeric_ord_ore_functions.sql index 5481863bc..748793ea5 100644 --- a/packages/eql/src/v3/scalars/numeric/numeric_ord_ore_functions.sql +++ b/packages/eql/src/v3/scalars/numeric/numeric_ord_ore_functions.sql @@ -6,562 +6,562 @@ -- REQUIRE: src/v3/sem/ore_block_256/operators.sql --! @file encrypted_domain/numeric/numeric_ord_ore_functions.sql ---! @brief Functions for public.eql_v3_numeric_ord_ore. +--! @brief Functions for public.{{prefix}}_numeric_ord_ore. ---! @brief Index extractor for public.eql_v3_numeric_ord_ore. ---! @param a public.eql_v3_numeric_ord_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a public.eql_v3_numeric_ord_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for public.{{prefix}}_numeric_ord_ore. +--! @param a public.{{prefix}}_numeric_ord_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a public.{{prefix}}_numeric_ord_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ore. ---! @param a public.eql_v3_numeric_ord_ore ---! @param b public.eql_v3_numeric_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. +--! @param a public.{{prefix}}_numeric_ord_ore +--! @param b public.{{prefix}}_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_numeric_ord_ore, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ore. ---! @param a public.eql_v3_numeric_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. +--! @param a public.{{prefix}}_numeric_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_numeric_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b::public.eql_v3_numeric_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{prefix}}_numeric_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_numeric_ord_ore +--! @param b public.{{prefix}}_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_numeric_ord_ore) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ore. ---! @param a public.eql_v3_numeric_ord_ore ---! @param b public.eql_v3_numeric_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. +--! @param a public.{{prefix}}_numeric_ord_ore +--! @param b public.{{prefix}}_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_numeric_ord_ore, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ore. ---! @param a public.eql_v3_numeric_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. +--! @param a public.{{prefix}}_numeric_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_numeric_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b::public.eql_v3_numeric_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{prefix}}_numeric_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_numeric_ord_ore +--! @param b public.{{prefix}}_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_numeric_ord_ore) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ore. ---! @param a public.eql_v3_numeric_ord_ore ---! @param b public.eql_v3_numeric_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. +--! @param a public.{{prefix}}_numeric_ord_ore +--! @param b public.{{prefix}}_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_numeric_ord_ore, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ore. ---! @param a public.eql_v3_numeric_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. +--! @param a public.{{prefix}}_numeric_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_numeric_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_numeric_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b::public.eql_v3_numeric_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_numeric_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_numeric_ord_ore +--! @param b public.{{prefix}}_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_numeric_ord_ore) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ore. ---! @param a public.eql_v3_numeric_ord_ore ---! @param b public.eql_v3_numeric_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. +--! @param a public.{{prefix}}_numeric_ord_ore +--! @param b public.{{prefix}}_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_numeric_ord_ore, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ore. ---! @param a public.eql_v3_numeric_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. +--! @param a public.{{prefix}}_numeric_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_numeric_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_numeric_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b::public.eql_v3_numeric_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_numeric_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_numeric_ord_ore +--! @param b public.{{prefix}}_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_numeric_ord_ore) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ore. ---! @param a public.eql_v3_numeric_ord_ore ---! @param b public.eql_v3_numeric_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. +--! @param a public.{{prefix}}_numeric_ord_ore +--! @param b public.{{prefix}}_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_numeric_ord_ore, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ore. ---! @param a public.eql_v3_numeric_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. +--! @param a public.{{prefix}}_numeric_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_numeric_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_numeric_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b::public.eql_v3_numeric_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_numeric_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_numeric_ord_ore +--! @param b public.{{prefix}}_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_numeric_ord_ore) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ore. ---! @param a public.eql_v3_numeric_ord_ore ---! @param b public.eql_v3_numeric_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. +--! @param a public.{{prefix}}_numeric_ord_ore +--! @param b public.{{prefix}}_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_numeric_ord_ore, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ore. ---! @param a public.eql_v3_numeric_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. +--! @param a public.{{prefix}}_numeric_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_numeric_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_numeric_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b::public.eql_v3_numeric_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_numeric_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_numeric_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_numeric_ord_ore +--! @param b public.{{prefix}}_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_numeric_ord_ore) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_numeric_ord_ore, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_numeric_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_numeric_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_numeric_ord_ore, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_numeric_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_numeric_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_numeric_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_numeric_ord_ore, selector text) -RETURNS public.eql_v3_numeric_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_numeric_ord_ore'; END; $$ +--! @return public.{{prefix}}_numeric_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_numeric_ord_ore, selector text) +RETURNS public.{{prefix}}_numeric_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_numeric_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_numeric_ord_ore, selector integer) -RETURNS public.eql_v3_numeric_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_numeric_ord_ore'; END; $$ +--! @return public.{{prefix}}_numeric_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_numeric_ord_ore, selector integer) +RETURNS public.{{prefix}}_numeric_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_numeric_ord_ore right operand of the blocked operator ---! @return public.eql_v3_numeric_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_numeric_ord_ore) -RETURNS public.eql_v3_numeric_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_numeric_ord_ore'; END; $$ +--! @param selector public.{{prefix}}_numeric_ord_ore right operand of the blocked operator +--! @return public.{{prefix}}_numeric_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_numeric_ord_ore) +RETURNS public.{{prefix}}_numeric_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_numeric_ord_ore, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_numeric_ord_ore, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_numeric_ord_ore, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_numeric_ord_ore, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_numeric_ord_ore right operand of the blocked operator +--! @param selector public.{{prefix}}_numeric_ord_ore right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_numeric_ord_ore) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_numeric_ord_ore, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_numeric_ord_ore, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_numeric_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_numeric_ord_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_numeric_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_numeric_ord_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_numeric_ord_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_numeric_ord_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_numeric_ord_ore, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_numeric_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_numeric_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_numeric_ord_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_numeric_ord_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_numeric_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_numeric_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_numeric_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_numeric_ord_ore, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_numeric_ord_ore, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_numeric_ord_ore, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_numeric_ord_ore, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_numeric_ord_ore, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_numeric_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_numeric_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_numeric_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_numeric_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_numeric_ord_ore, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_numeric_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_numeric_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_numeric_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_numeric_ord_ore, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_numeric_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_numeric_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_numeric_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_numeric_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_numeric_ord_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_numeric_ord_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_numeric_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_numeric_ord_ore'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/numeric/numeric_ord_ore_operators.sql b/packages/eql/src/v3/scalars/numeric/numeric_ord_ore_operators.sql index ed2e72be8..c017dd604 100644 --- a/packages/eql/src/v3/scalars/numeric/numeric_ord_ore_operators.sql +++ b/packages/eql/src/v3/scalars/numeric/numeric_ord_ore_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/numeric/numeric_ord_ore_functions.sql --! @file encrypted_domain/numeric/numeric_ord_ore_operators.sql ---! @brief Operators for public.eql_v3_numeric_ord_ore. +--! @brief Operators for public.{{prefix}}_numeric_ord_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = public.eql_v3_numeric_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = public.eql_v3_numeric_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = public.eql_v3_numeric_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = public.eql_v3_numeric_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = public.eql_v3_numeric_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = public.eql_v3_numeric_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = public.eql_v3_numeric_ord_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ore ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = public.eql_v3_numeric_ord_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ore ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ore + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ore ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ore + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ore ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = public.eql_v3_numeric_ord_ore + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ore ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ore + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ore ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = public.eql_v3_numeric_ord_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ore ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_numeric_ord_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_numeric_ord_ore ); diff --git a/packages/eql/src/v3/scalars/numeric/numeric_types.sql b/packages/eql/src/v3/scalars/numeric/numeric_types.sql index 3ee6c9627..37852ac11 100644 --- a/packages/eql/src/v3/scalars/numeric/numeric_types.sql +++ b/packages/eql/src/v3/scalars/numeric/numeric_types.sql @@ -6,47 +6,47 @@ DO $$ BEGIN - --! @brief Encrypted domain public.eql_v3_numeric. + --! @brief Encrypted domain public.{{prefix}}_numeric. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_numeric' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_numeric' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_numeric AS jsonb + CREATE DOMAIN public.{{prefix}}_numeric AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_numeric IS 'EQL encrypted numeric (storage only)'; + COMMENT ON DOMAIN public.{{prefix}}_numeric IS 'EQL encrypted numeric (storage only)'; - --! @brief Encrypted domain public.eql_v3_numeric_eq. + --! @brief Encrypted domain public.{{prefix}}_numeric_eq. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_numeric_eq' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_numeric_eq' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_numeric_eq AS jsonb + CREATE DOMAIN public.{{prefix}}_numeric_eq AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'hm' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_numeric_eq IS 'EQL encrypted numeric (equality)'; + COMMENT ON DOMAIN public.{{prefix}}_numeric_eq IS 'EQL encrypted numeric (equality)'; - --! @brief Encrypted domain public.eql_v3_numeric_ord_ore. + --! @brief Encrypted domain public.{{prefix}}_numeric_ord_ore. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_numeric_ord_ore' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_numeric_ord_ore' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_numeric_ord_ore AS jsonb + CREATE DOMAIN public.{{prefix}}_numeric_ord_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -55,46 +55,46 @@ BEGIN AND VALUE ? 'ob' AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_numeric_ord_ore IS 'EQL encrypted numeric (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_numeric_ord_ore IS 'EQL encrypted numeric (equality, ordering)'; - --! @brief Encrypted domain public.eql_v3_numeric_ord. + --! @brief Encrypted domain public.{{prefix}}_numeric_ord. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_numeric_ord' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_numeric_ord' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_numeric_ord AS jsonb + CREATE DOMAIN public.{{prefix}}_numeric_ord AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'op' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_numeric_ord IS 'EQL encrypted numeric (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_numeric_ord IS 'EQL encrypted numeric (equality, ordering)'; - --! @brief Encrypted domain public.eql_v3_numeric_ord_ope. + --! @brief Encrypted domain public.{{prefix}}_numeric_ord_ope. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_numeric_ord_ope' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_numeric_ord_ope' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_numeric_ord_ope AS jsonb + CREATE DOMAIN public.{{prefix}}_numeric_ord_ope AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'op' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_numeric_ord_ope IS 'EQL encrypted numeric (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_numeric_ord_ope IS 'EQL encrypted numeric (equality, ordering)'; END $$; diff --git a/packages/eql/src/v3/scalars/numeric/query_numeric_eq_functions.sql b/packages/eql/src/v3/scalars/numeric/query_numeric_eq_functions.sql index 7286732dc..b250bac08 100644 --- a/packages/eql/src/v3/scalars/numeric/query_numeric_eq_functions.sql +++ b/packages/eql/src/v3/scalars/numeric/query_numeric_eq_functions.sql @@ -4,44 +4,44 @@ -- REQUIRE: src/v3/scalars/numeric/numeric_eq_functions.sql --! @file encrypted_domain/numeric/query_numeric_eq_functions.sql ---! @brief Functions for eql_v3.query_numeric_eq. +--! @brief Functions for {{prefix}}.query_numeric_eq. ---! @brief Index extractor for eql_v3.query_numeric_eq. ---! @param a eql_v3.query_numeric_eq ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a eql_v3.query_numeric_eq) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for {{prefix}}.query_numeric_eq. +--! @param a {{prefix}}.query_numeric_eq +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a {{prefix}}.query_numeric_eq) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_eq. ---! @param a public.eql_v3_numeric_eq ---! @param b eql_v3.query_numeric_eq +--! @brief Operator wrapper for {{prefix}}.query_numeric_eq. +--! @param a public.{{prefix}}_numeric_eq +--! @param b {{prefix}}.query_numeric_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_numeric_eq, b eql_v3.query_numeric_eq) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_eq, b {{prefix}}.query_numeric_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_eq. ---! @param a eql_v3.query_numeric_eq ---! @param b public.eql_v3_numeric_eq +--! @brief Operator wrapper for {{prefix}}.query_numeric_eq. +--! @param a {{prefix}}.query_numeric_eq +--! @param b public.{{prefix}}_numeric_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_numeric_eq, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_numeric_eq, b public.{{prefix}}_numeric_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_eq. ---! @param a public.eql_v3_numeric_eq ---! @param b eql_v3.query_numeric_eq +--! @brief Operator wrapper for {{prefix}}.query_numeric_eq. +--! @param a public.{{prefix}}_numeric_eq +--! @param b {{prefix}}.query_numeric_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_numeric_eq, b eql_v3.query_numeric_eq) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_eq, b {{prefix}}.query_numeric_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_eq. ---! @param a eql_v3.query_numeric_eq ---! @param b public.eql_v3_numeric_eq +--! @brief Operator wrapper for {{prefix}}.query_numeric_eq. +--! @param a {{prefix}}.query_numeric_eq +--! @param b public.{{prefix}}_numeric_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_numeric_eq, b public.eql_v3_numeric_eq) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_numeric_eq, b public.{{prefix}}_numeric_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; diff --git a/packages/eql/src/v3/scalars/numeric/query_numeric_eq_operators.sql b/packages/eql/src/v3/scalars/numeric/query_numeric_eq_operators.sql index 046b26a63..78ad85f81 100644 --- a/packages/eql/src/v3/scalars/numeric/query_numeric_eq_operators.sql +++ b/packages/eql/src/v3/scalars/numeric/query_numeric_eq_operators.sql @@ -4,28 +4,28 @@ -- REQUIRE: src/v3/scalars/numeric/query_numeric_eq_functions.sql --! @file encrypted_domain/numeric/query_numeric_eq_operators.sql ---! @brief Operators for eql_v3.query_numeric_eq. +--! @brief Operators for {{prefix}}.query_numeric_eq. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = eql_v3.query_numeric_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = {{prefix}}.query_numeric_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_numeric_eq, RIGHTARG = public.eql_v3_numeric_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_numeric_eq, RIGHTARG = public.{{prefix}}_numeric_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_numeric_eq, RIGHTARG = eql_v3.query_numeric_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = {{prefix}}.query_numeric_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_numeric_eq, RIGHTARG = public.eql_v3_numeric_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_numeric_eq, RIGHTARG = public.{{prefix}}_numeric_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); diff --git a/packages/eql/src/v3/scalars/numeric/query_numeric_ord_functions.sql b/packages/eql/src/v3/scalars/numeric/query_numeric_ord_functions.sql index 104bd7125..08cfcf2fc 100644 --- a/packages/eql/src/v3/scalars/numeric/query_numeric_ord_functions.sql +++ b/packages/eql/src/v3/scalars/numeric/query_numeric_ord_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/numeric/numeric_ord_functions.sql --! @file encrypted_domain/numeric/query_numeric_ord_functions.sql ---! @brief Functions for eql_v3.query_numeric_ord. +--! @brief Functions for {{prefix}}.query_numeric_ord. ---! @brief Index extractor for eql_v3.query_numeric_ord. ---! @param a eql_v3.query_numeric_ord ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a eql_v3.query_numeric_ord) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for {{prefix}}.query_numeric_ord. +--! @param a {{prefix}}.query_numeric_ord +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a {{prefix}}.query_numeric_ord) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord. ---! @param a public.eql_v3_numeric_ord ---! @param b eql_v3.query_numeric_ord +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord. +--! @param a public.{{prefix}}_numeric_ord +--! @param b {{prefix}}.query_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_numeric_ord, b eql_v3.query_numeric_ord) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord. ---! @param a eql_v3.query_numeric_ord ---! @param b public.eql_v3_numeric_ord +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord. +--! @param a {{prefix}}.query_numeric_ord +--! @param b public.{{prefix}}_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_numeric_ord, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord. ---! @param a public.eql_v3_numeric_ord ---! @param b eql_v3.query_numeric_ord +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord. +--! @param a public.{{prefix}}_numeric_ord +--! @param b {{prefix}}.query_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_numeric_ord, b eql_v3.query_numeric_ord) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord. ---! @param a eql_v3.query_numeric_ord ---! @param b public.eql_v3_numeric_ord +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord. +--! @param a {{prefix}}.query_numeric_ord +--! @param b public.{{prefix}}_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_numeric_ord, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord. ---! @param a public.eql_v3_numeric_ord ---! @param b eql_v3.query_numeric_ord +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord. +--! @param a public.{{prefix}}_numeric_ord +--! @param b {{prefix}}.query_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_numeric_ord, b eql_v3.query_numeric_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord. ---! @param a eql_v3.query_numeric_ord ---! @param b public.eql_v3_numeric_ord +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord. +--! @param a {{prefix}}.query_numeric_ord +--! @param b public.{{prefix}}_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_numeric_ord, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord. ---! @param a public.eql_v3_numeric_ord ---! @param b eql_v3.query_numeric_ord +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord. +--! @param a public.{{prefix}}_numeric_ord +--! @param b {{prefix}}.query_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_numeric_ord, b eql_v3.query_numeric_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord. ---! @param a eql_v3.query_numeric_ord ---! @param b public.eql_v3_numeric_ord +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord. +--! @param a {{prefix}}.query_numeric_ord +--! @param b public.{{prefix}}_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_numeric_ord, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord. ---! @param a public.eql_v3_numeric_ord ---! @param b eql_v3.query_numeric_ord +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord. +--! @param a public.{{prefix}}_numeric_ord +--! @param b {{prefix}}.query_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_numeric_ord, b eql_v3.query_numeric_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord. ---! @param a eql_v3.query_numeric_ord ---! @param b public.eql_v3_numeric_ord +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord. +--! @param a {{prefix}}.query_numeric_ord +--! @param b public.{{prefix}}_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_numeric_ord, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord. ---! @param a public.eql_v3_numeric_ord ---! @param b eql_v3.query_numeric_ord +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord. +--! @param a public.{{prefix}}_numeric_ord +--! @param b {{prefix}}.query_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_numeric_ord, b eql_v3.query_numeric_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord. ---! @param a eql_v3.query_numeric_ord ---! @param b public.eql_v3_numeric_ord +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord. +--! @param a {{prefix}}.query_numeric_ord +--! @param b public.{{prefix}}_numeric_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_numeric_ord, b public.eql_v3_numeric_ord) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/numeric/query_numeric_ord_ope_functions.sql b/packages/eql/src/v3/scalars/numeric/query_numeric_ord_ope_functions.sql index 41f326c5a..cafc3daa9 100644 --- a/packages/eql/src/v3/scalars/numeric/query_numeric_ord_ope_functions.sql +++ b/packages/eql/src/v3/scalars/numeric/query_numeric_ord_ope_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/numeric/numeric_ord_ope_functions.sql --! @file encrypted_domain/numeric/query_numeric_ord_ope_functions.sql ---! @brief Functions for eql_v3.query_numeric_ord_ope. +--! @brief Functions for {{prefix}}.query_numeric_ord_ope. ---! @brief Index extractor for eql_v3.query_numeric_ord_ope. ---! @param a eql_v3.query_numeric_ord_ope ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a eql_v3.query_numeric_ord_ope) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for {{prefix}}.query_numeric_ord_ope. +--! @param a {{prefix}}.query_numeric_ord_ope +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a {{prefix}}.query_numeric_ord_ope) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ope. ---! @param a public.eql_v3_numeric_ord_ope ---! @param b eql_v3.query_numeric_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. +--! @param a public.{{prefix}}_numeric_ord_ope +--! @param b {{prefix}}.query_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_numeric_ord_ope, b eql_v3.query_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ope. ---! @param a eql_v3.query_numeric_ord_ope ---! @param b public.eql_v3_numeric_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. +--! @param a {{prefix}}.query_numeric_ord_ope +--! @param b public.{{prefix}}_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_numeric_ord_ope, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ope. ---! @param a public.eql_v3_numeric_ord_ope ---! @param b eql_v3.query_numeric_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. +--! @param a public.{{prefix}}_numeric_ord_ope +--! @param b {{prefix}}.query_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_numeric_ord_ope, b eql_v3.query_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ope. ---! @param a eql_v3.query_numeric_ord_ope ---! @param b public.eql_v3_numeric_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. +--! @param a {{prefix}}.query_numeric_ord_ope +--! @param b public.{{prefix}}_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_numeric_ord_ope, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ope. ---! @param a public.eql_v3_numeric_ord_ope ---! @param b eql_v3.query_numeric_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. +--! @param a public.{{prefix}}_numeric_ord_ope +--! @param b {{prefix}}.query_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_numeric_ord_ope, b eql_v3.query_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ope. ---! @param a eql_v3.query_numeric_ord_ope ---! @param b public.eql_v3_numeric_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. +--! @param a {{prefix}}.query_numeric_ord_ope +--! @param b public.{{prefix}}_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_numeric_ord_ope, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ope. ---! @param a public.eql_v3_numeric_ord_ope ---! @param b eql_v3.query_numeric_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. +--! @param a public.{{prefix}}_numeric_ord_ope +--! @param b {{prefix}}.query_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_numeric_ord_ope, b eql_v3.query_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ope. ---! @param a eql_v3.query_numeric_ord_ope ---! @param b public.eql_v3_numeric_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. +--! @param a {{prefix}}.query_numeric_ord_ope +--! @param b public.{{prefix}}_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_numeric_ord_ope, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ope. ---! @param a public.eql_v3_numeric_ord_ope ---! @param b eql_v3.query_numeric_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. +--! @param a public.{{prefix}}_numeric_ord_ope +--! @param b {{prefix}}.query_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_numeric_ord_ope, b eql_v3.query_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ope. ---! @param a eql_v3.query_numeric_ord_ope ---! @param b public.eql_v3_numeric_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. +--! @param a {{prefix}}.query_numeric_ord_ope +--! @param b public.{{prefix}}_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_numeric_ord_ope, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ope. ---! @param a public.eql_v3_numeric_ord_ope ---! @param b eql_v3.query_numeric_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. +--! @param a public.{{prefix}}_numeric_ord_ope +--! @param b {{prefix}}.query_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_numeric_ord_ope, b eql_v3.query_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ope. ---! @param a eql_v3.query_numeric_ord_ope ---! @param b public.eql_v3_numeric_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. +--! @param a {{prefix}}.query_numeric_ord_ope +--! @param b public.{{prefix}}_numeric_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_numeric_ord_ope, b public.eql_v3_numeric_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/numeric/query_numeric_ord_ope_operators.sql b/packages/eql/src/v3/scalars/numeric/query_numeric_ord_ope_operators.sql index fa3d91bd1..2a16ae3af 100644 --- a/packages/eql/src/v3/scalars/numeric/query_numeric_ord_ope_operators.sql +++ b/packages/eql/src/v3/scalars/numeric/query_numeric_ord_ope_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/numeric/query_numeric_ord_ope_functions.sql --! @file encrypted_domain/numeric/query_numeric_ord_ope_operators.sql ---! @brief Operators for eql_v3.query_numeric_ord_ope. +--! @brief Operators for {{prefix}}.query_numeric_ord_ope. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = eql_v3.query_numeric_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_numeric_ord_ope, RIGHTARG = public.eql_v3_numeric_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = eql_v3.query_numeric_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_numeric_ord_ope, RIGHTARG = public.eql_v3_numeric_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = eql_v3.query_numeric_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_numeric_ord_ope, RIGHTARG = public.eql_v3_numeric_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = eql_v3.query_numeric_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_numeric_ord_ope, RIGHTARG = public.eql_v3_numeric_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = eql_v3.query_numeric_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_numeric_ord_ope, RIGHTARG = public.eql_v3_numeric_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_numeric_ord_ope, RIGHTARG = eql_v3.query_numeric_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_numeric_ord_ope, RIGHTARG = public.eql_v3_numeric_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/numeric/query_numeric_ord_operators.sql b/packages/eql/src/v3/scalars/numeric/query_numeric_ord_operators.sql index e88a4aa28..88ba9557e 100644 --- a/packages/eql/src/v3/scalars/numeric/query_numeric_ord_operators.sql +++ b/packages/eql/src/v3/scalars/numeric/query_numeric_ord_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/numeric/query_numeric_ord_functions.sql --! @file encrypted_domain/numeric/query_numeric_ord_operators.sql ---! @brief Operators for eql_v3.query_numeric_ord. +--! @brief Operators for {{prefix}}.query_numeric_ord. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = eql_v3.query_numeric_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_numeric_ord, RIGHTARG = public.eql_v3_numeric_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = eql_v3.query_numeric_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_numeric_ord, RIGHTARG = public.eql_v3_numeric_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = eql_v3.query_numeric_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_numeric_ord, RIGHTARG = public.eql_v3_numeric_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = eql_v3.query_numeric_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_numeric_ord, RIGHTARG = public.eql_v3_numeric_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = eql_v3.query_numeric_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_numeric_ord, RIGHTARG = public.eql_v3_numeric_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_numeric_ord, RIGHTARG = eql_v3.query_numeric_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_numeric_ord, RIGHTARG = public.eql_v3_numeric_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/numeric/query_numeric_ord_ore_functions.sql b/packages/eql/src/v3/scalars/numeric/query_numeric_ord_ore_functions.sql index 7b0b3b19b..092a57f9c 100644 --- a/packages/eql/src/v3/scalars/numeric/query_numeric_ord_ore_functions.sql +++ b/packages/eql/src/v3/scalars/numeric/query_numeric_ord_ore_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/numeric/numeric_ord_ore_functions.sql --! @file encrypted_domain/numeric/query_numeric_ord_ore_functions.sql ---! @brief Functions for eql_v3.query_numeric_ord_ore. +--! @brief Functions for {{prefix}}.query_numeric_ord_ore. ---! @brief Index extractor for eql_v3.query_numeric_ord_ore. ---! @param a eql_v3.query_numeric_ord_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a eql_v3.query_numeric_ord_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for {{prefix}}.query_numeric_ord_ore. +--! @param a {{prefix}}.query_numeric_ord_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a {{prefix}}.query_numeric_ord_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ore. ---! @param a public.eql_v3_numeric_ord_ore ---! @param b eql_v3.query_numeric_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. +--! @param a public.{{prefix}}_numeric_ord_ore +--! @param b {{prefix}}.query_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_numeric_ord_ore, b eql_v3.query_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ore. ---! @param a eql_v3.query_numeric_ord_ore ---! @param b public.eql_v3_numeric_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. +--! @param a {{prefix}}.query_numeric_ord_ore +--! @param b public.{{prefix}}_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_numeric_ord_ore, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ore. ---! @param a public.eql_v3_numeric_ord_ore ---! @param b eql_v3.query_numeric_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. +--! @param a public.{{prefix}}_numeric_ord_ore +--! @param b {{prefix}}.query_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_numeric_ord_ore, b eql_v3.query_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ore. ---! @param a eql_v3.query_numeric_ord_ore ---! @param b public.eql_v3_numeric_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. +--! @param a {{prefix}}.query_numeric_ord_ore +--! @param b public.{{prefix}}_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_numeric_ord_ore, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ore. ---! @param a public.eql_v3_numeric_ord_ore ---! @param b eql_v3.query_numeric_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. +--! @param a public.{{prefix}}_numeric_ord_ore +--! @param b {{prefix}}.query_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_numeric_ord_ore, b eql_v3.query_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ore. ---! @param a eql_v3.query_numeric_ord_ore ---! @param b public.eql_v3_numeric_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. +--! @param a {{prefix}}.query_numeric_ord_ore +--! @param b public.{{prefix}}_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_numeric_ord_ore, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ore. ---! @param a public.eql_v3_numeric_ord_ore ---! @param b eql_v3.query_numeric_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. +--! @param a public.{{prefix}}_numeric_ord_ore +--! @param b {{prefix}}.query_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_numeric_ord_ore, b eql_v3.query_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ore. ---! @param a eql_v3.query_numeric_ord_ore ---! @param b public.eql_v3_numeric_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. +--! @param a {{prefix}}.query_numeric_ord_ore +--! @param b public.{{prefix}}_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_numeric_ord_ore, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ore. ---! @param a public.eql_v3_numeric_ord_ore ---! @param b eql_v3.query_numeric_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. +--! @param a public.{{prefix}}_numeric_ord_ore +--! @param b {{prefix}}.query_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_numeric_ord_ore, b eql_v3.query_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ore. ---! @param a eql_v3.query_numeric_ord_ore ---! @param b public.eql_v3_numeric_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. +--! @param a {{prefix}}.query_numeric_ord_ore +--! @param b public.{{prefix}}_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_numeric_ord_ore, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ore. ---! @param a public.eql_v3_numeric_ord_ore ---! @param b eql_v3.query_numeric_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. +--! @param a public.{{prefix}}_numeric_ord_ore +--! @param b {{prefix}}.query_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_numeric_ord_ore, b eql_v3.query_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_numeric_ord_ore. ---! @param a eql_v3.query_numeric_ord_ore ---! @param b public.eql_v3_numeric_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. +--! @param a {{prefix}}.query_numeric_ord_ore +--! @param b public.{{prefix}}_numeric_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_numeric_ord_ore, b public.eql_v3_numeric_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; diff --git a/packages/eql/src/v3/scalars/numeric/query_numeric_ord_ore_operators.sql b/packages/eql/src/v3/scalars/numeric/query_numeric_ord_ore_operators.sql index 0147b7351..b9d1959cc 100644 --- a/packages/eql/src/v3/scalars/numeric/query_numeric_ord_ore_operators.sql +++ b/packages/eql/src/v3/scalars/numeric/query_numeric_ord_ore_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/numeric/query_numeric_ord_ore_functions.sql --! @file encrypted_domain/numeric/query_numeric_ord_ore_operators.sql ---! @brief Operators for eql_v3.query_numeric_ord_ore. +--! @brief Operators for {{prefix}}.query_numeric_ord_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = eql_v3.query_numeric_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_numeric_ord_ore, RIGHTARG = public.eql_v3_numeric_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = eql_v3.query_numeric_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_numeric_ord_ore, RIGHTARG = public.eql_v3_numeric_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = eql_v3.query_numeric_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_numeric_ord_ore, RIGHTARG = public.eql_v3_numeric_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = eql_v3.query_numeric_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_numeric_ord_ore, RIGHTARG = public.eql_v3_numeric_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = eql_v3.query_numeric_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_numeric_ord_ore, RIGHTARG = public.eql_v3_numeric_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_numeric_ord_ore, RIGHTARG = eql_v3.query_numeric_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_numeric_ord_ore, RIGHTARG = public.eql_v3_numeric_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/numeric/query_numeric_range_functions.sql b/packages/eql/src/v3/scalars/numeric/query_numeric_range_functions.sql new file mode 100644 index 000000000..193f9763b --- /dev/null +++ b/packages/eql/src/v3/scalars/numeric/query_numeric_range_functions.sql @@ -0,0 +1,177 @@ +-- AUTOMATICALLY GENERATED FILE. +-- ONLY EQL VERSION: 4 +-- REQUIRE: src/v3/schema.sql +-- REQUIRE: src/v3/scalars/numeric/query_numeric_range_types.sql +-- REQUIRE: src/v3/scalars/numeric/numeric_ord_ore_functions.sql +-- REQUIRE: src/v3/scalars/numeric/numeric_ord_functions.sql +-- REQUIRE: src/v3/scalars/numeric/numeric_ord_ope_functions.sql +-- REQUIRE: src/v3/sem/ore_block_256/functions.sql +-- REQUIRE: src/v3/sem/ore_block_256/operators.sql +-- REQUIRE: src/v3/sem/ope_cllw/functions.sql + +--! @file v3/scalars/numeric/query_numeric_range_functions.sql +--! @brief The bound accessors and `{{prefix}}.between` for numeric's range query domains. +--! @note EQL version {{eql_version}} only, like the range domains themselves. + +--! @brief The low bound of a {{prefix}}.query_numeric_range_ore, as a block ORE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_numeric_range_ore Range query operand +--! @return {{prefix}}_internal.ore_block_256 The low bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.lo(r {{prefix}}.query_numeric_range_ore) +RETURNS {{prefix}}_internal.ore_block_256 +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ore_block_256(jsonb_build_object('ob', r::jsonb -> 'lo')) $$; + +--! @brief The high bound of a {{prefix}}.query_numeric_range_ore, as a block ORE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_numeric_range_ore Range query operand +--! @return {{prefix}}_internal.ore_block_256 The high bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.hi(r {{prefix}}.query_numeric_range_ore) +RETURNS {{prefix}}_internal.ore_block_256 +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ore_block_256(jsonb_build_object('ob', r::jsonb -> 'hi')) $$; + +--! @brief The low bound of a {{prefix}}.query_numeric_range_ope, as a CLLW OPE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_numeric_range_ope Range query operand +--! @return {{prefix}}_internal.ope_cllw The low bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.lo(r {{prefix}}.query_numeric_range_ope) +RETURNS {{prefix}}_internal.ope_cllw +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> 'lo')) $$; + +--! @brief The high bound of a {{prefix}}.query_numeric_range_ope, as a CLLW OPE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_numeric_range_ope Range query operand +--! @return {{prefix}}_internal.ope_cllw The high bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.hi(r {{prefix}}.query_numeric_range_ope) +RETURNS {{prefix}}_internal.ope_cllw +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> 'hi')) $$; + +--! @brief Whether a public.{{prefix}}_numeric_ord_ore value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_numeric_range_ore)`. +--! +--! @param a public.{{prefix}}_numeric_ord_ore Encrypted column value +--! @param r {{prefix}}.query_numeric_range_ore Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term_ore(a)`, which a btree index on that expression +--! serves as one range scan. For this ORE range that index needs the +--! default btree operator class on {{prefix}}_internal.ore_block_256, which the +--! installer creates only with superuser privileges. Without it (on Supabase, +--! for instance) the installer disables the ORE column domains and this ORE range, +--! so use an OPE column (`public.{{prefix}}_numeric_ord`, `public.{{prefix}}_numeric_ord_ope`) +--! and `{{prefix}}.query_numeric_range_ope`, which index everywhere. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_numeric_range_ore`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_numeric_ord_ore, r {{prefix}}.query_numeric_range_ore) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_numeric_ord value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_numeric_range_ope)`. +--! +--! @param a public.{{prefix}}_numeric_ord Encrypted column value +--! @param r {{prefix}}.query_numeric_range_ope Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term(a)`, which a btree index on that expression +--! serves as one range scan. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_numeric_range_ope`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_numeric_ord, r {{prefix}}.query_numeric_range_ope) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_numeric_ord_ope value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_numeric_range_ope)`. +--! +--! @param a public.{{prefix}}_numeric_ord_ope Encrypted column value +--! @param r {{prefix}}.query_numeric_range_ope Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term(a)`, which a btree index on that expression +--! serves as one range scan. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_numeric_range_ope`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_numeric_ord_ope, r {{prefix}}.query_numeric_range_ope) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r) $$; diff --git a/packages/eql/src/v3/scalars/numeric/query_numeric_range_types.sql b/packages/eql/src/v3/scalars/numeric/query_numeric_range_types.sql new file mode 100644 index 000000000..2bd28ed5b --- /dev/null +++ b/packages/eql/src/v3/scalars/numeric/query_numeric_range_types.sql @@ -0,0 +1,107 @@ +-- AUTOMATICALLY GENERATED FILE. +-- ONLY EQL VERSION: 4 +-- REQUIRE: src/v3/schema.sql +-- REQUIRE: src/v3/scalars/ore_fallback.sql + +--! @file v3/scalars/numeric/query_numeric_range_types.sql +--! @brief Range query-operand domains for numeric: the operand of `{{prefix}}.between`. +--! @note A range holds both bounds of one `BETWEEN` as one value: +--! `{"v": {{eql_version}}, "i": {...}, "lo": , "hi": }`. Each bound is the +--! single-bound query domain's `ob` (ORE) or `op` (OPE) value, in a +--! `{v, i, lo, hi}` envelope. Both bounds are included. There is one +--! range domain per ordering term the family stores (ADR-0009, +--! decisions 7 and 8). +--! @note Cast the range parameter to its exact range domain +--! (`$1::{{prefix}}.query_numeric_range_ore`). An uncast `$1`, a `jsonb` +--! parameter, or a range of another term or family fails with 42725 +--! ("function ... is not unique"); see `{{prefix}}.between`. +--! @note EQL version {{eql_version}} only: the `-- ONLY EQL VERSION:` line above keeps this +--! file out of every other version's installer. +--! @note Like every query operand, a range lives in `{{prefix}}`, not `public`, +--! and holds no ciphertext `c`. A range whose low bound is above its +--! high bound matches no row, as with SQL `BETWEEN`; the SQL does not +--! reorder the bounds. +--! @note On an install without the ORE operator class (a non-superuser +--! install, on Supabase for instance), the ORE range domain is disabled +--! as the single-bound ORE domains are: a value cast to it raises +--! `feature_not_supported`, naming the OPE range. See +--! `v3/scalars/ore_fallback.sql`. + +DO $$ +BEGIN + --! @brief Range query-operand domain {{prefix}}.query_numeric_range_ore (two block ORE bounds; no `c`). + IF NOT EXISTS ( + SELECT 1 FROM pg_type + WHERE typname = 'query_numeric_range_ore' AND typnamespace = '{{prefix}}'::regnamespace + ) THEN + CREATE DOMAIN {{prefix}}.query_numeric_range_ore AS jsonb + CHECK ( + jsonb_typeof(VALUE) = 'object' + AND VALUE ? 'v' + AND VALUE ? 'i' + AND VALUE ? 'lo' + AND VALUE ? 'hi' + AND NOT (VALUE ? 'c') + AND jsonb_typeof(VALUE -> 'lo') = 'array' + AND jsonb_array_length(VALUE -> 'lo') > 0 + AND jsonb_typeof(VALUE -> 'hi') = 'array' + AND jsonb_array_length(VALUE -> 'hi') > 0 + -- `"v": null` makes the comparison NULL, and a CHECK that is NULL + -- passes, so COALESCE refuses it. A NULL range still passes (no row + -- matches it). The comparison keeps the one form the v4 isolation + -- gate accepts. + AND COALESCE(VALUE->>'v' = '{{eql_version}}', VALUE IS NULL) + ); + END IF; + + COMMENT ON DOMAIN {{prefix}}.query_numeric_range_ore IS 'EQL numeric range query operand (block ORE)'; + + --! @brief Range query-operand domain {{prefix}}.query_numeric_range_ope (two CLLW OPE bounds; no `c`). + IF NOT EXISTS ( + SELECT 1 FROM pg_type + WHERE typname = 'query_numeric_range_ope' AND typnamespace = '{{prefix}}'::regnamespace + ) THEN + CREATE DOMAIN {{prefix}}.query_numeric_range_ope AS jsonb + CHECK ( + jsonb_typeof(VALUE) = 'object' + AND VALUE ? 'v' + AND VALUE ? 'i' + AND VALUE ? 'lo' + AND VALUE ? 'hi' + AND NOT (VALUE ? 'c') + AND jsonb_typeof(VALUE -> 'lo') = 'string' + AND jsonb_typeof(VALUE -> 'hi') = 'string' + -- `"v": null` makes the comparison NULL, and a CHECK that is NULL + -- passes, so COALESCE refuses it. A NULL range still passes (no row + -- matches it). The comparison keeps the one form the v4 isolation + -- gate accepts. + AND COALESCE(VALUE->>'v' = '{{eql_version}}', VALUE IS NULL) + ); + END IF; + + COMMENT ON DOMAIN {{prefix}}.query_numeric_range_ope IS 'EQL numeric range query operand (CLLW OPE)'; +END +$$; + +-- Without the default btree operator class on {{prefix}}_internal.ore_block_256 +-- (the installer skips it on insufficient_privilege), ore_fallback.sql has +-- created {{prefix}}_internal.ore_domain_unavailable and poisoned the +-- single-bound ORE domains. It cannot reach this ORE range, which exists in +-- EQL v4 only, so the same NOT VALID poison CHECK is added here. +DO $do$ +BEGIN + IF EXISTS ( + SELECT 1 + FROM pg_catalog.pg_opclass c + JOIN pg_catalog.pg_am am ON am.oid = c.opcmethod + WHERE am.amname = 'btree' + AND c.opcdefault + AND c.opcintype = '{{prefix}}_internal.ore_block_256'::pg_catalog.regtype + ) THEN + RETURN; + END IF; + + ALTER DOMAIN {{prefix}}.query_numeric_range_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, '{{prefix}}.query_numeric_range_ore', '{{prefix}}.query_numeric_range_ope (range)')) NOT VALID; +END; +$do$; diff --git a/packages/eql/src/v3/scalars/numeric/query_numeric_types.sql b/packages/eql/src/v3/scalars/numeric/query_numeric_types.sql index 96c9aa9b4..b9646bcf8 100644 --- a/packages/eql/src/v3/scalars/numeric/query_numeric_types.sql +++ b/packages/eql/src/v3/scalars/numeric/query_numeric_types.sql @@ -3,41 +3,41 @@ --! @file v3/scalars/numeric/query_numeric_types.sql --! @brief Query-operand domains for numeric (index-terms-only, no ciphertext). ---! @note Query-operand domains live in `eql_v3` (not `public`): they are +--! @note Query-operand domains live in `{{prefix}}` (not `public`): they are --! never valid column types, so they don't belong in the column-type --! namespace, and dropping the EQL-owned schema can never drop an --! application column. --! @note Cast a query operand explicitly to its `query_` domain in a predicate ---! (e.g. `WHERE col = $1::eql_v3.query_numeric_eq`). A bare, +--! (e.g. `WHERE col = $1::{{prefix}}.query_numeric_eq`). A bare, --! uncast literal RHS is ambiguous between the `query_` and `jsonb` --! operator overloads and will not resolve. DO $$ BEGIN - --! @brief Query-operand domain eql_v3.query_numeric_eq (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_numeric_eq (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_numeric_eq' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_numeric_eq' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_numeric_eq AS jsonb + CREATE DOMAIN {{prefix}}.query_numeric_eq AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'hm' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_numeric_eq IS 'EQL numeric query operand (equality)'; + COMMENT ON DOMAIN {{prefix}}.query_numeric_eq IS 'EQL numeric query operand (equality)'; - --! @brief Query-operand domain eql_v3.query_numeric_ord_ore (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_numeric_ord_ore (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_numeric_ord_ore' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_numeric_ord_ore' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_numeric_ord_ore AS jsonb + CREATE DOMAIN {{prefix}}.query_numeric_ord_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -46,46 +46,46 @@ BEGIN AND NOT (VALUE ? 'c') AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_numeric_ord_ore IS 'EQL numeric query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_numeric_ord_ore IS 'EQL numeric query operand (equality, ordering)'; - --! @brief Query-operand domain eql_v3.query_numeric_ord (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_numeric_ord (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_numeric_ord' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_numeric_ord' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_numeric_ord AS jsonb + CREATE DOMAIN {{prefix}}.query_numeric_ord AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'op' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_numeric_ord IS 'EQL numeric query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_numeric_ord IS 'EQL numeric query operand (equality, ordering)'; - --! @brief Query-operand domain eql_v3.query_numeric_ord_ope (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_numeric_ord_ope (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_numeric_ord_ope' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_numeric_ord_ope' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_numeric_ord_ope AS jsonb + CREATE DOMAIN {{prefix}}.query_numeric_ord_ope AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'op' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_numeric_ord_ope IS 'EQL numeric query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_numeric_ord_ope IS 'EQL numeric query operand (equality, ordering)'; END $$; diff --git a/packages/eql/src/v3/scalars/ore_fallback.sql b/packages/eql/src/v3/scalars/ore_fallback.sql index 993af2e32..ce56a258a 100644 --- a/packages/eql/src/v3/scalars/ore_fallback.sql +++ b/packages/eql/src/v3/scalars/ore_fallback.sql @@ -25,14 +25,14 @@ --! --! Runs after the DO block in src/v3/sem/ore_block_256/operator_class.sql, --! which ATTEMPTS to create the default btree operator class for ---! eql_v3_internal.ore_block_256 and skips it on insufficient_privilege +--! {{prefix}}_internal.ore_block_256 and skips it on insufficient_privilege --! (CREATE OPERATOR CLASS requires superuser; managed platforms — cloud --! Supabase and most hosted Postgres — run the installer as a non-superuser --! role). When the class was created, this file is a no-op. --! --! When the class was skipped, the ORE-carrying domains would otherwise --! install half-working: `<`/`>` comparisons still run (as unindexable seq ---! scans), while `CREATE INDEX ... (eql_v3.ord_term(col))` and bare +--! scans), while `CREATE INDEX ... ({{prefix}}.ord_term(col))` and bare --! `ORDER BY` fail with opaque Postgres errors. Instead of that silent --! degradation, this file poisons every ORE-carrying domain (and its --! query-operand twin) with an always-raising CHECK constraint, so the first @@ -62,7 +62,7 @@ BEGIN JOIN pg_catalog.pg_am am ON am.oid = c.opcmethod WHERE am.amname = 'btree' AND c.opcdefault - AND c.opcintype = 'eql_v3_internal.ore_block_256'::pg_catalog.regtype + AND c.opcintype = '{{prefix}}_internal.ore_block_256'::pg_catalog.regtype ) THEN RETURN; END IF; @@ -70,7 +70,7 @@ BEGIN --! @brief Poison CHECK backing for the ORE-carrying domains on platforms --! without the ORE operator class. Always raises; never returns. --! @internal - CREATE FUNCTION eql_v3_internal.ore_domain_unavailable(val jsonb, domain_name text, alternatives text) + CREATE FUNCTION {{prefix}}_internal.ore_domain_unavailable(val jsonb, domain_name text, alternatives text) RETURNS boolean IMMUTABLE PARALLEL SAFE SET search_path = pg_catalog, extensions, public @@ -87,65 +87,65 @@ BEGIN -- must not abort). Domain coercion still enforces the CHECK on every new -- cast/insert regardless of validation status. - ALTER DOMAIN public.eql_v3_integer_ord_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'public.eql_v3_integer_ord_ore', 'public.eql_v3_integer_eq (equality) or public.eql_v3_integer_ord (ordering) or public.eql_v3_integer_ord_ope (ordering)')) NOT VALID; + ALTER DOMAIN public.{{prefix}}_integer_ord_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, 'public.{{prefix}}_integer_ord_ore', 'public.{{prefix}}_integer_eq (equality) or public.{{prefix}}_integer_ord (ordering) or public.{{prefix}}_integer_ord_ope (ordering)')) NOT VALID; - ALTER DOMAIN eql_v3.query_integer_ord_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'eql_v3.query_integer_ord_ore', 'eql_v3.query_integer_eq (equality) or eql_v3.query_integer_ord (ordering) or eql_v3.query_integer_ord_ope (ordering)')) NOT VALID; + ALTER DOMAIN {{prefix}}.query_integer_ord_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, '{{prefix}}.query_integer_ord_ore', '{{prefix}}.query_integer_eq (equality) or {{prefix}}.query_integer_ord (ordering) or {{prefix}}.query_integer_ord_ope (ordering)')) NOT VALID; - ALTER DOMAIN public.eql_v3_smallint_ord_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'public.eql_v3_smallint_ord_ore', 'public.eql_v3_smallint_eq (equality) or public.eql_v3_smallint_ord (ordering) or public.eql_v3_smallint_ord_ope (ordering)')) NOT VALID; + ALTER DOMAIN public.{{prefix}}_smallint_ord_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, 'public.{{prefix}}_smallint_ord_ore', 'public.{{prefix}}_smallint_eq (equality) or public.{{prefix}}_smallint_ord (ordering) or public.{{prefix}}_smallint_ord_ope (ordering)')) NOT VALID; - ALTER DOMAIN eql_v3.query_smallint_ord_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'eql_v3.query_smallint_ord_ore', 'eql_v3.query_smallint_eq (equality) or eql_v3.query_smallint_ord (ordering) or eql_v3.query_smallint_ord_ope (ordering)')) NOT VALID; + ALTER DOMAIN {{prefix}}.query_smallint_ord_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, '{{prefix}}.query_smallint_ord_ore', '{{prefix}}.query_smallint_eq (equality) or {{prefix}}.query_smallint_ord (ordering) or {{prefix}}.query_smallint_ord_ope (ordering)')) NOT VALID; - ALTER DOMAIN public.eql_v3_bigint_ord_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'public.eql_v3_bigint_ord_ore', 'public.eql_v3_bigint_eq (equality) or public.eql_v3_bigint_ord (ordering) or public.eql_v3_bigint_ord_ope (ordering)')) NOT VALID; + ALTER DOMAIN public.{{prefix}}_bigint_ord_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, 'public.{{prefix}}_bigint_ord_ore', 'public.{{prefix}}_bigint_eq (equality) or public.{{prefix}}_bigint_ord (ordering) or public.{{prefix}}_bigint_ord_ope (ordering)')) NOT VALID; - ALTER DOMAIN eql_v3.query_bigint_ord_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'eql_v3.query_bigint_ord_ore', 'eql_v3.query_bigint_eq (equality) or eql_v3.query_bigint_ord (ordering) or eql_v3.query_bigint_ord_ope (ordering)')) NOT VALID; + ALTER DOMAIN {{prefix}}.query_bigint_ord_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, '{{prefix}}.query_bigint_ord_ore', '{{prefix}}.query_bigint_eq (equality) or {{prefix}}.query_bigint_ord (ordering) or {{prefix}}.query_bigint_ord_ope (ordering)')) NOT VALID; - ALTER DOMAIN public.eql_v3_date_ord_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'public.eql_v3_date_ord_ore', 'public.eql_v3_date_eq (equality) or public.eql_v3_date_ord (ordering) or public.eql_v3_date_ord_ope (ordering)')) NOT VALID; + ALTER DOMAIN public.{{prefix}}_date_ord_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, 'public.{{prefix}}_date_ord_ore', 'public.{{prefix}}_date_eq (equality) or public.{{prefix}}_date_ord (ordering) or public.{{prefix}}_date_ord_ope (ordering)')) NOT VALID; - ALTER DOMAIN eql_v3.query_date_ord_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'eql_v3.query_date_ord_ore', 'eql_v3.query_date_eq (equality) or eql_v3.query_date_ord (ordering) or eql_v3.query_date_ord_ope (ordering)')) NOT VALID; + ALTER DOMAIN {{prefix}}.query_date_ord_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, '{{prefix}}.query_date_ord_ore', '{{prefix}}.query_date_eq (equality) or {{prefix}}.query_date_ord (ordering) or {{prefix}}.query_date_ord_ope (ordering)')) NOT VALID; - ALTER DOMAIN public.eql_v3_timestamp_ord_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'public.eql_v3_timestamp_ord_ore', 'public.eql_v3_timestamp_eq (equality) or public.eql_v3_timestamp_ord (ordering) or public.eql_v3_timestamp_ord_ope (ordering)')) NOT VALID; + ALTER DOMAIN public.{{prefix}}_timestamp_ord_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, 'public.{{prefix}}_timestamp_ord_ore', 'public.{{prefix}}_timestamp_eq (equality) or public.{{prefix}}_timestamp_ord (ordering) or public.{{prefix}}_timestamp_ord_ope (ordering)')) NOT VALID; - ALTER DOMAIN eql_v3.query_timestamp_ord_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'eql_v3.query_timestamp_ord_ore', 'eql_v3.query_timestamp_eq (equality) or eql_v3.query_timestamp_ord (ordering) or eql_v3.query_timestamp_ord_ope (ordering)')) NOT VALID; + ALTER DOMAIN {{prefix}}.query_timestamp_ord_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, '{{prefix}}.query_timestamp_ord_ore', '{{prefix}}.query_timestamp_eq (equality) or {{prefix}}.query_timestamp_ord (ordering) or {{prefix}}.query_timestamp_ord_ope (ordering)')) NOT VALID; - ALTER DOMAIN public.eql_v3_numeric_ord_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'public.eql_v3_numeric_ord_ore', 'public.eql_v3_numeric_eq (equality) or public.eql_v3_numeric_ord (ordering) or public.eql_v3_numeric_ord_ope (ordering)')) NOT VALID; + ALTER DOMAIN public.{{prefix}}_numeric_ord_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, 'public.{{prefix}}_numeric_ord_ore', 'public.{{prefix}}_numeric_eq (equality) or public.{{prefix}}_numeric_ord (ordering) or public.{{prefix}}_numeric_ord_ope (ordering)')) NOT VALID; - ALTER DOMAIN eql_v3.query_numeric_ord_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'eql_v3.query_numeric_ord_ore', 'eql_v3.query_numeric_eq (equality) or eql_v3.query_numeric_ord (ordering) or eql_v3.query_numeric_ord_ope (ordering)')) NOT VALID; + ALTER DOMAIN {{prefix}}.query_numeric_ord_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, '{{prefix}}.query_numeric_ord_ore', '{{prefix}}.query_numeric_eq (equality) or {{prefix}}.query_numeric_ord (ordering) or {{prefix}}.query_numeric_ord_ope (ordering)')) NOT VALID; - ALTER DOMAIN public.eql_v3_text_ord_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'public.eql_v3_text_ord_ore', 'public.eql_v3_text_eq (equality) or public.eql_v3_text_match (match) or public.eql_v3_text_ord (ordering) or public.eql_v3_text_ord_ope (ordering) or public.eql_v3_text_search (ordering)')) NOT VALID; + ALTER DOMAIN public.{{prefix}}_text_ord_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, 'public.{{prefix}}_text_ord_ore', 'public.{{prefix}}_text_eq (equality) or public.{{prefix}}_text_match (match) or public.{{prefix}}_text_ord (ordering) or public.{{prefix}}_text_ord_ope (ordering) or public.{{prefix}}_text_search (ordering)')) NOT VALID; - ALTER DOMAIN eql_v3.query_text_ord_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'eql_v3.query_text_ord_ore', 'eql_v3.query_text_eq (equality) or eql_v3.query_text_match (match) or eql_v3.query_text_ord (ordering) or eql_v3.query_text_ord_ope (ordering) or eql_v3.query_text_search (ordering)')) NOT VALID; + ALTER DOMAIN {{prefix}}.query_text_ord_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, '{{prefix}}.query_text_ord_ore', '{{prefix}}.query_text_eq (equality) or {{prefix}}.query_text_match (match) or {{prefix}}.query_text_ord (ordering) or {{prefix}}.query_text_ord_ope (ordering) or {{prefix}}.query_text_search (ordering)')) NOT VALID; - ALTER DOMAIN public.eql_v3_text_search_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'public.eql_v3_text_search_ore', 'public.eql_v3_text_eq (equality) or public.eql_v3_text_match (match) or public.eql_v3_text_ord (ordering) or public.eql_v3_text_ord_ope (ordering) or public.eql_v3_text_search (ordering)')) NOT VALID; + ALTER DOMAIN public.{{prefix}}_text_search_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, 'public.{{prefix}}_text_search_ore', 'public.{{prefix}}_text_eq (equality) or public.{{prefix}}_text_match (match) or public.{{prefix}}_text_ord (ordering) or public.{{prefix}}_text_ord_ope (ordering) or public.{{prefix}}_text_search (ordering)')) NOT VALID; - ALTER DOMAIN eql_v3.query_text_search_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'eql_v3.query_text_search_ore', 'eql_v3.query_text_eq (equality) or eql_v3.query_text_match (match) or eql_v3.query_text_ord (ordering) or eql_v3.query_text_ord_ope (ordering) or eql_v3.query_text_search (ordering)')) NOT VALID; + ALTER DOMAIN {{prefix}}.query_text_search_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, '{{prefix}}.query_text_search_ore', '{{prefix}}.query_text_eq (equality) or {{prefix}}.query_text_match (match) or {{prefix}}.query_text_ord (ordering) or {{prefix}}.query_text_ord_ope (ordering) or {{prefix}}.query_text_search (ordering)')) NOT VALID; - ALTER DOMAIN public.eql_v3_real_ord_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'public.eql_v3_real_ord_ore', 'public.eql_v3_real_eq (equality) or public.eql_v3_real_ord (ordering) or public.eql_v3_real_ord_ope (ordering)')) NOT VALID; + ALTER DOMAIN public.{{prefix}}_real_ord_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, 'public.{{prefix}}_real_ord_ore', 'public.{{prefix}}_real_eq (equality) or public.{{prefix}}_real_ord (ordering) or public.{{prefix}}_real_ord_ope (ordering)')) NOT VALID; - ALTER DOMAIN eql_v3.query_real_ord_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'eql_v3.query_real_ord_ore', 'eql_v3.query_real_eq (equality) or eql_v3.query_real_ord (ordering) or eql_v3.query_real_ord_ope (ordering)')) NOT VALID; + ALTER DOMAIN {{prefix}}.query_real_ord_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, '{{prefix}}.query_real_ord_ore', '{{prefix}}.query_real_eq (equality) or {{prefix}}.query_real_ord (ordering) or {{prefix}}.query_real_ord_ope (ordering)')) NOT VALID; - ALTER DOMAIN public.eql_v3_double_ord_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'public.eql_v3_double_ord_ore', 'public.eql_v3_double_eq (equality) or public.eql_v3_double_ord (ordering) or public.eql_v3_double_ord_ope (ordering)')) NOT VALID; + ALTER DOMAIN public.{{prefix}}_double_ord_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, 'public.{{prefix}}_double_ord_ore', 'public.{{prefix}}_double_eq (equality) or public.{{prefix}}_double_ord (ordering) or public.{{prefix}}_double_ord_ope (ordering)')) NOT VALID; - ALTER DOMAIN eql_v3.query_double_ord_ore ADD CONSTRAINT eql_ore_unavailable - CHECK (eql_v3_internal.ore_domain_unavailable(VALUE, 'eql_v3.query_double_ord_ore', 'eql_v3.query_double_eq (equality) or eql_v3.query_double_ord (ordering) or eql_v3.query_double_ord_ope (ordering)')) NOT VALID; + ALTER DOMAIN {{prefix}}.query_double_ord_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, '{{prefix}}.query_double_ord_ore', '{{prefix}}.query_double_eq (equality) or {{prefix}}.query_double_ord (ordering) or {{prefix}}.query_double_ord_ope (ordering)')) NOT VALID; RAISE NOTICE 'EQL: ORE operator class absent (creation requires superuser) — 20 ORE-backed domains disabled and will raise on use; use the _ord_ope (ordering) and _eq (equality) domains — and text_match for text pattern match — instead'; END; diff --git a/packages/eql/src/v3/scalars/real/json_entry_real_functions.sql b/packages/eql/src/v3/scalars/real/json_entry_real_functions.sql index 2493cab90..6cab30901 100644 --- a/packages/eql/src/v3/scalars/real/json_entry_real_functions.sql +++ b/packages/eql/src/v3/scalars/real/json_entry_real_functions.sql @@ -7,244 +7,244 @@ -- REQUIRE: src/v3/scalars/real/query_real_ord_ope_functions.sql --! @file encrypted_domain/real/json_entry_real_functions.sql ---! @brief Functions for public.eql_v3_json_entry. +--! @brief Functions for public.{{prefix}}_json_entry. ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_real_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_real_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json_entry, b eql_v3.query_real_ord) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json_entry, b {{prefix}}.query_real_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_real_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_real_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a eql_v3.query_real_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_real_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_real_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_real_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json_entry, b eql_v3.query_real_ord) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json_entry, b {{prefix}}.query_real_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_real_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_real_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a eql_v3.query_real_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_real_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_real_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_real_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_json_entry, b eql_v3.query_real_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_real_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_real_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_real_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_real_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_real_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_real_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_json_entry, b eql_v3.query_real_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_real_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_real_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_real_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_real_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_real_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_real_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_json_entry, b eql_v3.query_real_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_real_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_real_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_real_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_real_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_real_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_real_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_json_entry, b eql_v3.query_real_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_real_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_real_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_real_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_real_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_real_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_real_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json_entry, b eql_v3.query_real_ord_ope) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json_entry, b {{prefix}}.query_real_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_real_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_real_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a eql_v3.query_real_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_real_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_real_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json_entry, b eql_v3.query_real_ord_ope) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json_entry, b {{prefix}}.query_real_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_real_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_real_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a eql_v3.query_real_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_real_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_json_entry, b eql_v3.query_real_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_real_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_real_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_real_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_real_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_json_entry, b eql_v3.query_real_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_real_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_real_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_real_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_real_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_json_entry, b eql_v3.query_real_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_real_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_real_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_real_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_real_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_json_entry, b eql_v3.query_real_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_real_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_real_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_real_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/real/json_entry_real_operators.sql b/packages/eql/src/v3/scalars/real/json_entry_real_operators.sql index 2fcdc8691..4ddcc8522 100644 --- a/packages/eql/src/v3/scalars/real/json_entry_real_operators.sql +++ b/packages/eql/src/v3/scalars/real/json_entry_real_operators.sql @@ -5,140 +5,140 @@ -- REQUIRE: src/v3/scalars/real/json_entry_real_functions.sql --! @file encrypted_domain/real/json_entry_real_operators.sql ---! @brief Operators for public.eql_v3_json_entry. +--! @brief Operators for public.{{prefix}}_json_entry. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_real_ord + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_real_ord ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = eql_v3.query_real_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_real_ord + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_real_ord ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = eql_v3.query_real_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_real_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_real_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_real_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_real_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_real_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_real_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_real_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_real_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_real_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_real_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_real_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_real_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_real_ord_ope + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_real_ord_ope ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = eql_v3.query_real_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_real_ord_ope + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_real_ord_ope ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = eql_v3.query_real_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_real_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_real_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_real_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_real_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_real_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_real_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_real_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_real_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_real_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_real_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_real_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_real_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/real/query_real_eq_functions.sql b/packages/eql/src/v3/scalars/real/query_real_eq_functions.sql index cacb702cc..637bd5045 100644 --- a/packages/eql/src/v3/scalars/real/query_real_eq_functions.sql +++ b/packages/eql/src/v3/scalars/real/query_real_eq_functions.sql @@ -4,44 +4,44 @@ -- REQUIRE: src/v3/scalars/real/real_eq_functions.sql --! @file encrypted_domain/real/query_real_eq_functions.sql ---! @brief Functions for eql_v3.query_real_eq. +--! @brief Functions for {{prefix}}.query_real_eq. ---! @brief Index extractor for eql_v3.query_real_eq. ---! @param a eql_v3.query_real_eq ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a eql_v3.query_real_eq) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for {{prefix}}.query_real_eq. +--! @param a {{prefix}}.query_real_eq +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a {{prefix}}.query_real_eq) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_real_eq. ---! @param a public.eql_v3_real_eq ---! @param b eql_v3.query_real_eq +--! @brief Operator wrapper for {{prefix}}.query_real_eq. +--! @param a public.{{prefix}}_real_eq +--! @param b {{prefix}}.query_real_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_real_eq, b eql_v3.query_real_eq) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_eq, b {{prefix}}.query_real_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_eq. ---! @param a eql_v3.query_real_eq ---! @param b public.eql_v3_real_eq +--! @brief Operator wrapper for {{prefix}}.query_real_eq. +--! @param a {{prefix}}.query_real_eq +--! @param b public.{{prefix}}_real_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_real_eq, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_real_eq, b public.{{prefix}}_real_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_eq. ---! @param a public.eql_v3_real_eq ---! @param b eql_v3.query_real_eq +--! @brief Operator wrapper for {{prefix}}.query_real_eq. +--! @param a public.{{prefix}}_real_eq +--! @param b {{prefix}}.query_real_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_real_eq, b eql_v3.query_real_eq) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_eq, b {{prefix}}.query_real_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_eq. ---! @param a eql_v3.query_real_eq ---! @param b public.eql_v3_real_eq +--! @brief Operator wrapper for {{prefix}}.query_real_eq. +--! @param a {{prefix}}.query_real_eq +--! @param b public.{{prefix}}_real_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_real_eq, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_real_eq, b public.{{prefix}}_real_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; diff --git a/packages/eql/src/v3/scalars/real/query_real_eq_operators.sql b/packages/eql/src/v3/scalars/real/query_real_eq_operators.sql index 00ba0dfe6..340424f44 100644 --- a/packages/eql/src/v3/scalars/real/query_real_eq_operators.sql +++ b/packages/eql/src/v3/scalars/real/query_real_eq_operators.sql @@ -4,28 +4,28 @@ -- REQUIRE: src/v3/scalars/real/query_real_eq_functions.sql --! @file encrypted_domain/real/query_real_eq_operators.sql ---! @brief Operators for eql_v3.query_real_eq. +--! @brief Operators for {{prefix}}.query_real_eq. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_real_eq, RIGHTARG = eql_v3.query_real_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = {{prefix}}.query_real_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_real_eq, RIGHTARG = public.eql_v3_real_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_real_eq, RIGHTARG = public.{{prefix}}_real_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_real_eq, RIGHTARG = eql_v3.query_real_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = {{prefix}}.query_real_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_real_eq, RIGHTARG = public.eql_v3_real_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_real_eq, RIGHTARG = public.{{prefix}}_real_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); diff --git a/packages/eql/src/v3/scalars/real/query_real_ord_functions.sql b/packages/eql/src/v3/scalars/real/query_real_ord_functions.sql index 8ca85ec93..b1292e6e4 100644 --- a/packages/eql/src/v3/scalars/real/query_real_ord_functions.sql +++ b/packages/eql/src/v3/scalars/real/query_real_ord_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/real/real_ord_functions.sql --! @file encrypted_domain/real/query_real_ord_functions.sql ---! @brief Functions for eql_v3.query_real_ord. +--! @brief Functions for {{prefix}}.query_real_ord. ---! @brief Index extractor for eql_v3.query_real_ord. ---! @param a eql_v3.query_real_ord ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a eql_v3.query_real_ord) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for {{prefix}}.query_real_ord. +--! @param a {{prefix}}.query_real_ord +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a {{prefix}}.query_real_ord) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord. ---! @param a public.eql_v3_real_ord ---! @param b eql_v3.query_real_ord +--! @brief Operator wrapper for {{prefix}}.query_real_ord. +--! @param a public.{{prefix}}_real_ord +--! @param b {{prefix}}.query_real_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_real_ord, b eql_v3.query_real_ord) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord. ---! @param a eql_v3.query_real_ord ---! @param b public.eql_v3_real_ord +--! @brief Operator wrapper for {{prefix}}.query_real_ord. +--! @param a {{prefix}}.query_real_ord +--! @param b public.{{prefix}}_real_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_real_ord, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord. ---! @param a public.eql_v3_real_ord ---! @param b eql_v3.query_real_ord +--! @brief Operator wrapper for {{prefix}}.query_real_ord. +--! @param a public.{{prefix}}_real_ord +--! @param b {{prefix}}.query_real_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_real_ord, b eql_v3.query_real_ord) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord. ---! @param a eql_v3.query_real_ord ---! @param b public.eql_v3_real_ord +--! @brief Operator wrapper for {{prefix}}.query_real_ord. +--! @param a {{prefix}}.query_real_ord +--! @param b public.{{prefix}}_real_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_real_ord, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord. ---! @param a public.eql_v3_real_ord ---! @param b eql_v3.query_real_ord +--! @brief Operator wrapper for {{prefix}}.query_real_ord. +--! @param a public.{{prefix}}_real_ord +--! @param b {{prefix}}.query_real_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_real_ord, b eql_v3.query_real_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord. ---! @param a eql_v3.query_real_ord ---! @param b public.eql_v3_real_ord +--! @brief Operator wrapper for {{prefix}}.query_real_ord. +--! @param a {{prefix}}.query_real_ord +--! @param b public.{{prefix}}_real_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_real_ord, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord. ---! @param a public.eql_v3_real_ord ---! @param b eql_v3.query_real_ord +--! @brief Operator wrapper for {{prefix}}.query_real_ord. +--! @param a public.{{prefix}}_real_ord +--! @param b {{prefix}}.query_real_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_real_ord, b eql_v3.query_real_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord. ---! @param a eql_v3.query_real_ord ---! @param b public.eql_v3_real_ord +--! @brief Operator wrapper for {{prefix}}.query_real_ord. +--! @param a {{prefix}}.query_real_ord +--! @param b public.{{prefix}}_real_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_real_ord, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord. ---! @param a public.eql_v3_real_ord ---! @param b eql_v3.query_real_ord +--! @brief Operator wrapper for {{prefix}}.query_real_ord. +--! @param a public.{{prefix}}_real_ord +--! @param b {{prefix}}.query_real_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_real_ord, b eql_v3.query_real_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord. ---! @param a eql_v3.query_real_ord ---! @param b public.eql_v3_real_ord +--! @brief Operator wrapper for {{prefix}}.query_real_ord. +--! @param a {{prefix}}.query_real_ord +--! @param b public.{{prefix}}_real_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_real_ord, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord. ---! @param a public.eql_v3_real_ord ---! @param b eql_v3.query_real_ord +--! @brief Operator wrapper for {{prefix}}.query_real_ord. +--! @param a public.{{prefix}}_real_ord +--! @param b {{prefix}}.query_real_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_real_ord, b eql_v3.query_real_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord. ---! @param a eql_v3.query_real_ord ---! @param b public.eql_v3_real_ord +--! @brief Operator wrapper for {{prefix}}.query_real_ord. +--! @param a {{prefix}}.query_real_ord +--! @param b public.{{prefix}}_real_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_real_ord, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/real/query_real_ord_ope_functions.sql b/packages/eql/src/v3/scalars/real/query_real_ord_ope_functions.sql index 4bc7d3b16..6e71401ea 100644 --- a/packages/eql/src/v3/scalars/real/query_real_ord_ope_functions.sql +++ b/packages/eql/src/v3/scalars/real/query_real_ord_ope_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/real/real_ord_ope_functions.sql --! @file encrypted_domain/real/query_real_ord_ope_functions.sql ---! @brief Functions for eql_v3.query_real_ord_ope. +--! @brief Functions for {{prefix}}.query_real_ord_ope. ---! @brief Index extractor for eql_v3.query_real_ord_ope. ---! @param a eql_v3.query_real_ord_ope ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a eql_v3.query_real_ord_ope) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for {{prefix}}.query_real_ord_ope. +--! @param a {{prefix}}.query_real_ord_ope +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a {{prefix}}.query_real_ord_ope) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ope. ---! @param a public.eql_v3_real_ord_ope ---! @param b eql_v3.query_real_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. +--! @param a public.{{prefix}}_real_ord_ope +--! @param b {{prefix}}.query_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_real_ord_ope, b eql_v3.query_real_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ope. ---! @param a eql_v3.query_real_ord_ope ---! @param b public.eql_v3_real_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. +--! @param a {{prefix}}.query_real_ord_ope +--! @param b public.{{prefix}}_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_real_ord_ope, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ope. ---! @param a public.eql_v3_real_ord_ope ---! @param b eql_v3.query_real_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. +--! @param a public.{{prefix}}_real_ord_ope +--! @param b {{prefix}}.query_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_real_ord_ope, b eql_v3.query_real_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ope. ---! @param a eql_v3.query_real_ord_ope ---! @param b public.eql_v3_real_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. +--! @param a {{prefix}}.query_real_ord_ope +--! @param b public.{{prefix}}_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_real_ord_ope, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ope. ---! @param a public.eql_v3_real_ord_ope ---! @param b eql_v3.query_real_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. +--! @param a public.{{prefix}}_real_ord_ope +--! @param b {{prefix}}.query_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_real_ord_ope, b eql_v3.query_real_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ope. ---! @param a eql_v3.query_real_ord_ope ---! @param b public.eql_v3_real_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. +--! @param a {{prefix}}.query_real_ord_ope +--! @param b public.{{prefix}}_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_real_ord_ope, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ope. ---! @param a public.eql_v3_real_ord_ope ---! @param b eql_v3.query_real_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. +--! @param a public.{{prefix}}_real_ord_ope +--! @param b {{prefix}}.query_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_real_ord_ope, b eql_v3.query_real_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ope. ---! @param a eql_v3.query_real_ord_ope ---! @param b public.eql_v3_real_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. +--! @param a {{prefix}}.query_real_ord_ope +--! @param b public.{{prefix}}_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_real_ord_ope, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ope. ---! @param a public.eql_v3_real_ord_ope ---! @param b eql_v3.query_real_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. +--! @param a public.{{prefix}}_real_ord_ope +--! @param b {{prefix}}.query_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_real_ord_ope, b eql_v3.query_real_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ope. ---! @param a eql_v3.query_real_ord_ope ---! @param b public.eql_v3_real_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. +--! @param a {{prefix}}.query_real_ord_ope +--! @param b public.{{prefix}}_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_real_ord_ope, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ope. ---! @param a public.eql_v3_real_ord_ope ---! @param b eql_v3.query_real_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. +--! @param a public.{{prefix}}_real_ord_ope +--! @param b {{prefix}}.query_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_real_ord_ope, b eql_v3.query_real_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ope. ---! @param a eql_v3.query_real_ord_ope ---! @param b public.eql_v3_real_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. +--! @param a {{prefix}}.query_real_ord_ope +--! @param b public.{{prefix}}_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_real_ord_ope, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/real/query_real_ord_ope_operators.sql b/packages/eql/src/v3/scalars/real/query_real_ord_ope_operators.sql index de0c9606d..b8b13b85e 100644 --- a/packages/eql/src/v3/scalars/real/query_real_ord_ope_operators.sql +++ b/packages/eql/src/v3/scalars/real/query_real_ord_ope_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/real/query_real_ord_ope_functions.sql --! @file encrypted_domain/real/query_real_ord_ope_operators.sql ---! @brief Operators for eql_v3.query_real_ord_ope. +--! @brief Operators for {{prefix}}.query_real_ord_ope. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = eql_v3.query_real_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_real_ord_ope, RIGHTARG = public.eql_v3_real_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = eql_v3.query_real_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_real_ord_ope, RIGHTARG = public.eql_v3_real_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = eql_v3.query_real_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_real_ord_ope, RIGHTARG = public.eql_v3_real_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = eql_v3.query_real_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_real_ord_ope, RIGHTARG = public.eql_v3_real_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = eql_v3.query_real_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_real_ord_ope, RIGHTARG = public.eql_v3_real_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = eql_v3.query_real_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_real_ord_ope, RIGHTARG = public.eql_v3_real_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/real/query_real_ord_operators.sql b/packages/eql/src/v3/scalars/real/query_real_ord_operators.sql index 2859bc840..6ae884957 100644 --- a/packages/eql/src/v3/scalars/real/query_real_ord_operators.sql +++ b/packages/eql/src/v3/scalars/real/query_real_ord_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/real/query_real_ord_functions.sql --! @file encrypted_domain/real/query_real_ord_operators.sql ---! @brief Operators for eql_v3.query_real_ord. +--! @brief Operators for {{prefix}}.query_real_ord. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = eql_v3.query_real_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_real_ord, RIGHTARG = public.eql_v3_real_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = eql_v3.query_real_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_real_ord, RIGHTARG = public.eql_v3_real_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = eql_v3.query_real_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_real_ord, RIGHTARG = public.eql_v3_real_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = eql_v3.query_real_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_real_ord, RIGHTARG = public.eql_v3_real_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = eql_v3.query_real_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_real_ord, RIGHTARG = public.eql_v3_real_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = eql_v3.query_real_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_real_ord, RIGHTARG = public.eql_v3_real_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/real/query_real_ord_ore_functions.sql b/packages/eql/src/v3/scalars/real/query_real_ord_ore_functions.sql index 82aedde96..db512dd9a 100644 --- a/packages/eql/src/v3/scalars/real/query_real_ord_ore_functions.sql +++ b/packages/eql/src/v3/scalars/real/query_real_ord_ore_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/real/real_ord_ore_functions.sql --! @file encrypted_domain/real/query_real_ord_ore_functions.sql ---! @brief Functions for eql_v3.query_real_ord_ore. +--! @brief Functions for {{prefix}}.query_real_ord_ore. ---! @brief Index extractor for eql_v3.query_real_ord_ore. ---! @param a eql_v3.query_real_ord_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a eql_v3.query_real_ord_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for {{prefix}}.query_real_ord_ore. +--! @param a {{prefix}}.query_real_ord_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a {{prefix}}.query_real_ord_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ore. ---! @param a public.eql_v3_real_ord_ore ---! @param b eql_v3.query_real_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. +--! @param a public.{{prefix}}_real_ord_ore +--! @param b {{prefix}}.query_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_real_ord_ore, b eql_v3.query_real_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ore. ---! @param a eql_v3.query_real_ord_ore ---! @param b public.eql_v3_real_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. +--! @param a {{prefix}}.query_real_ord_ore +--! @param b public.{{prefix}}_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_real_ord_ore, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ore. ---! @param a public.eql_v3_real_ord_ore ---! @param b eql_v3.query_real_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. +--! @param a public.{{prefix}}_real_ord_ore +--! @param b {{prefix}}.query_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_real_ord_ore, b eql_v3.query_real_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ore. ---! @param a eql_v3.query_real_ord_ore ---! @param b public.eql_v3_real_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. +--! @param a {{prefix}}.query_real_ord_ore +--! @param b public.{{prefix}}_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_real_ord_ore, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ore. ---! @param a public.eql_v3_real_ord_ore ---! @param b eql_v3.query_real_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. +--! @param a public.{{prefix}}_real_ord_ore +--! @param b {{prefix}}.query_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_real_ord_ore, b eql_v3.query_real_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ore. ---! @param a eql_v3.query_real_ord_ore ---! @param b public.eql_v3_real_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. +--! @param a {{prefix}}.query_real_ord_ore +--! @param b public.{{prefix}}_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_real_ord_ore, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ore. ---! @param a public.eql_v3_real_ord_ore ---! @param b eql_v3.query_real_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. +--! @param a public.{{prefix}}_real_ord_ore +--! @param b {{prefix}}.query_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_real_ord_ore, b eql_v3.query_real_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ore. ---! @param a eql_v3.query_real_ord_ore ---! @param b public.eql_v3_real_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. +--! @param a {{prefix}}.query_real_ord_ore +--! @param b public.{{prefix}}_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_real_ord_ore, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ore. ---! @param a public.eql_v3_real_ord_ore ---! @param b eql_v3.query_real_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. +--! @param a public.{{prefix}}_real_ord_ore +--! @param b {{prefix}}.query_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_real_ord_ore, b eql_v3.query_real_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ore. ---! @param a eql_v3.query_real_ord_ore ---! @param b public.eql_v3_real_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. +--! @param a {{prefix}}.query_real_ord_ore +--! @param b public.{{prefix}}_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_real_ord_ore, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ore. ---! @param a public.eql_v3_real_ord_ore ---! @param b eql_v3.query_real_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. +--! @param a public.{{prefix}}_real_ord_ore +--! @param b {{prefix}}.query_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_real_ord_ore, b eql_v3.query_real_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_real_ord_ore. ---! @param a eql_v3.query_real_ord_ore ---! @param b public.eql_v3_real_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. +--! @param a {{prefix}}.query_real_ord_ore +--! @param b public.{{prefix}}_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_real_ord_ore, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; diff --git a/packages/eql/src/v3/scalars/real/query_real_ord_ore_operators.sql b/packages/eql/src/v3/scalars/real/query_real_ord_ore_operators.sql index c7d56e1dc..8e8d624d8 100644 --- a/packages/eql/src/v3/scalars/real/query_real_ord_ore_operators.sql +++ b/packages/eql/src/v3/scalars/real/query_real_ord_ore_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/real/query_real_ord_ore_functions.sql --! @file encrypted_domain/real/query_real_ord_ore_operators.sql ---! @brief Operators for eql_v3.query_real_ord_ore. +--! @brief Operators for {{prefix}}.query_real_ord_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = eql_v3.query_real_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_real_ord_ore, RIGHTARG = public.eql_v3_real_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = eql_v3.query_real_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_real_ord_ore, RIGHTARG = public.eql_v3_real_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = eql_v3.query_real_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_real_ord_ore, RIGHTARG = public.eql_v3_real_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = eql_v3.query_real_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_real_ord_ore, RIGHTARG = public.eql_v3_real_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = eql_v3.query_real_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_real_ord_ore, RIGHTARG = public.eql_v3_real_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = eql_v3.query_real_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_real_ord_ore, RIGHTARG = public.eql_v3_real_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/real/query_real_range_functions.sql b/packages/eql/src/v3/scalars/real/query_real_range_functions.sql new file mode 100644 index 000000000..875251fd6 --- /dev/null +++ b/packages/eql/src/v3/scalars/real/query_real_range_functions.sql @@ -0,0 +1,177 @@ +-- AUTOMATICALLY GENERATED FILE. +-- ONLY EQL VERSION: 4 +-- REQUIRE: src/v3/schema.sql +-- REQUIRE: src/v3/scalars/real/query_real_range_types.sql +-- REQUIRE: src/v3/scalars/real/real_ord_ore_functions.sql +-- REQUIRE: src/v3/scalars/real/real_ord_functions.sql +-- REQUIRE: src/v3/scalars/real/real_ord_ope_functions.sql +-- REQUIRE: src/v3/sem/ore_block_256/functions.sql +-- REQUIRE: src/v3/sem/ore_block_256/operators.sql +-- REQUIRE: src/v3/sem/ope_cllw/functions.sql + +--! @file v3/scalars/real/query_real_range_functions.sql +--! @brief The bound accessors and `{{prefix}}.between` for real's range query domains. +--! @note EQL version {{eql_version}} only, like the range domains themselves. + +--! @brief The low bound of a {{prefix}}.query_real_range_ore, as a block ORE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_real_range_ore Range query operand +--! @return {{prefix}}_internal.ore_block_256 The low bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.lo(r {{prefix}}.query_real_range_ore) +RETURNS {{prefix}}_internal.ore_block_256 +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ore_block_256(jsonb_build_object('ob', r::jsonb -> 'lo')) $$; + +--! @brief The high bound of a {{prefix}}.query_real_range_ore, as a block ORE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_real_range_ore Range query operand +--! @return {{prefix}}_internal.ore_block_256 The high bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.hi(r {{prefix}}.query_real_range_ore) +RETURNS {{prefix}}_internal.ore_block_256 +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ore_block_256(jsonb_build_object('ob', r::jsonb -> 'hi')) $$; + +--! @brief The low bound of a {{prefix}}.query_real_range_ope, as a CLLW OPE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_real_range_ope Range query operand +--! @return {{prefix}}_internal.ope_cllw The low bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.lo(r {{prefix}}.query_real_range_ope) +RETURNS {{prefix}}_internal.ope_cllw +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> 'lo')) $$; + +--! @brief The high bound of a {{prefix}}.query_real_range_ope, as a CLLW OPE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_real_range_ope Range query operand +--! @return {{prefix}}_internal.ope_cllw The high bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.hi(r {{prefix}}.query_real_range_ope) +RETURNS {{prefix}}_internal.ope_cllw +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> 'hi')) $$; + +--! @brief Whether a public.{{prefix}}_real_ord_ore value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_real_range_ore)`. +--! +--! @param a public.{{prefix}}_real_ord_ore Encrypted column value +--! @param r {{prefix}}.query_real_range_ore Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term_ore(a)`, which a btree index on that expression +--! serves as one range scan. For this ORE range that index needs the +--! default btree operator class on {{prefix}}_internal.ore_block_256, which the +--! installer creates only with superuser privileges. Without it (on Supabase, +--! for instance) the installer disables the ORE column domains and this ORE range, +--! so use an OPE column (`public.{{prefix}}_real_ord`, `public.{{prefix}}_real_ord_ope`) +--! and `{{prefix}}.query_real_range_ope`, which index everywhere. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_real_range_ore`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_real_ord_ore, r {{prefix}}.query_real_range_ore) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_real_ord value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_real_range_ope)`. +--! +--! @param a public.{{prefix}}_real_ord Encrypted column value +--! @param r {{prefix}}.query_real_range_ope Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term(a)`, which a btree index on that expression +--! serves as one range scan. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_real_range_ope`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_real_ord, r {{prefix}}.query_real_range_ope) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_real_ord_ope value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_real_range_ope)`. +--! +--! @param a public.{{prefix}}_real_ord_ope Encrypted column value +--! @param r {{prefix}}.query_real_range_ope Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term(a)`, which a btree index on that expression +--! serves as one range scan. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_real_range_ope`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_real_ord_ope, r {{prefix}}.query_real_range_ope) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r) $$; diff --git a/packages/eql/src/v3/scalars/real/query_real_range_types.sql b/packages/eql/src/v3/scalars/real/query_real_range_types.sql new file mode 100644 index 000000000..b9508d140 --- /dev/null +++ b/packages/eql/src/v3/scalars/real/query_real_range_types.sql @@ -0,0 +1,107 @@ +-- AUTOMATICALLY GENERATED FILE. +-- ONLY EQL VERSION: 4 +-- REQUIRE: src/v3/schema.sql +-- REQUIRE: src/v3/scalars/ore_fallback.sql + +--! @file v3/scalars/real/query_real_range_types.sql +--! @brief Range query-operand domains for real: the operand of `{{prefix}}.between`. +--! @note A range holds both bounds of one `BETWEEN` as one value: +--! `{"v": {{eql_version}}, "i": {...}, "lo": , "hi": }`. Each bound is the +--! single-bound query domain's `ob` (ORE) or `op` (OPE) value, in a +--! `{v, i, lo, hi}` envelope. Both bounds are included. There is one +--! range domain per ordering term the family stores (ADR-0009, +--! decisions 7 and 8). +--! @note Cast the range parameter to its exact range domain +--! (`$1::{{prefix}}.query_real_range_ore`). An uncast `$1`, a `jsonb` +--! parameter, or a range of another term or family fails with 42725 +--! ("function ... is not unique"); see `{{prefix}}.between`. +--! @note EQL version {{eql_version}} only: the `-- ONLY EQL VERSION:` line above keeps this +--! file out of every other version's installer. +--! @note Like every query operand, a range lives in `{{prefix}}`, not `public`, +--! and holds no ciphertext `c`. A range whose low bound is above its +--! high bound matches no row, as with SQL `BETWEEN`; the SQL does not +--! reorder the bounds. +--! @note On an install without the ORE operator class (a non-superuser +--! install, on Supabase for instance), the ORE range domain is disabled +--! as the single-bound ORE domains are: a value cast to it raises +--! `feature_not_supported`, naming the OPE range. See +--! `v3/scalars/ore_fallback.sql`. + +DO $$ +BEGIN + --! @brief Range query-operand domain {{prefix}}.query_real_range_ore (two block ORE bounds; no `c`). + IF NOT EXISTS ( + SELECT 1 FROM pg_type + WHERE typname = 'query_real_range_ore' AND typnamespace = '{{prefix}}'::regnamespace + ) THEN + CREATE DOMAIN {{prefix}}.query_real_range_ore AS jsonb + CHECK ( + jsonb_typeof(VALUE) = 'object' + AND VALUE ? 'v' + AND VALUE ? 'i' + AND VALUE ? 'lo' + AND VALUE ? 'hi' + AND NOT (VALUE ? 'c') + AND jsonb_typeof(VALUE -> 'lo') = 'array' + AND jsonb_array_length(VALUE -> 'lo') > 0 + AND jsonb_typeof(VALUE -> 'hi') = 'array' + AND jsonb_array_length(VALUE -> 'hi') > 0 + -- `"v": null` makes the comparison NULL, and a CHECK that is NULL + -- passes, so COALESCE refuses it. A NULL range still passes (no row + -- matches it). The comparison keeps the one form the v4 isolation + -- gate accepts. + AND COALESCE(VALUE->>'v' = '{{eql_version}}', VALUE IS NULL) + ); + END IF; + + COMMENT ON DOMAIN {{prefix}}.query_real_range_ore IS 'EQL real range query operand (block ORE)'; + + --! @brief Range query-operand domain {{prefix}}.query_real_range_ope (two CLLW OPE bounds; no `c`). + IF NOT EXISTS ( + SELECT 1 FROM pg_type + WHERE typname = 'query_real_range_ope' AND typnamespace = '{{prefix}}'::regnamespace + ) THEN + CREATE DOMAIN {{prefix}}.query_real_range_ope AS jsonb + CHECK ( + jsonb_typeof(VALUE) = 'object' + AND VALUE ? 'v' + AND VALUE ? 'i' + AND VALUE ? 'lo' + AND VALUE ? 'hi' + AND NOT (VALUE ? 'c') + AND jsonb_typeof(VALUE -> 'lo') = 'string' + AND jsonb_typeof(VALUE -> 'hi') = 'string' + -- `"v": null` makes the comparison NULL, and a CHECK that is NULL + -- passes, so COALESCE refuses it. A NULL range still passes (no row + -- matches it). The comparison keeps the one form the v4 isolation + -- gate accepts. + AND COALESCE(VALUE->>'v' = '{{eql_version}}', VALUE IS NULL) + ); + END IF; + + COMMENT ON DOMAIN {{prefix}}.query_real_range_ope IS 'EQL real range query operand (CLLW OPE)'; +END +$$; + +-- Without the default btree operator class on {{prefix}}_internal.ore_block_256 +-- (the installer skips it on insufficient_privilege), ore_fallback.sql has +-- created {{prefix}}_internal.ore_domain_unavailable and poisoned the +-- single-bound ORE domains. It cannot reach this ORE range, which exists in +-- EQL v4 only, so the same NOT VALID poison CHECK is added here. +DO $do$ +BEGIN + IF EXISTS ( + SELECT 1 + FROM pg_catalog.pg_opclass c + JOIN pg_catalog.pg_am am ON am.oid = c.opcmethod + WHERE am.amname = 'btree' + AND c.opcdefault + AND c.opcintype = '{{prefix}}_internal.ore_block_256'::pg_catalog.regtype + ) THEN + RETURN; + END IF; + + ALTER DOMAIN {{prefix}}.query_real_range_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, '{{prefix}}.query_real_range_ore', '{{prefix}}.query_real_range_ope (range)')) NOT VALID; +END; +$do$; diff --git a/packages/eql/src/v3/scalars/real/query_real_types.sql b/packages/eql/src/v3/scalars/real/query_real_types.sql index 57ed840bc..a7b81b073 100644 --- a/packages/eql/src/v3/scalars/real/query_real_types.sql +++ b/packages/eql/src/v3/scalars/real/query_real_types.sql @@ -3,41 +3,41 @@ --! @file v3/scalars/real/query_real_types.sql --! @brief Query-operand domains for real (index-terms-only, no ciphertext). ---! @note Query-operand domains live in `eql_v3` (not `public`): they are +--! @note Query-operand domains live in `{{prefix}}` (not `public`): they are --! never valid column types, so they don't belong in the column-type --! namespace, and dropping the EQL-owned schema can never drop an --! application column. --! @note Cast a query operand explicitly to its `query_` domain in a predicate ---! (e.g. `WHERE col = $1::eql_v3.query_real_eq`). A bare, +--! (e.g. `WHERE col = $1::{{prefix}}.query_real_eq`). A bare, --! uncast literal RHS is ambiguous between the `query_` and `jsonb` --! operator overloads and will not resolve. DO $$ BEGIN - --! @brief Query-operand domain eql_v3.query_real_eq (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_real_eq (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_real_eq' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_real_eq' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_real_eq AS jsonb + CREATE DOMAIN {{prefix}}.query_real_eq AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'hm' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_real_eq IS 'EQL real query operand (equality)'; + COMMENT ON DOMAIN {{prefix}}.query_real_eq IS 'EQL real query operand (equality)'; - --! @brief Query-operand domain eql_v3.query_real_ord_ore (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_real_ord_ore (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_real_ord_ore' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_real_ord_ore' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_real_ord_ore AS jsonb + CREATE DOMAIN {{prefix}}.query_real_ord_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -46,46 +46,46 @@ BEGIN AND NOT (VALUE ? 'c') AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_real_ord_ore IS 'EQL real query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_real_ord_ore IS 'EQL real query operand (equality, ordering)'; - --! @brief Query-operand domain eql_v3.query_real_ord (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_real_ord (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_real_ord' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_real_ord' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_real_ord AS jsonb + CREATE DOMAIN {{prefix}}.query_real_ord AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'op' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_real_ord IS 'EQL real query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_real_ord IS 'EQL real query operand (equality, ordering)'; - --! @brief Query-operand domain eql_v3.query_real_ord_ope (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_real_ord_ope (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_real_ord_ope' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_real_ord_ope' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_real_ord_ope AS jsonb + CREATE DOMAIN {{prefix}}.query_real_ord_ope AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'op' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_real_ord_ope IS 'EQL real query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_real_ord_ope IS 'EQL real query operand (equality, ordering)'; END $$; diff --git a/packages/eql/src/v3/scalars/real/real_eq_functions.sql b/packages/eql/src/v3/scalars/real/real_eq_functions.sql index a7b504d59..382829281 100644 --- a/packages/eql/src/v3/scalars/real/real_eq_functions.sql +++ b/packages/eql/src/v3/scalars/real/real_eq_functions.sql @@ -5,634 +5,634 @@ -- REQUIRE: src/v3/sem/hmac_256/functions.sql --! @file encrypted_domain/real/real_eq_functions.sql ---! @brief Functions for public.eql_v3_real_eq. +--! @brief Functions for public.{{prefix}}_real_eq. ---! @brief Index extractor for public.eql_v3_real_eq. ---! @param a public.eql_v3_real_eq ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a public.eql_v3_real_eq) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for public.{{prefix}}_real_eq. +--! @param a public.{{prefix}}_real_eq +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a public.{{prefix}}_real_eq) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_real_eq. ---! @param a public.eql_v3_real_eq ---! @param b public.eql_v3_real_eq +--! @brief Operator wrapper for public.{{prefix}}_real_eq. +--! @param a public.{{prefix}}_real_eq +--! @param b public.{{prefix}}_real_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_real_eq, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_eq, b public.{{prefix}}_real_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_eq. ---! @param a public.eql_v3_real_eq +--! @brief Operator wrapper for public.{{prefix}}_real_eq. +--! @param a public.{{prefix}}_real_eq --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_real_eq, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b::public.eql_v3_real_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_real_eq) $$; ---! @brief Operator wrapper for public.eql_v3_real_eq. +--! @brief Operator wrapper for public.{{prefix}}_real_eq. --! @param a jsonb ---! @param b public.eql_v3_real_eq +--! @param b public.{{prefix}}_real_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_real_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_real_eq) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_real_eq) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_eq. ---! @param a public.eql_v3_real_eq ---! @param b public.eql_v3_real_eq +--! @brief Operator wrapper for public.{{prefix}}_real_eq. +--! @param a public.{{prefix}}_real_eq +--! @param b public.{{prefix}}_real_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_real_eq, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_eq, b public.{{prefix}}_real_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_eq. ---! @param a public.eql_v3_real_eq +--! @brief Operator wrapper for public.{{prefix}}_real_eq. +--! @param a public.{{prefix}}_real_eq --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_real_eq, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b::public.eql_v3_real_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_real_eq) $$; ---! @brief Operator wrapper for public.eql_v3_real_eq. +--! @brief Operator wrapper for public.{{prefix}}_real_eq. --! @param a jsonb ---! @param b public.eql_v3_real_eq +--! @param b public.{{prefix}}_real_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_real_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_real_eq) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_real_eq) <> {{prefix}}.eq_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator ---! @param b public.eql_v3_real_eq right operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator +--! @param b public.{{prefix}}_real_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_real_eq, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_real_eq, b public.{{prefix}}_real_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_real_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_real_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_eq right operand of the blocked operator +--! @param b public.{{prefix}}_real_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_real_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator ---! @param b public.eql_v3_real_eq right operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator +--! @param b public.{{prefix}}_real_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_real_eq, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_real_eq, b public.{{prefix}}_real_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_real_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_real_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_eq right operand of the blocked operator +--! @param b public.{{prefix}}_real_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_real_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator ---! @param b public.eql_v3_real_eq right operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator +--! @param b public.{{prefix}}_real_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_real_eq, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_real_eq, b public.{{prefix}}_real_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_real_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_real_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_eq right operand of the blocked operator +--! @param b public.{{prefix}}_real_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_real_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator ---! @param b public.eql_v3_real_eq right operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator +--! @param b public.{{prefix}}_real_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_real_eq, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_real_eq, b public.{{prefix}}_real_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_real_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_real_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_eq right operand of the blocked operator +--! @param b public.{{prefix}}_real_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_real_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator ---! @param b public.eql_v3_real_eq right operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator +--! @param b public.{{prefix}}_real_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_real_eq, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_real_eq, b public.{{prefix}}_real_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_real_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_real_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_eq right operand of the blocked operator +--! @param b public.{{prefix}}_real_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_real_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator ---! @param b public.eql_v3_real_eq right operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator +--! @param b public.{{prefix}}_real_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_real_eq, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_real_eq, b public.{{prefix}}_real_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_real_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_real_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_eq right operand of the blocked operator +--! @param b public.{{prefix}}_real_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_real_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_real_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_real_eq, selector text) -RETURNS public.eql_v3_real_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_real_eq'; END; $$ +--! @return public.{{prefix}}_real_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_real_eq, selector text) +RETURNS public.{{prefix}}_real_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_real_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_real_eq, selector integer) -RETURNS public.eql_v3_real_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_real_eq'; END; $$ +--! @return public.{{prefix}}_real_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_real_eq, selector integer) +RETURNS public.{{prefix}}_real_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_real_eq right operand of the blocked operator ---! @return public.eql_v3_real_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_real_eq) -RETURNS public.eql_v3_real_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_real_eq'; END; $$ +--! @param selector public.{{prefix}}_real_eq right operand of the blocked operator +--! @return public.{{prefix}}_real_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_real_eq) +RETURNS public.{{prefix}}_real_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_real_eq, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_real_eq, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_real_eq, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_real_eq, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_real_eq right operand of the blocked operator +--! @param selector public.{{prefix}}_real_eq right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_real_eq) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_real_eq, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_real_eq, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_real_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_real_eq, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_real_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_real_eq, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_real_eq, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_real_eq, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator ---! @param b public.eql_v3_real_eq right operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator +--! @param b public.{{prefix}}_real_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_real_eq, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_real_eq, b public.{{prefix}}_real_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_real_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_real_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_eq right operand of the blocked operator +--! @param b public.{{prefix}}_real_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_real_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_real_eq, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_real_eq, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_real_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_real_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_real_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_real_eq, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_real_eq, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_real_eq, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_real_eq, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_real_eq, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_real_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_real_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_real_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_real_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator ---! @param b public.eql_v3_real_eq right operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator +--! @param b public.{{prefix}}_real_eq right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_real_eq, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_real_eq, b public.{{prefix}}_real_eq) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_eq left operand of the blocked operator +--! @param a public.{{prefix}}_real_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_real_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_real_eq, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_eq right operand of the blocked operator +--! @param b public.{{prefix}}_real_eq right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_real_eq) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_real_eq) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_real_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_real_eq'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/real/real_eq_operators.sql b/packages/eql/src/v3/scalars/real/real_eq_operators.sql index 9ddac1035..a5c06a230 100644 --- a/packages/eql/src/v3/scalars/real/real_eq_operators.sql +++ b/packages/eql/src/v3/scalars/real/real_eq_operators.sql @@ -4,245 +4,245 @@ -- REQUIRE: src/v3/scalars/real/real_eq_functions.sql --! @file encrypted_domain/real/real_eq_operators.sql ---! @brief Operators for public.eql_v3_real_eq. +--! @brief Operators for public.{{prefix}}_real_eq. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_real_eq, RIGHTARG = public.eql_v3_real_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = public.{{prefix}}_real_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_real_eq, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_real_eq, RIGHTARG = public.eql_v3_real_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = public.{{prefix}}_real_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_real_eq, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_real_eq, RIGHTARG = public.eql_v3_real_eq + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = public.{{prefix}}_real_eq ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_real_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_eq + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_eq ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_real_eq, RIGHTARG = public.eql_v3_real_eq + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = public.{{prefix}}_real_eq ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_real_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_eq + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_eq ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_real_eq, RIGHTARG = public.eql_v3_real_eq + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = public.{{prefix}}_real_eq ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_real_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_eq + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_eq ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_real_eq, RIGHTARG = public.eql_v3_real_eq + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = public.{{prefix}}_real_eq ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_real_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_eq + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_eq ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_real_eq, RIGHTARG = public.eql_v3_real_eq + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = public.{{prefix}}_real_eq ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_real_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_eq + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_eq ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_real_eq, RIGHTARG = public.eql_v3_real_eq + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = public.{{prefix}}_real_eq ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_real_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_eq + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_eq ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_real_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_real_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_eq + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_eq ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_real_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_real_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_eq + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_eq ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_real_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_real_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_real_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_real_eq, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_real_eq, RIGHTARG = public.eql_v3_real_eq + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = public.{{prefix}}_real_eq ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_real_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_eq + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_eq ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_real_eq, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_real_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_real_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_real_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_real_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_real_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_real_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_real_eq, RIGHTARG = public.eql_v3_real_eq + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = public.{{prefix}}_real_eq ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_real_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_eq + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_eq ); diff --git a/packages/eql/src/v3/scalars/real/real_functions.sql b/packages/eql/src/v3/scalars/real/real_functions.sql index 2d68e57ca..dbcfe5b47 100644 --- a/packages/eql/src/v3/scalars/real/real_functions.sql +++ b/packages/eql/src/v3/scalars/real/real_functions.sql @@ -4,662 +4,662 @@ -- REQUIRE: src/v3/scalars/functions.sql --! @file encrypted_domain/real/real_functions.sql ---! @brief Functions for public.eql_v3_real. +--! @brief Functions for public.{{prefix}}_real. ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_real, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_real, b public.{{prefix}}_real) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_real, b jsonb) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_real, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a jsonb, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal.eq(a jsonb, b public.{{prefix}}_real) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_real, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_real, b public.{{prefix}}_real) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_real, b jsonb) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_real, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a jsonb, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal.neq(a jsonb, b public.{{prefix}}_real) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_real, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_real, b public.{{prefix}}_real) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_real, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_real, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_real) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_real, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_real, b public.{{prefix}}_real) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_real, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_real, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_real) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_real, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_real, b public.{{prefix}}_real) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_real, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_real, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_real) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_real, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_real, b public.{{prefix}}_real) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_real, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_real, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_real) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_real, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_real, b public.{{prefix}}_real) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_real, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_real, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_real) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_real, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_real, b public.{{prefix}}_real) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_real, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_real, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_real) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_real never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_real, selector text) -RETURNS public.eql_v3_real IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_real'; END; $$ +--! @return public.{{prefix}}_real never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_real, selector text) +RETURNS public.{{prefix}}_real IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_real never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_real, selector integer) -RETURNS public.eql_v3_real IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_real'; END; $$ +--! @return public.{{prefix}}_real never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_real, selector integer) +RETURNS public.{{prefix}}_real IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_real right operand of the blocked operator ---! @return public.eql_v3_real never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_real) -RETURNS public.eql_v3_real IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_real'; END; $$ +--! @param selector public.{{prefix}}_real right operand of the blocked operator +--! @return public.{{prefix}}_real never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_real) +RETURNS public.{{prefix}}_real IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_real, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_real, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_real, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_real, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_real right operand of the blocked operator +--! @param selector public.{{prefix}}_real right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_real) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_real, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_real, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_real, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_real, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_real, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_real, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_real, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_real, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_real, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_real, b public.{{prefix}}_real) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_real, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_real, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_real) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_real, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_real, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_real, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_real, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_real, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_real, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_real, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_real, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_real, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_real, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_real, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_real, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_real, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_real, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_real, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_real, b public.{{prefix}}_real) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real left operand of the blocked operator +--! @param a public.{{prefix}}_real left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_real, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_real, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real. +--! @brief Unsupported operator blocker for public.{{prefix}}_real. --! ---! Intercepts an operator that is not supported on public.eql_v3_real and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real right operand of the blocked operator +--! @param b public.{{prefix}}_real right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_real) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_real) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_real'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_real'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/real/real_operators.sql b/packages/eql/src/v3/scalars/real/real_operators.sql index 99ed1e23d..f03c820e5 100644 --- a/packages/eql/src/v3/scalars/real/real_operators.sql +++ b/packages/eql/src/v3/scalars/real/real_operators.sql @@ -4,239 +4,239 @@ -- REQUIRE: src/v3/scalars/real/real_functions.sql --! @file encrypted_domain/real/real_operators.sql ---! @brief Operators for public.eql_v3_real. +--! @brief Operators for public.{{prefix}}_real. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_real, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_real, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_real, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_real, RIGHTARG = jsonb ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_real, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_real, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_real, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_real, RIGHTARG = jsonb ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_real, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_real, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_real, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_real, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_real, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_real, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_real, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_real, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_real, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_real, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_real, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_real, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_real, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_real, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_real, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_real, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_real, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_real, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_real, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_real, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_real, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_real, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_real, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_real, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_real, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_real, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_real, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_real, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_real, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_real, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_real, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_real, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_real, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_real, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_real, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_real, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_real, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_real, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_real, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_real, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_real, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_real, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_real, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_real, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_real, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_real, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_real, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_real, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_real, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_real, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_real, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_real, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_real, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_real, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_real, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_real, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_real, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_real, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_real, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_real, RIGHTARG = public.{{prefix}}_real ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_real, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_real, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real ); diff --git a/packages/eql/src/v3/scalars/real/real_ord_aggregates.sql b/packages/eql/src/v3/scalars/real/real_ord_aggregates.sql index 608c7f7f0..cb43ea23b 100644 --- a/packages/eql/src/v3/scalars/real/real_ord_aggregates.sql +++ b/packages/eql/src/v3/scalars/real/real_ord_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/real/real_ord_operators.sql --! @file encrypted_domain/real/real_ord_aggregates.sql ---! @brief Aggregates for public.eql_v3_real_ord. +--! @brief Aggregates for public.{{prefix}}_real_ord. ---! @brief State function for min on public.eql_v3_real_ord. ---! @param state public.eql_v3_real_ord ---! @param value public.eql_v3_real_ord ---! @return public.eql_v3_real_ord -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_real_ord, value public.eql_v3_real_ord) -RETURNS public.eql_v3_real_ord +--! @brief State function for min on public.{{prefix}}_real_ord. +--! @param state public.{{prefix}}_real_ord +--! @param value public.{{prefix}}_real_ord +--! @return public.{{prefix}}_real_ord +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_real_ord, value public.{{prefix}}_real_ord) +RETURNS public.{{prefix}}_real_ord LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_real_ord. ---! @param input public.eql_v3_real_ord ---! @return public.eql_v3_real_ord -CREATE AGGREGATE eql_v3.min(public.eql_v3_real_ord) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_real_ord, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_real_ord. +--! @param input public.{{prefix}}_real_ord +--! @return public.{{prefix}}_real_ord +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_real_ord) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_real_ord, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_real_ord. ---! @param state public.eql_v3_real_ord ---! @param value public.eql_v3_real_ord ---! @return public.eql_v3_real_ord -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_real_ord, value public.eql_v3_real_ord) -RETURNS public.eql_v3_real_ord +--! @brief State function for max on public.{{prefix}}_real_ord. +--! @param state public.{{prefix}}_real_ord +--! @param value public.{{prefix}}_real_ord +--! @return public.{{prefix}}_real_ord +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_real_ord, value public.{{prefix}}_real_ord) +RETURNS public.{{prefix}}_real_ord LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_real_ord. ---! @param input public.eql_v3_real_ord ---! @return public.eql_v3_real_ord -CREATE AGGREGATE eql_v3.max(public.eql_v3_real_ord) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_real_ord, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_real_ord. +--! @param input public.{{prefix}}_real_ord +--! @return public.{{prefix}}_real_ord +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_real_ord) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_real_ord, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/real/real_ord_functions.sql b/packages/eql/src/v3/scalars/real/real_ord_functions.sql index e3631653b..2b54c4312 100644 --- a/packages/eql/src/v3/scalars/real/real_ord_functions.sql +++ b/packages/eql/src/v3/scalars/real/real_ord_functions.sql @@ -5,562 +5,562 @@ -- REQUIRE: src/v3/sem/ope_cllw/functions.sql --! @file encrypted_domain/real/real_ord_functions.sql ---! @brief Functions for public.eql_v3_real_ord. +--! @brief Functions for public.{{prefix}}_real_ord. ---! @brief Index extractor for public.eql_v3_real_ord. ---! @param a public.eql_v3_real_ord ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a public.eql_v3_real_ord) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for public.{{prefix}}_real_ord. +--! @param a public.{{prefix}}_real_ord +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a public.{{prefix}}_real_ord) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord. ---! @param a public.eql_v3_real_ord ---! @param b public.eql_v3_real_ord +--! @brief Operator wrapper for public.{{prefix}}_real_ord. +--! @param a public.{{prefix}}_real_ord +--! @param b public.{{prefix}}_real_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_real_ord, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord. ---! @param a public.eql_v3_real_ord +--! @brief Operator wrapper for public.{{prefix}}_real_ord. +--! @param a public.{{prefix}}_real_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_real_ord, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b::public.eql_v3_real_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_real_ord) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord. +--! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a jsonb ---! @param b public.eql_v3_real_ord +--! @param b public.{{prefix}}_real_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_real_ord) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord. ---! @param a public.eql_v3_real_ord ---! @param b public.eql_v3_real_ord +--! @brief Operator wrapper for public.{{prefix}}_real_ord. +--! @param a public.{{prefix}}_real_ord +--! @param b public.{{prefix}}_real_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_real_ord, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord. ---! @param a public.eql_v3_real_ord +--! @brief Operator wrapper for public.{{prefix}}_real_ord. +--! @param a public.{{prefix}}_real_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_real_ord, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b::public.eql_v3_real_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_real_ord) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord. +--! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a jsonb ---! @param b public.eql_v3_real_ord +--! @param b public.{{prefix}}_real_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_real_ord) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord. ---! @param a public.eql_v3_real_ord ---! @param b public.eql_v3_real_ord +--! @brief Operator wrapper for public.{{prefix}}_real_ord. +--! @param a public.{{prefix}}_real_ord +--! @param b public.{{prefix}}_real_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_real_ord, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord. ---! @param a public.eql_v3_real_ord +--! @brief Operator wrapper for public.{{prefix}}_real_ord. +--! @param a public.{{prefix}}_real_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_real_ord, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_real_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b::public.eql_v3_real_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_real_ord) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord. +--! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a jsonb ---! @param b public.eql_v3_real_ord +--! @param b public.{{prefix}}_real_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_real_ord) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord. ---! @param a public.eql_v3_real_ord ---! @param b public.eql_v3_real_ord +--! @brief Operator wrapper for public.{{prefix}}_real_ord. +--! @param a public.{{prefix}}_real_ord +--! @param b public.{{prefix}}_real_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_real_ord, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord. ---! @param a public.eql_v3_real_ord +--! @brief Operator wrapper for public.{{prefix}}_real_ord. +--! @param a public.{{prefix}}_real_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_real_ord, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_real_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b::public.eql_v3_real_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_real_ord) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord. +--! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a jsonb ---! @param b public.eql_v3_real_ord +--! @param b public.{{prefix}}_real_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_real_ord) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord. ---! @param a public.eql_v3_real_ord ---! @param b public.eql_v3_real_ord +--! @brief Operator wrapper for public.{{prefix}}_real_ord. +--! @param a public.{{prefix}}_real_ord +--! @param b public.{{prefix}}_real_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_real_ord, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord. ---! @param a public.eql_v3_real_ord +--! @brief Operator wrapper for public.{{prefix}}_real_ord. +--! @param a public.{{prefix}}_real_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_real_ord, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_real_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b::public.eql_v3_real_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_real_ord) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord. +--! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a jsonb ---! @param b public.eql_v3_real_ord +--! @param b public.{{prefix}}_real_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_real_ord) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord. ---! @param a public.eql_v3_real_ord ---! @param b public.eql_v3_real_ord +--! @brief Operator wrapper for public.{{prefix}}_real_ord. +--! @param a public.{{prefix}}_real_ord +--! @param b public.{{prefix}}_real_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_real_ord, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord. ---! @param a public.eql_v3_real_ord +--! @brief Operator wrapper for public.{{prefix}}_real_ord. +--! @param a public.{{prefix}}_real_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_real_ord, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_real_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b::public.eql_v3_real_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_real_ord) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord. +--! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a jsonb ---! @param b public.eql_v3_real_ord +--! @param b public.{{prefix}}_real_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_real_ord) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator ---! @param b public.eql_v3_real_ord right operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator +--! @param b public.{{prefix}}_real_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_real_ord, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_real_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_real_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_ord right operand of the blocked operator +--! @param b public.{{prefix}}_real_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_real_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator ---! @param b public.eql_v3_real_ord right operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator +--! @param b public.{{prefix}}_real_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_real_ord, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_real_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_real_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_ord right operand of the blocked operator +--! @param b public.{{prefix}}_real_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_real_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_real_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_real_ord, selector text) -RETURNS public.eql_v3_real_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_real_ord'; END; $$ +--! @return public.{{prefix}}_real_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_real_ord, selector text) +RETURNS public.{{prefix}}_real_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_real_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_real_ord, selector integer) -RETURNS public.eql_v3_real_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_real_ord'; END; $$ +--! @return public.{{prefix}}_real_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_real_ord, selector integer) +RETURNS public.{{prefix}}_real_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_real_ord right operand of the blocked operator ---! @return public.eql_v3_real_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_real_ord) -RETURNS public.eql_v3_real_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_real_ord'; END; $$ +--! @param selector public.{{prefix}}_real_ord right operand of the blocked operator +--! @return public.{{prefix}}_real_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_real_ord) +RETURNS public.{{prefix}}_real_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_real_ord, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_real_ord, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_real_ord, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_real_ord, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_real_ord right operand of the blocked operator +--! @param selector public.{{prefix}}_real_ord right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_real_ord) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_real_ord, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_real_ord, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_real_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_real_ord, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_real_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_real_ord, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_real_ord, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_real_ord, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator ---! @param b public.eql_v3_real_ord right operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator +--! @param b public.{{prefix}}_real_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_real_ord, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_real_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_real_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_ord right operand of the blocked operator +--! @param b public.{{prefix}}_real_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_real_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_real_ord, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_real_ord, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_real_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_real_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_real_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_real_ord, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_real_ord, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_real_ord, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_real_ord, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_real_ord, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_real_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_real_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_real_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_real_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator ---! @param b public.eql_v3_real_ord right operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator +--! @param b public.{{prefix}}_real_ord right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_real_ord, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_real_ord, b public.{{prefix}}_real_ord) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_real_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_real_ord, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_ord right operand of the blocked operator +--! @param b public.{{prefix}}_real_ord right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_real_ord) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_real_ord) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_real_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_real_ord'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/real/real_ord_ope_aggregates.sql b/packages/eql/src/v3/scalars/real/real_ord_ope_aggregates.sql index de285158c..ec99c5f40 100644 --- a/packages/eql/src/v3/scalars/real/real_ord_ope_aggregates.sql +++ b/packages/eql/src/v3/scalars/real/real_ord_ope_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/real/real_ord_ope_operators.sql --! @file encrypted_domain/real/real_ord_ope_aggregates.sql ---! @brief Aggregates for public.eql_v3_real_ord_ope. +--! @brief Aggregates for public.{{prefix}}_real_ord_ope. ---! @brief State function for min on public.eql_v3_real_ord_ope. ---! @param state public.eql_v3_real_ord_ope ---! @param value public.eql_v3_real_ord_ope ---! @return public.eql_v3_real_ord_ope -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_real_ord_ope, value public.eql_v3_real_ord_ope) -RETURNS public.eql_v3_real_ord_ope +--! @brief State function for min on public.{{prefix}}_real_ord_ope. +--! @param state public.{{prefix}}_real_ord_ope +--! @param value public.{{prefix}}_real_ord_ope +--! @return public.{{prefix}}_real_ord_ope +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_real_ord_ope, value public.{{prefix}}_real_ord_ope) +RETURNS public.{{prefix}}_real_ord_ope LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_real_ord_ope. ---! @param input public.eql_v3_real_ord_ope ---! @return public.eql_v3_real_ord_ope -CREATE AGGREGATE eql_v3.min(public.eql_v3_real_ord_ope) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_real_ord_ope, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_real_ord_ope. +--! @param input public.{{prefix}}_real_ord_ope +--! @return public.{{prefix}}_real_ord_ope +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_real_ord_ope) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_real_ord_ope, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_real_ord_ope. ---! @param state public.eql_v3_real_ord_ope ---! @param value public.eql_v3_real_ord_ope ---! @return public.eql_v3_real_ord_ope -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_real_ord_ope, value public.eql_v3_real_ord_ope) -RETURNS public.eql_v3_real_ord_ope +--! @brief State function for max on public.{{prefix}}_real_ord_ope. +--! @param state public.{{prefix}}_real_ord_ope +--! @param value public.{{prefix}}_real_ord_ope +--! @return public.{{prefix}}_real_ord_ope +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_real_ord_ope, value public.{{prefix}}_real_ord_ope) +RETURNS public.{{prefix}}_real_ord_ope LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_real_ord_ope. ---! @param input public.eql_v3_real_ord_ope ---! @return public.eql_v3_real_ord_ope -CREATE AGGREGATE eql_v3.max(public.eql_v3_real_ord_ope) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_real_ord_ope, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_real_ord_ope. +--! @param input public.{{prefix}}_real_ord_ope +--! @return public.{{prefix}}_real_ord_ope +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_real_ord_ope) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_real_ord_ope, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/real/real_ord_ope_functions.sql b/packages/eql/src/v3/scalars/real/real_ord_ope_functions.sql index 18da5b294..7143e3fa6 100644 --- a/packages/eql/src/v3/scalars/real/real_ord_ope_functions.sql +++ b/packages/eql/src/v3/scalars/real/real_ord_ope_functions.sql @@ -5,562 +5,562 @@ -- REQUIRE: src/v3/sem/ope_cllw/functions.sql --! @file encrypted_domain/real/real_ord_ope_functions.sql ---! @brief Functions for public.eql_v3_real_ord_ope. +--! @brief Functions for public.{{prefix}}_real_ord_ope. ---! @brief Index extractor for public.eql_v3_real_ord_ope. ---! @param a public.eql_v3_real_ord_ope ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a public.eql_v3_real_ord_ope) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for public.{{prefix}}_real_ord_ope. +--! @param a public.{{prefix}}_real_ord_ope +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a public.{{prefix}}_real_ord_ope) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ope. ---! @param a public.eql_v3_real_ord_ope ---! @param b public.eql_v3_real_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. +--! @param a public.{{prefix}}_real_ord_ope +--! @param b public.{{prefix}}_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_real_ord_ope, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_ord_ope, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ope. ---! @param a public.eql_v3_real_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. +--! @param a public.{{prefix}}_real_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_real_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b::public.eql_v3_real_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_real_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_real_ord_ope +--! @param b public.{{prefix}}_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_real_ord_ope) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ope. ---! @param a public.eql_v3_real_ord_ope ---! @param b public.eql_v3_real_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. +--! @param a public.{{prefix}}_real_ord_ope +--! @param b public.{{prefix}}_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_real_ord_ope, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_ord_ope, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ope. ---! @param a public.eql_v3_real_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. +--! @param a public.{{prefix}}_real_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_real_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b::public.eql_v3_real_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_real_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_real_ord_ope +--! @param b public.{{prefix}}_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_real_ord_ope) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ope. ---! @param a public.eql_v3_real_ord_ope ---! @param b public.eql_v3_real_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. +--! @param a public.{{prefix}}_real_ord_ope +--! @param b public.{{prefix}}_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_real_ord_ope, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_real_ord_ope, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ope. ---! @param a public.eql_v3_real_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. +--! @param a public.{{prefix}}_real_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_real_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_real_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b::public.eql_v3_real_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_real_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_real_ord_ope +--! @param b public.{{prefix}}_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_real_ord_ope) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ope. ---! @param a public.eql_v3_real_ord_ope ---! @param b public.eql_v3_real_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. +--! @param a public.{{prefix}}_real_ord_ope +--! @param b public.{{prefix}}_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_real_ord_ope, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_real_ord_ope, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ope. ---! @param a public.eql_v3_real_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. +--! @param a public.{{prefix}}_real_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_real_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_real_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b::public.eql_v3_real_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_real_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_real_ord_ope +--! @param b public.{{prefix}}_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_real_ord_ope) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ope. ---! @param a public.eql_v3_real_ord_ope ---! @param b public.eql_v3_real_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. +--! @param a public.{{prefix}}_real_ord_ope +--! @param b public.{{prefix}}_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_real_ord_ope, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_real_ord_ope, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ope. ---! @param a public.eql_v3_real_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. +--! @param a public.{{prefix}}_real_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_real_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_real_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b::public.eql_v3_real_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_real_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_real_ord_ope +--! @param b public.{{prefix}}_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_real_ord_ope) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ope. ---! @param a public.eql_v3_real_ord_ope ---! @param b public.eql_v3_real_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. +--! @param a public.{{prefix}}_real_ord_ope +--! @param b public.{{prefix}}_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_real_ord_ope, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_real_ord_ope, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ope. ---! @param a public.eql_v3_real_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. +--! @param a public.{{prefix}}_real_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_real_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_real_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b::public.eql_v3_real_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_real_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_real_ord_ope +--! @param b public.{{prefix}}_real_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_real_ord_ope) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_real_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_real_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_real_ord_ope, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_real_ord_ope, b public.{{prefix}}_real_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_real_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_real_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_real_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_real_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_real_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_real_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_real_ord_ope, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_real_ord_ope, b public.{{prefix}}_real_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_real_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_real_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_real_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_real_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_real_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_real_ord_ope, selector text) -RETURNS public.eql_v3_real_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_real_ord_ope'; END; $$ +--! @return public.{{prefix}}_real_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_real_ord_ope, selector text) +RETURNS public.{{prefix}}_real_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_real_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_real_ord_ope, selector integer) -RETURNS public.eql_v3_real_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_real_ord_ope'; END; $$ +--! @return public.{{prefix}}_real_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_real_ord_ope, selector integer) +RETURNS public.{{prefix}}_real_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_real_ord_ope right operand of the blocked operator ---! @return public.eql_v3_real_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_real_ord_ope) -RETURNS public.eql_v3_real_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_real_ord_ope'; END; $$ +--! @param selector public.{{prefix}}_real_ord_ope right operand of the blocked operator +--! @return public.{{prefix}}_real_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_real_ord_ope) +RETURNS public.{{prefix}}_real_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_real_ord_ope, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_real_ord_ope, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_real_ord_ope, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_real_ord_ope, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_real_ord_ope right operand of the blocked operator +--! @param selector public.{{prefix}}_real_ord_ope right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_real_ord_ope) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_real_ord_ope, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_real_ord_ope, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_real_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_real_ord_ope, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_real_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_real_ord_ope, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_real_ord_ope, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_real_ord_ope, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_real_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_real_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_real_ord_ope, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_real_ord_ope, b public.{{prefix}}_real_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_real_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_real_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_real_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_real_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_real_ord_ope, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_real_ord_ope, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_real_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_real_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_real_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_real_ord_ope, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_real_ord_ope, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_real_ord_ope, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_real_ord_ope, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_real_ord_ope, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_real_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_real_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_real_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_real_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_real_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_real_ord_ope right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_real_ord_ope, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_real_ord_ope, b public.{{prefix}}_real_ord_ope) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_real_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_real_ord_ope, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_real_ord_ope right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_real_ord_ope) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_real_ord_ope) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_real_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_real_ord_ope'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/real/real_ord_ope_operators.sql b/packages/eql/src/v3/scalars/real/real_ord_ope_operators.sql index c11db40a3..310f1264b 100644 --- a/packages/eql/src/v3/scalars/real/real_ord_ope_operators.sql +++ b/packages/eql/src/v3/scalars/real/real_ord_ope_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/real/real_ord_ope_functions.sql --! @file encrypted_domain/real/real_ord_ope_operators.sql ---! @brief Operators for public.eql_v3_real_ord_ope. +--! @brief Operators for public.{{prefix}}_real_ord_ope. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = public.eql_v3_real_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = public.eql_v3_real_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = public.eql_v3_real_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = public.eql_v3_real_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = public.eql_v3_real_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = public.eql_v3_real_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = public.eql_v3_real_ord_ope + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ope ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ope + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ope ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = public.eql_v3_real_ord_ope + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ope ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ope + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ope ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ope + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ope ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ope + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ope ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = public.eql_v3_real_ord_ope + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ope ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ope + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ope ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = public.eql_v3_real_ord_ope + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ope ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_real_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ope + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ope ); diff --git a/packages/eql/src/v3/scalars/real/real_ord_operators.sql b/packages/eql/src/v3/scalars/real/real_ord_operators.sql index b5b3692b1..922e70ab4 100644 --- a/packages/eql/src/v3/scalars/real/real_ord_operators.sql +++ b/packages/eql/src/v3/scalars/real/real_ord_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/real/real_ord_functions.sql --! @file encrypted_domain/real/real_ord_operators.sql ---! @brief Operators for public.eql_v3_real_ord. +--! @brief Operators for public.{{prefix}}_real_ord. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = public.eql_v3_real_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = public.{{prefix}}_real_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = public.eql_v3_real_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = public.{{prefix}}_real_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = public.eql_v3_real_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = public.{{prefix}}_real_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = public.eql_v3_real_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = public.{{prefix}}_real_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = public.eql_v3_real_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = public.{{prefix}}_real_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = public.eql_v3_real_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = public.{{prefix}}_real_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = public.eql_v3_real_ord + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = public.{{prefix}}_real_ord ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = public.eql_v3_real_ord + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = public.{{prefix}}_real_ord ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_real_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_real_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_real_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_real_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_real_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_real_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_real_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_real_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_real_ord, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_real_ord, RIGHTARG = public.eql_v3_real_ord + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = public.{{prefix}}_real_ord ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_real_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_real_ord, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_real_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_real_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_real_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_real_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_real_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_real_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_real_ord, RIGHTARG = public.eql_v3_real_ord + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = public.{{prefix}}_real_ord ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_real_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord ); diff --git a/packages/eql/src/v3/scalars/real/real_ord_ore_aggregates.sql b/packages/eql/src/v3/scalars/real/real_ord_ore_aggregates.sql index 60abf7116..e9708bacb 100644 --- a/packages/eql/src/v3/scalars/real/real_ord_ore_aggregates.sql +++ b/packages/eql/src/v3/scalars/real/real_ord_ore_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/real/real_ord_ore_operators.sql --! @file encrypted_domain/real/real_ord_ore_aggregates.sql ---! @brief Aggregates for public.eql_v3_real_ord_ore. +--! @brief Aggregates for public.{{prefix}}_real_ord_ore. ---! @brief State function for min on public.eql_v3_real_ord_ore. ---! @param state public.eql_v3_real_ord_ore ---! @param value public.eql_v3_real_ord_ore ---! @return public.eql_v3_real_ord_ore -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_real_ord_ore, value public.eql_v3_real_ord_ore) -RETURNS public.eql_v3_real_ord_ore +--! @brief State function for min on public.{{prefix}}_real_ord_ore. +--! @param state public.{{prefix}}_real_ord_ore +--! @param value public.{{prefix}}_real_ord_ore +--! @return public.{{prefix}}_real_ord_ore +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_real_ord_ore, value public.{{prefix}}_real_ord_ore) +RETURNS public.{{prefix}}_real_ord_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_real_ord_ore. ---! @param input public.eql_v3_real_ord_ore ---! @return public.eql_v3_real_ord_ore -CREATE AGGREGATE eql_v3.min(public.eql_v3_real_ord_ore) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_real_ord_ore, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_real_ord_ore. +--! @param input public.{{prefix}}_real_ord_ore +--! @return public.{{prefix}}_real_ord_ore +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_real_ord_ore) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_real_ord_ore, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_real_ord_ore. ---! @param state public.eql_v3_real_ord_ore ---! @param value public.eql_v3_real_ord_ore ---! @return public.eql_v3_real_ord_ore -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_real_ord_ore, value public.eql_v3_real_ord_ore) -RETURNS public.eql_v3_real_ord_ore +--! @brief State function for max on public.{{prefix}}_real_ord_ore. +--! @param state public.{{prefix}}_real_ord_ore +--! @param value public.{{prefix}}_real_ord_ore +--! @return public.{{prefix}}_real_ord_ore +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_real_ord_ore, value public.{{prefix}}_real_ord_ore) +RETURNS public.{{prefix}}_real_ord_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_real_ord_ore. ---! @param input public.eql_v3_real_ord_ore ---! @return public.eql_v3_real_ord_ore -CREATE AGGREGATE eql_v3.max(public.eql_v3_real_ord_ore) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_real_ord_ore, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_real_ord_ore. +--! @param input public.{{prefix}}_real_ord_ore +--! @return public.{{prefix}}_real_ord_ore +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_real_ord_ore) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_real_ord_ore, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/real/real_ord_ore_functions.sql b/packages/eql/src/v3/scalars/real/real_ord_ore_functions.sql index bbc01055f..c88e2b5b9 100644 --- a/packages/eql/src/v3/scalars/real/real_ord_ore_functions.sql +++ b/packages/eql/src/v3/scalars/real/real_ord_ore_functions.sql @@ -6,562 +6,562 @@ -- REQUIRE: src/v3/sem/ore_block_256/operators.sql --! @file encrypted_domain/real/real_ord_ore_functions.sql ---! @brief Functions for public.eql_v3_real_ord_ore. +--! @brief Functions for public.{{prefix}}_real_ord_ore. ---! @brief Index extractor for public.eql_v3_real_ord_ore. ---! @param a public.eql_v3_real_ord_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a public.eql_v3_real_ord_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for public.{{prefix}}_real_ord_ore. +--! @param a public.{{prefix}}_real_ord_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a public.{{prefix}}_real_ord_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ore. ---! @param a public.eql_v3_real_ord_ore ---! @param b public.eql_v3_real_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. +--! @param a public.{{prefix}}_real_ord_ore +--! @param b public.{{prefix}}_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_real_ord_ore, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_ord_ore, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ore. ---! @param a public.eql_v3_real_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. +--! @param a public.{{prefix}}_real_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_real_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b::public.eql_v3_real_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{prefix}}_real_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_real_ord_ore +--! @param b public.{{prefix}}_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_real_ord_ore) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ore. ---! @param a public.eql_v3_real_ord_ore ---! @param b public.eql_v3_real_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. +--! @param a public.{{prefix}}_real_ord_ore +--! @param b public.{{prefix}}_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_real_ord_ore, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_ord_ore, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ore. ---! @param a public.eql_v3_real_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. +--! @param a public.{{prefix}}_real_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_real_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b::public.eql_v3_real_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{prefix}}_real_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_real_ord_ore +--! @param b public.{{prefix}}_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_real_ord_ore) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ore. ---! @param a public.eql_v3_real_ord_ore ---! @param b public.eql_v3_real_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. +--! @param a public.{{prefix}}_real_ord_ore +--! @param b public.{{prefix}}_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_real_ord_ore, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_real_ord_ore, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ore. ---! @param a public.eql_v3_real_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. +--! @param a public.{{prefix}}_real_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_real_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_real_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b::public.eql_v3_real_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_real_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_real_ord_ore +--! @param b public.{{prefix}}_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_real_ord_ore) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ore. ---! @param a public.eql_v3_real_ord_ore ---! @param b public.eql_v3_real_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. +--! @param a public.{{prefix}}_real_ord_ore +--! @param b public.{{prefix}}_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_real_ord_ore, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_real_ord_ore, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ore. ---! @param a public.eql_v3_real_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. +--! @param a public.{{prefix}}_real_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_real_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_real_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b::public.eql_v3_real_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_real_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_real_ord_ore +--! @param b public.{{prefix}}_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_real_ord_ore) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ore. ---! @param a public.eql_v3_real_ord_ore ---! @param b public.eql_v3_real_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. +--! @param a public.{{prefix}}_real_ord_ore +--! @param b public.{{prefix}}_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_real_ord_ore, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_real_ord_ore, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ore. ---! @param a public.eql_v3_real_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. +--! @param a public.{{prefix}}_real_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_real_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_real_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b::public.eql_v3_real_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_real_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_real_ord_ore +--! @param b public.{{prefix}}_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_real_ord_ore) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ore. ---! @param a public.eql_v3_real_ord_ore ---! @param b public.eql_v3_real_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. +--! @param a public.{{prefix}}_real_ord_ore +--! @param b public.{{prefix}}_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_real_ord_ore, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_real_ord_ore, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ore. ---! @param a public.eql_v3_real_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. +--! @param a public.{{prefix}}_real_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_real_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_real_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b::public.eql_v3_real_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_real_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_real_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_real_ord_ore +--! @param b public.{{prefix}}_real_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_real_ord_ore) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_real_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_real_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_real_ord_ore, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_real_ord_ore, b public.{{prefix}}_real_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_real_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_real_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_real_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_real_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_real_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_real_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_real_ord_ore, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_real_ord_ore, b public.{{prefix}}_real_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_real_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_real_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_real_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_real_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_real_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_real_ord_ore, selector text) -RETURNS public.eql_v3_real_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_real_ord_ore'; END; $$ +--! @return public.{{prefix}}_real_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_real_ord_ore, selector text) +RETURNS public.{{prefix}}_real_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_real_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_real_ord_ore, selector integer) -RETURNS public.eql_v3_real_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_real_ord_ore'; END; $$ +--! @return public.{{prefix}}_real_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_real_ord_ore, selector integer) +RETURNS public.{{prefix}}_real_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_real_ord_ore right operand of the blocked operator ---! @return public.eql_v3_real_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_real_ord_ore) -RETURNS public.eql_v3_real_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_real_ord_ore'; END; $$ +--! @param selector public.{{prefix}}_real_ord_ore right operand of the blocked operator +--! @return public.{{prefix}}_real_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_real_ord_ore) +RETURNS public.{{prefix}}_real_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_real_ord_ore, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_real_ord_ore, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_real_ord_ore, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_real_ord_ore, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_real_ord_ore right operand of the blocked operator +--! @param selector public.{{prefix}}_real_ord_ore right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_real_ord_ore) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_real_ord_ore, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_real_ord_ore, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_real_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_real_ord_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_real_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_real_ord_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_real_ord_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_real_ord_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_real_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_real_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_real_ord_ore, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_real_ord_ore, b public.{{prefix}}_real_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_real_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_real_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_real_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_real_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_real_ord_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_real_ord_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_real_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_real_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_real_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_real_ord_ore, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_real_ord_ore, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_real_ord_ore, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_real_ord_ore, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_real_ord_ore, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_real_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_real_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_real_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_real_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_real_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_real_ord_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_real_ord_ore, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_real_ord_ore, b public.{{prefix}}_real_ord_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_real_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_real_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_real_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_real_ord_ore, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_real_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_real_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_real_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_real_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_real_ord_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_real_ord_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_real_ord_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_real_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_real_ord_ore'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/real/real_ord_ore_operators.sql b/packages/eql/src/v3/scalars/real/real_ord_ore_operators.sql index bb5fb6d9e..5702adba4 100644 --- a/packages/eql/src/v3/scalars/real/real_ord_ore_operators.sql +++ b/packages/eql/src/v3/scalars/real/real_ord_ore_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/real/real_ord_ore_functions.sql --! @file encrypted_domain/real/real_ord_ore_operators.sql ---! @brief Operators for public.eql_v3_real_ord_ore. +--! @brief Operators for public.{{prefix}}_real_ord_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = public.eql_v3_real_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = public.eql_v3_real_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = public.eql_v3_real_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = public.eql_v3_real_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = public.eql_v3_real_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = public.eql_v3_real_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = public.eql_v3_real_ord_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ore ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = public.eql_v3_real_ord_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ore ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ore + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ore ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ore + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ore ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = public.eql_v3_real_ord_ore + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ore ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ore + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ore ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = public.eql_v3_real_ord_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ore ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_real_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_real_ord_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_real_ord_ore ); diff --git a/packages/eql/src/v3/scalars/real/real_types.sql b/packages/eql/src/v3/scalars/real/real_types.sql index 94087d16d..186fe4d4f 100644 --- a/packages/eql/src/v3/scalars/real/real_types.sql +++ b/packages/eql/src/v3/scalars/real/real_types.sql @@ -6,47 +6,47 @@ DO $$ BEGIN - --! @brief Encrypted domain public.eql_v3_real. + --! @brief Encrypted domain public.{{prefix}}_real. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_real' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_real' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_real AS jsonb + CREATE DOMAIN public.{{prefix}}_real AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_real IS 'EQL encrypted real (storage only)'; + COMMENT ON DOMAIN public.{{prefix}}_real IS 'EQL encrypted real (storage only)'; - --! @brief Encrypted domain public.eql_v3_real_eq. + --! @brief Encrypted domain public.{{prefix}}_real_eq. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_real_eq' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_real_eq' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_real_eq AS jsonb + CREATE DOMAIN public.{{prefix}}_real_eq AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'hm' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_real_eq IS 'EQL encrypted real (equality)'; + COMMENT ON DOMAIN public.{{prefix}}_real_eq IS 'EQL encrypted real (equality)'; - --! @brief Encrypted domain public.eql_v3_real_ord_ore. + --! @brief Encrypted domain public.{{prefix}}_real_ord_ore. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_real_ord_ore' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_real_ord_ore' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_real_ord_ore AS jsonb + CREATE DOMAIN public.{{prefix}}_real_ord_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -55,46 +55,46 @@ BEGIN AND VALUE ? 'ob' AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_real_ord_ore IS 'EQL encrypted real (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_real_ord_ore IS 'EQL encrypted real (equality, ordering)'; - --! @brief Encrypted domain public.eql_v3_real_ord. + --! @brief Encrypted domain public.{{prefix}}_real_ord. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_real_ord' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_real_ord' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_real_ord AS jsonb + CREATE DOMAIN public.{{prefix}}_real_ord AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'op' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_real_ord IS 'EQL encrypted real (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_real_ord IS 'EQL encrypted real (equality, ordering)'; - --! @brief Encrypted domain public.eql_v3_real_ord_ope. + --! @brief Encrypted domain public.{{prefix}}_real_ord_ope. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_real_ord_ope' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_real_ord_ope' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_real_ord_ope AS jsonb + CREATE DOMAIN public.{{prefix}}_real_ord_ope AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'op' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_real_ord_ope IS 'EQL encrypted real (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_real_ord_ope IS 'EQL encrypted real (equality, ordering)'; END $$; diff --git a/packages/eql/src/v3/scalars/smallint/json_entry_smallint_functions.sql b/packages/eql/src/v3/scalars/smallint/json_entry_smallint_functions.sql index 6d6a55848..44fd8e299 100644 --- a/packages/eql/src/v3/scalars/smallint/json_entry_smallint_functions.sql +++ b/packages/eql/src/v3/scalars/smallint/json_entry_smallint_functions.sql @@ -7,244 +7,244 @@ -- REQUIRE: src/v3/scalars/smallint/query_smallint_ord_ope_functions.sql --! @file encrypted_domain/smallint/json_entry_smallint_functions.sql ---! @brief Functions for public.eql_v3_json_entry. +--! @brief Functions for public.{{prefix}}_json_entry. ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_smallint_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_smallint_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json_entry, b eql_v3.query_smallint_ord) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json_entry, b {{prefix}}.query_smallint_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_smallint_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_smallint_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a eql_v3.query_smallint_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_smallint_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_smallint_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json_entry, b eql_v3.query_smallint_ord) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json_entry, b {{prefix}}.query_smallint_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_smallint_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_smallint_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a eql_v3.query_smallint_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_smallint_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_json_entry, b eql_v3.query_smallint_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_smallint_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_smallint_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_smallint_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_smallint_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_json_entry, b eql_v3.query_smallint_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_smallint_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_smallint_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_smallint_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_smallint_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_json_entry, b eql_v3.query_smallint_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_smallint_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_smallint_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_smallint_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_smallint_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_json_entry, b eql_v3.query_smallint_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_smallint_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_smallint_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_smallint_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_smallint_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_smallint_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json_entry, b eql_v3.query_smallint_ord_ope) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json_entry, b {{prefix}}.query_smallint_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_smallint_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_smallint_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a eql_v3.query_smallint_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_smallint_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_smallint_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json_entry, b eql_v3.query_smallint_ord_ope) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json_entry, b {{prefix}}.query_smallint_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_smallint_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_smallint_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a eql_v3.query_smallint_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_smallint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_json_entry, b eql_v3.query_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_smallint_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_smallint_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_smallint_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_smallint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_json_entry, b eql_v3.query_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_smallint_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_smallint_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_smallint_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_smallint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_json_entry, b eql_v3.query_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_smallint_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_smallint_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_smallint_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_smallint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_json_entry, b eql_v3.query_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_smallint_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_smallint_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_smallint_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/smallint/json_entry_smallint_operators.sql b/packages/eql/src/v3/scalars/smallint/json_entry_smallint_operators.sql index 3ccb0894d..81ba7ff66 100644 --- a/packages/eql/src/v3/scalars/smallint/json_entry_smallint_operators.sql +++ b/packages/eql/src/v3/scalars/smallint/json_entry_smallint_operators.sql @@ -5,140 +5,140 @@ -- REQUIRE: src/v3/scalars/smallint/json_entry_smallint_functions.sql --! @file encrypted_domain/smallint/json_entry_smallint_operators.sql ---! @brief Operators for public.eql_v3_json_entry. +--! @brief Operators for public.{{prefix}}_json_entry. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_smallint_ord + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_smallint_ord ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = eql_v3.query_smallint_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_smallint_ord + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_smallint_ord ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = eql_v3.query_smallint_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_smallint_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_smallint_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_smallint_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_smallint_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_smallint_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_smallint_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_smallint_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_smallint_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_smallint_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_smallint_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_smallint_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_smallint_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_smallint_ord_ope + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_smallint_ord_ope ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = eql_v3.query_smallint_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_smallint_ord_ope + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_smallint_ord_ope ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = eql_v3.query_smallint_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_smallint_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_smallint_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_smallint_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_smallint_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_smallint_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_smallint_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_smallint_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_smallint_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_smallint_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_smallint_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_smallint_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_smallint_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/smallint/query_smallint_eq_functions.sql b/packages/eql/src/v3/scalars/smallint/query_smallint_eq_functions.sql index b41e5b564..15357ca4a 100644 --- a/packages/eql/src/v3/scalars/smallint/query_smallint_eq_functions.sql +++ b/packages/eql/src/v3/scalars/smallint/query_smallint_eq_functions.sql @@ -4,44 +4,44 @@ -- REQUIRE: src/v3/scalars/smallint/smallint_eq_functions.sql --! @file encrypted_domain/smallint/query_smallint_eq_functions.sql ---! @brief Functions for eql_v3.query_smallint_eq. +--! @brief Functions for {{prefix}}.query_smallint_eq. ---! @brief Index extractor for eql_v3.query_smallint_eq. ---! @param a eql_v3.query_smallint_eq ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a eql_v3.query_smallint_eq) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for {{prefix}}.query_smallint_eq. +--! @param a {{prefix}}.query_smallint_eq +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a {{prefix}}.query_smallint_eq) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_eq. ---! @param a public.eql_v3_smallint_eq ---! @param b eql_v3.query_smallint_eq +--! @brief Operator wrapper for {{prefix}}.query_smallint_eq. +--! @param a public.{{prefix}}_smallint_eq +--! @param b {{prefix}}.query_smallint_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_smallint_eq, b eql_v3.query_smallint_eq) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_eq, b {{prefix}}.query_smallint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_eq. ---! @param a eql_v3.query_smallint_eq ---! @param b public.eql_v3_smallint_eq +--! @brief Operator wrapper for {{prefix}}.query_smallint_eq. +--! @param a {{prefix}}.query_smallint_eq +--! @param b public.{{prefix}}_smallint_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_smallint_eq, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_smallint_eq, b public.{{prefix}}_smallint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_eq. ---! @param a public.eql_v3_smallint_eq ---! @param b eql_v3.query_smallint_eq +--! @brief Operator wrapper for {{prefix}}.query_smallint_eq. +--! @param a public.{{prefix}}_smallint_eq +--! @param b {{prefix}}.query_smallint_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_smallint_eq, b eql_v3.query_smallint_eq) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_eq, b {{prefix}}.query_smallint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_eq. ---! @param a eql_v3.query_smallint_eq ---! @param b public.eql_v3_smallint_eq +--! @brief Operator wrapper for {{prefix}}.query_smallint_eq. +--! @param a {{prefix}}.query_smallint_eq +--! @param b public.{{prefix}}_smallint_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_smallint_eq, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_smallint_eq, b public.{{prefix}}_smallint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; diff --git a/packages/eql/src/v3/scalars/smallint/query_smallint_eq_operators.sql b/packages/eql/src/v3/scalars/smallint/query_smallint_eq_operators.sql index c85625f7b..1d91a489c 100644 --- a/packages/eql/src/v3/scalars/smallint/query_smallint_eq_operators.sql +++ b/packages/eql/src/v3/scalars/smallint/query_smallint_eq_operators.sql @@ -4,28 +4,28 @@ -- REQUIRE: src/v3/scalars/smallint/query_smallint_eq_functions.sql --! @file encrypted_domain/smallint/query_smallint_eq_operators.sql ---! @brief Operators for eql_v3.query_smallint_eq. +--! @brief Operators for {{prefix}}.query_smallint_eq. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = eql_v3.query_smallint_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = {{prefix}}.query_smallint_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_smallint_eq, RIGHTARG = public.eql_v3_smallint_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_smallint_eq, RIGHTARG = public.{{prefix}}_smallint_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = eql_v3.query_smallint_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = {{prefix}}.query_smallint_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_smallint_eq, RIGHTARG = public.eql_v3_smallint_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_smallint_eq, RIGHTARG = public.{{prefix}}_smallint_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); diff --git a/packages/eql/src/v3/scalars/smallint/query_smallint_ord_functions.sql b/packages/eql/src/v3/scalars/smallint/query_smallint_ord_functions.sql index 21a1d8f7c..59d9eda07 100644 --- a/packages/eql/src/v3/scalars/smallint/query_smallint_ord_functions.sql +++ b/packages/eql/src/v3/scalars/smallint/query_smallint_ord_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/smallint/smallint_ord_functions.sql --! @file encrypted_domain/smallint/query_smallint_ord_functions.sql ---! @brief Functions for eql_v3.query_smallint_ord. +--! @brief Functions for {{prefix}}.query_smallint_ord. ---! @brief Index extractor for eql_v3.query_smallint_ord. ---! @param a eql_v3.query_smallint_ord ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a eql_v3.query_smallint_ord) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for {{prefix}}.query_smallint_ord. +--! @param a {{prefix}}.query_smallint_ord +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a {{prefix}}.query_smallint_ord) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord. ---! @param a public.eql_v3_smallint_ord ---! @param b eql_v3.query_smallint_ord +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord. +--! @param a public.{{prefix}}_smallint_ord +--! @param b {{prefix}}.query_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_smallint_ord, b eql_v3.query_smallint_ord) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord. ---! @param a eql_v3.query_smallint_ord ---! @param b public.eql_v3_smallint_ord +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord. +--! @param a {{prefix}}.query_smallint_ord +--! @param b public.{{prefix}}_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_smallint_ord, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord. ---! @param a public.eql_v3_smallint_ord ---! @param b eql_v3.query_smallint_ord +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord. +--! @param a public.{{prefix}}_smallint_ord +--! @param b {{prefix}}.query_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_smallint_ord, b eql_v3.query_smallint_ord) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord. ---! @param a eql_v3.query_smallint_ord ---! @param b public.eql_v3_smallint_ord +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord. +--! @param a {{prefix}}.query_smallint_ord +--! @param b public.{{prefix}}_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_smallint_ord, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord. ---! @param a public.eql_v3_smallint_ord ---! @param b eql_v3.query_smallint_ord +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord. +--! @param a public.{{prefix}}_smallint_ord +--! @param b {{prefix}}.query_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_smallint_ord, b eql_v3.query_smallint_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord. ---! @param a eql_v3.query_smallint_ord ---! @param b public.eql_v3_smallint_ord +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord. +--! @param a {{prefix}}.query_smallint_ord +--! @param b public.{{prefix}}_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_smallint_ord, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord. ---! @param a public.eql_v3_smallint_ord ---! @param b eql_v3.query_smallint_ord +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord. +--! @param a public.{{prefix}}_smallint_ord +--! @param b {{prefix}}.query_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_smallint_ord, b eql_v3.query_smallint_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord. ---! @param a eql_v3.query_smallint_ord ---! @param b public.eql_v3_smallint_ord +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord. +--! @param a {{prefix}}.query_smallint_ord +--! @param b public.{{prefix}}_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_smallint_ord, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord. ---! @param a public.eql_v3_smallint_ord ---! @param b eql_v3.query_smallint_ord +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord. +--! @param a public.{{prefix}}_smallint_ord +--! @param b {{prefix}}.query_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_smallint_ord, b eql_v3.query_smallint_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord. ---! @param a eql_v3.query_smallint_ord ---! @param b public.eql_v3_smallint_ord +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord. +--! @param a {{prefix}}.query_smallint_ord +--! @param b public.{{prefix}}_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_smallint_ord, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord. ---! @param a public.eql_v3_smallint_ord ---! @param b eql_v3.query_smallint_ord +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord. +--! @param a public.{{prefix}}_smallint_ord +--! @param b {{prefix}}.query_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_smallint_ord, b eql_v3.query_smallint_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord. ---! @param a eql_v3.query_smallint_ord ---! @param b public.eql_v3_smallint_ord +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord. +--! @param a {{prefix}}.query_smallint_ord +--! @param b public.{{prefix}}_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_smallint_ord, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/smallint/query_smallint_ord_ope_functions.sql b/packages/eql/src/v3/scalars/smallint/query_smallint_ord_ope_functions.sql index 00dc12361..0b14e0831 100644 --- a/packages/eql/src/v3/scalars/smallint/query_smallint_ord_ope_functions.sql +++ b/packages/eql/src/v3/scalars/smallint/query_smallint_ord_ope_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/smallint/smallint_ord_ope_functions.sql --! @file encrypted_domain/smallint/query_smallint_ord_ope_functions.sql ---! @brief Functions for eql_v3.query_smallint_ord_ope. +--! @brief Functions for {{prefix}}.query_smallint_ord_ope. ---! @brief Index extractor for eql_v3.query_smallint_ord_ope. ---! @param a eql_v3.query_smallint_ord_ope ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a eql_v3.query_smallint_ord_ope) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for {{prefix}}.query_smallint_ord_ope. +--! @param a {{prefix}}.query_smallint_ord_ope +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a {{prefix}}.query_smallint_ord_ope) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ope. ---! @param a public.eql_v3_smallint_ord_ope ---! @param b eql_v3.query_smallint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. +--! @param a public.{{prefix}}_smallint_ord_ope +--! @param b {{prefix}}.query_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_smallint_ord_ope, b eql_v3.query_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ope. ---! @param a eql_v3.query_smallint_ord_ope ---! @param b public.eql_v3_smallint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. +--! @param a {{prefix}}.query_smallint_ord_ope +--! @param b public.{{prefix}}_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_smallint_ord_ope, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ope. ---! @param a public.eql_v3_smallint_ord_ope ---! @param b eql_v3.query_smallint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. +--! @param a public.{{prefix}}_smallint_ord_ope +--! @param b {{prefix}}.query_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_smallint_ord_ope, b eql_v3.query_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ope. ---! @param a eql_v3.query_smallint_ord_ope ---! @param b public.eql_v3_smallint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. +--! @param a {{prefix}}.query_smallint_ord_ope +--! @param b public.{{prefix}}_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_smallint_ord_ope, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ope. ---! @param a public.eql_v3_smallint_ord_ope ---! @param b eql_v3.query_smallint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. +--! @param a public.{{prefix}}_smallint_ord_ope +--! @param b {{prefix}}.query_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_smallint_ord_ope, b eql_v3.query_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ope. ---! @param a eql_v3.query_smallint_ord_ope ---! @param b public.eql_v3_smallint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. +--! @param a {{prefix}}.query_smallint_ord_ope +--! @param b public.{{prefix}}_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_smallint_ord_ope, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ope. ---! @param a public.eql_v3_smallint_ord_ope ---! @param b eql_v3.query_smallint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. +--! @param a public.{{prefix}}_smallint_ord_ope +--! @param b {{prefix}}.query_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_smallint_ord_ope, b eql_v3.query_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ope. ---! @param a eql_v3.query_smallint_ord_ope ---! @param b public.eql_v3_smallint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. +--! @param a {{prefix}}.query_smallint_ord_ope +--! @param b public.{{prefix}}_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_smallint_ord_ope, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ope. ---! @param a public.eql_v3_smallint_ord_ope ---! @param b eql_v3.query_smallint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. +--! @param a public.{{prefix}}_smallint_ord_ope +--! @param b {{prefix}}.query_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_smallint_ord_ope, b eql_v3.query_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ope. ---! @param a eql_v3.query_smallint_ord_ope ---! @param b public.eql_v3_smallint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. +--! @param a {{prefix}}.query_smallint_ord_ope +--! @param b public.{{prefix}}_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_smallint_ord_ope, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ope. ---! @param a public.eql_v3_smallint_ord_ope ---! @param b eql_v3.query_smallint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. +--! @param a public.{{prefix}}_smallint_ord_ope +--! @param b {{prefix}}.query_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_smallint_ord_ope, b eql_v3.query_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ope. ---! @param a eql_v3.query_smallint_ord_ope ---! @param b public.eql_v3_smallint_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. +--! @param a {{prefix}}.query_smallint_ord_ope +--! @param b public.{{prefix}}_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_smallint_ord_ope, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/smallint/query_smallint_ord_ope_operators.sql b/packages/eql/src/v3/scalars/smallint/query_smallint_ord_ope_operators.sql index 1b8480f2e..0f37d5b4e 100644 --- a/packages/eql/src/v3/scalars/smallint/query_smallint_ord_ope_operators.sql +++ b/packages/eql/src/v3/scalars/smallint/query_smallint_ord_ope_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/smallint/query_smallint_ord_ope_functions.sql --! @file encrypted_domain/smallint/query_smallint_ord_ope_operators.sql ---! @brief Operators for eql_v3.query_smallint_ord_ope. +--! @brief Operators for {{prefix}}.query_smallint_ord_ope. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = eql_v3.query_smallint_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_smallint_ord_ope, RIGHTARG = public.eql_v3_smallint_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = eql_v3.query_smallint_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_smallint_ord_ope, RIGHTARG = public.eql_v3_smallint_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = eql_v3.query_smallint_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_smallint_ord_ope, RIGHTARG = public.eql_v3_smallint_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = eql_v3.query_smallint_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_smallint_ord_ope, RIGHTARG = public.eql_v3_smallint_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = eql_v3.query_smallint_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_smallint_ord_ope, RIGHTARG = public.eql_v3_smallint_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = eql_v3.query_smallint_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_smallint_ord_ope, RIGHTARG = public.eql_v3_smallint_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/smallint/query_smallint_ord_operators.sql b/packages/eql/src/v3/scalars/smallint/query_smallint_ord_operators.sql index 5f66128fc..73dc194f7 100644 --- a/packages/eql/src/v3/scalars/smallint/query_smallint_ord_operators.sql +++ b/packages/eql/src/v3/scalars/smallint/query_smallint_ord_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/smallint/query_smallint_ord_functions.sql --! @file encrypted_domain/smallint/query_smallint_ord_operators.sql ---! @brief Operators for eql_v3.query_smallint_ord. +--! @brief Operators for {{prefix}}.query_smallint_ord. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = eql_v3.query_smallint_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_smallint_ord, RIGHTARG = public.eql_v3_smallint_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = eql_v3.query_smallint_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_smallint_ord, RIGHTARG = public.eql_v3_smallint_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = eql_v3.query_smallint_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_smallint_ord, RIGHTARG = public.eql_v3_smallint_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = eql_v3.query_smallint_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_smallint_ord, RIGHTARG = public.eql_v3_smallint_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = eql_v3.query_smallint_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_smallint_ord, RIGHTARG = public.eql_v3_smallint_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = eql_v3.query_smallint_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_smallint_ord, RIGHTARG = public.eql_v3_smallint_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/smallint/query_smallint_ord_ore_functions.sql b/packages/eql/src/v3/scalars/smallint/query_smallint_ord_ore_functions.sql index b85135a3c..8d898cf4a 100644 --- a/packages/eql/src/v3/scalars/smallint/query_smallint_ord_ore_functions.sql +++ b/packages/eql/src/v3/scalars/smallint/query_smallint_ord_ore_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/smallint/smallint_ord_ore_functions.sql --! @file encrypted_domain/smallint/query_smallint_ord_ore_functions.sql ---! @brief Functions for eql_v3.query_smallint_ord_ore. +--! @brief Functions for {{prefix}}.query_smallint_ord_ore. ---! @brief Index extractor for eql_v3.query_smallint_ord_ore. ---! @param a eql_v3.query_smallint_ord_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a eql_v3.query_smallint_ord_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for {{prefix}}.query_smallint_ord_ore. +--! @param a {{prefix}}.query_smallint_ord_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a {{prefix}}.query_smallint_ord_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ore. ---! @param a public.eql_v3_smallint_ord_ore ---! @param b eql_v3.query_smallint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. +--! @param a public.{{prefix}}_smallint_ord_ore +--! @param b {{prefix}}.query_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_smallint_ord_ore, b eql_v3.query_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ore. ---! @param a eql_v3.query_smallint_ord_ore ---! @param b public.eql_v3_smallint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. +--! @param a {{prefix}}.query_smallint_ord_ore +--! @param b public.{{prefix}}_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_smallint_ord_ore, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ore. ---! @param a public.eql_v3_smallint_ord_ore ---! @param b eql_v3.query_smallint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. +--! @param a public.{{prefix}}_smallint_ord_ore +--! @param b {{prefix}}.query_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_smallint_ord_ore, b eql_v3.query_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ore. ---! @param a eql_v3.query_smallint_ord_ore ---! @param b public.eql_v3_smallint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. +--! @param a {{prefix}}.query_smallint_ord_ore +--! @param b public.{{prefix}}_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_smallint_ord_ore, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ore. ---! @param a public.eql_v3_smallint_ord_ore ---! @param b eql_v3.query_smallint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. +--! @param a public.{{prefix}}_smallint_ord_ore +--! @param b {{prefix}}.query_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_smallint_ord_ore, b eql_v3.query_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ore. ---! @param a eql_v3.query_smallint_ord_ore ---! @param b public.eql_v3_smallint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. +--! @param a {{prefix}}.query_smallint_ord_ore +--! @param b public.{{prefix}}_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_smallint_ord_ore, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ore. ---! @param a public.eql_v3_smallint_ord_ore ---! @param b eql_v3.query_smallint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. +--! @param a public.{{prefix}}_smallint_ord_ore +--! @param b {{prefix}}.query_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_smallint_ord_ore, b eql_v3.query_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ore. ---! @param a eql_v3.query_smallint_ord_ore ---! @param b public.eql_v3_smallint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. +--! @param a {{prefix}}.query_smallint_ord_ore +--! @param b public.{{prefix}}_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_smallint_ord_ore, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ore. ---! @param a public.eql_v3_smallint_ord_ore ---! @param b eql_v3.query_smallint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. +--! @param a public.{{prefix}}_smallint_ord_ore +--! @param b {{prefix}}.query_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_smallint_ord_ore, b eql_v3.query_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ore. ---! @param a eql_v3.query_smallint_ord_ore ---! @param b public.eql_v3_smallint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. +--! @param a {{prefix}}.query_smallint_ord_ore +--! @param b public.{{prefix}}_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_smallint_ord_ore, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ore. ---! @param a public.eql_v3_smallint_ord_ore ---! @param b eql_v3.query_smallint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. +--! @param a public.{{prefix}}_smallint_ord_ore +--! @param b {{prefix}}.query_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_smallint_ord_ore, b eql_v3.query_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_smallint_ord_ore. ---! @param a eql_v3.query_smallint_ord_ore ---! @param b public.eql_v3_smallint_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. +--! @param a {{prefix}}.query_smallint_ord_ore +--! @param b public.{{prefix}}_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_smallint_ord_ore, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; diff --git a/packages/eql/src/v3/scalars/smallint/query_smallint_ord_ore_operators.sql b/packages/eql/src/v3/scalars/smallint/query_smallint_ord_ore_operators.sql index d71111770..85bccdbf8 100644 --- a/packages/eql/src/v3/scalars/smallint/query_smallint_ord_ore_operators.sql +++ b/packages/eql/src/v3/scalars/smallint/query_smallint_ord_ore_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/smallint/query_smallint_ord_ore_functions.sql --! @file encrypted_domain/smallint/query_smallint_ord_ore_operators.sql ---! @brief Operators for eql_v3.query_smallint_ord_ore. +--! @brief Operators for {{prefix}}.query_smallint_ord_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = eql_v3.query_smallint_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_smallint_ord_ore, RIGHTARG = public.eql_v3_smallint_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = eql_v3.query_smallint_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_smallint_ord_ore, RIGHTARG = public.eql_v3_smallint_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = eql_v3.query_smallint_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_smallint_ord_ore, RIGHTARG = public.eql_v3_smallint_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = eql_v3.query_smallint_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_smallint_ord_ore, RIGHTARG = public.eql_v3_smallint_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = eql_v3.query_smallint_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_smallint_ord_ore, RIGHTARG = public.eql_v3_smallint_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = eql_v3.query_smallint_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_smallint_ord_ore, RIGHTARG = public.eql_v3_smallint_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/smallint/query_smallint_range_functions.sql b/packages/eql/src/v3/scalars/smallint/query_smallint_range_functions.sql new file mode 100644 index 000000000..2ec4f1809 --- /dev/null +++ b/packages/eql/src/v3/scalars/smallint/query_smallint_range_functions.sql @@ -0,0 +1,177 @@ +-- AUTOMATICALLY GENERATED FILE. +-- ONLY EQL VERSION: 4 +-- REQUIRE: src/v3/schema.sql +-- REQUIRE: src/v3/scalars/smallint/query_smallint_range_types.sql +-- REQUIRE: src/v3/scalars/smallint/smallint_ord_ore_functions.sql +-- REQUIRE: src/v3/scalars/smallint/smallint_ord_functions.sql +-- REQUIRE: src/v3/scalars/smallint/smallint_ord_ope_functions.sql +-- REQUIRE: src/v3/sem/ore_block_256/functions.sql +-- REQUIRE: src/v3/sem/ore_block_256/operators.sql +-- REQUIRE: src/v3/sem/ope_cllw/functions.sql + +--! @file v3/scalars/smallint/query_smallint_range_functions.sql +--! @brief The bound accessors and `{{prefix}}.between` for smallint's range query domains. +--! @note EQL version {{eql_version}} only, like the range domains themselves. + +--! @brief The low bound of a {{prefix}}.query_smallint_range_ore, as a block ORE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_smallint_range_ore Range query operand +--! @return {{prefix}}_internal.ore_block_256 The low bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.lo(r {{prefix}}.query_smallint_range_ore) +RETURNS {{prefix}}_internal.ore_block_256 +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ore_block_256(jsonb_build_object('ob', r::jsonb -> 'lo')) $$; + +--! @brief The high bound of a {{prefix}}.query_smallint_range_ore, as a block ORE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_smallint_range_ore Range query operand +--! @return {{prefix}}_internal.ore_block_256 The high bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.hi(r {{prefix}}.query_smallint_range_ore) +RETURNS {{prefix}}_internal.ore_block_256 +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ore_block_256(jsonb_build_object('ob', r::jsonb -> 'hi')) $$; + +--! @brief The low bound of a {{prefix}}.query_smallint_range_ope, as a CLLW OPE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_smallint_range_ope Range query operand +--! @return {{prefix}}_internal.ope_cllw The low bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.lo(r {{prefix}}.query_smallint_range_ope) +RETURNS {{prefix}}_internal.ope_cllw +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> 'lo')) $$; + +--! @brief The high bound of a {{prefix}}.query_smallint_range_ope, as a CLLW OPE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_smallint_range_ope Range query operand +--! @return {{prefix}}_internal.ope_cllw The high bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.hi(r {{prefix}}.query_smallint_range_ope) +RETURNS {{prefix}}_internal.ope_cllw +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> 'hi')) $$; + +--! @brief Whether a public.{{prefix}}_smallint_ord_ore value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_smallint_range_ore)`. +--! +--! @param a public.{{prefix}}_smallint_ord_ore Encrypted column value +--! @param r {{prefix}}.query_smallint_range_ore Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term_ore(a)`, which a btree index on that expression +--! serves as one range scan. For this ORE range that index needs the +--! default btree operator class on {{prefix}}_internal.ore_block_256, which the +--! installer creates only with superuser privileges. Without it (on Supabase, +--! for instance) the installer disables the ORE column domains and this ORE range, +--! so use an OPE column (`public.{{prefix}}_smallint_ord`, `public.{{prefix}}_smallint_ord_ope`) +--! and `{{prefix}}.query_smallint_range_ope`, which index everywhere. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_smallint_range_ore`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_smallint_ord_ore, r {{prefix}}.query_smallint_range_ore) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_smallint_ord value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_smallint_range_ope)`. +--! +--! @param a public.{{prefix}}_smallint_ord Encrypted column value +--! @param r {{prefix}}.query_smallint_range_ope Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term(a)`, which a btree index on that expression +--! serves as one range scan. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_smallint_range_ope`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_smallint_ord, r {{prefix}}.query_smallint_range_ope) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_smallint_ord_ope value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_smallint_range_ope)`. +--! +--! @param a public.{{prefix}}_smallint_ord_ope Encrypted column value +--! @param r {{prefix}}.query_smallint_range_ope Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term(a)`, which a btree index on that expression +--! serves as one range scan. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_smallint_range_ope`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_smallint_ord_ope, r {{prefix}}.query_smallint_range_ope) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r) $$; diff --git a/packages/eql/src/v3/scalars/smallint/query_smallint_range_types.sql b/packages/eql/src/v3/scalars/smallint/query_smallint_range_types.sql new file mode 100644 index 000000000..74ec90df4 --- /dev/null +++ b/packages/eql/src/v3/scalars/smallint/query_smallint_range_types.sql @@ -0,0 +1,107 @@ +-- AUTOMATICALLY GENERATED FILE. +-- ONLY EQL VERSION: 4 +-- REQUIRE: src/v3/schema.sql +-- REQUIRE: src/v3/scalars/ore_fallback.sql + +--! @file v3/scalars/smallint/query_smallint_range_types.sql +--! @brief Range query-operand domains for smallint: the operand of `{{prefix}}.between`. +--! @note A range holds both bounds of one `BETWEEN` as one value: +--! `{"v": {{eql_version}}, "i": {...}, "lo": , "hi": }`. Each bound is the +--! single-bound query domain's `ob` (ORE) or `op` (OPE) value, in a +--! `{v, i, lo, hi}` envelope. Both bounds are included. There is one +--! range domain per ordering term the family stores (ADR-0009, +--! decisions 7 and 8). +--! @note Cast the range parameter to its exact range domain +--! (`$1::{{prefix}}.query_smallint_range_ore`). An uncast `$1`, a `jsonb` +--! parameter, or a range of another term or family fails with 42725 +--! ("function ... is not unique"); see `{{prefix}}.between`. +--! @note EQL version {{eql_version}} only: the `-- ONLY EQL VERSION:` line above keeps this +--! file out of every other version's installer. +--! @note Like every query operand, a range lives in `{{prefix}}`, not `public`, +--! and holds no ciphertext `c`. A range whose low bound is above its +--! high bound matches no row, as with SQL `BETWEEN`; the SQL does not +--! reorder the bounds. +--! @note On an install without the ORE operator class (a non-superuser +--! install, on Supabase for instance), the ORE range domain is disabled +--! as the single-bound ORE domains are: a value cast to it raises +--! `feature_not_supported`, naming the OPE range. See +--! `v3/scalars/ore_fallback.sql`. + +DO $$ +BEGIN + --! @brief Range query-operand domain {{prefix}}.query_smallint_range_ore (two block ORE bounds; no `c`). + IF NOT EXISTS ( + SELECT 1 FROM pg_type + WHERE typname = 'query_smallint_range_ore' AND typnamespace = '{{prefix}}'::regnamespace + ) THEN + CREATE DOMAIN {{prefix}}.query_smallint_range_ore AS jsonb + CHECK ( + jsonb_typeof(VALUE) = 'object' + AND VALUE ? 'v' + AND VALUE ? 'i' + AND VALUE ? 'lo' + AND VALUE ? 'hi' + AND NOT (VALUE ? 'c') + AND jsonb_typeof(VALUE -> 'lo') = 'array' + AND jsonb_array_length(VALUE -> 'lo') > 0 + AND jsonb_typeof(VALUE -> 'hi') = 'array' + AND jsonb_array_length(VALUE -> 'hi') > 0 + -- `"v": null` makes the comparison NULL, and a CHECK that is NULL + -- passes, so COALESCE refuses it. A NULL range still passes (no row + -- matches it). The comparison keeps the one form the v4 isolation + -- gate accepts. + AND COALESCE(VALUE->>'v' = '{{eql_version}}', VALUE IS NULL) + ); + END IF; + + COMMENT ON DOMAIN {{prefix}}.query_smallint_range_ore IS 'EQL smallint range query operand (block ORE)'; + + --! @brief Range query-operand domain {{prefix}}.query_smallint_range_ope (two CLLW OPE bounds; no `c`). + IF NOT EXISTS ( + SELECT 1 FROM pg_type + WHERE typname = 'query_smallint_range_ope' AND typnamespace = '{{prefix}}'::regnamespace + ) THEN + CREATE DOMAIN {{prefix}}.query_smallint_range_ope AS jsonb + CHECK ( + jsonb_typeof(VALUE) = 'object' + AND VALUE ? 'v' + AND VALUE ? 'i' + AND VALUE ? 'lo' + AND VALUE ? 'hi' + AND NOT (VALUE ? 'c') + AND jsonb_typeof(VALUE -> 'lo') = 'string' + AND jsonb_typeof(VALUE -> 'hi') = 'string' + -- `"v": null` makes the comparison NULL, and a CHECK that is NULL + -- passes, so COALESCE refuses it. A NULL range still passes (no row + -- matches it). The comparison keeps the one form the v4 isolation + -- gate accepts. + AND COALESCE(VALUE->>'v' = '{{eql_version}}', VALUE IS NULL) + ); + END IF; + + COMMENT ON DOMAIN {{prefix}}.query_smallint_range_ope IS 'EQL smallint range query operand (CLLW OPE)'; +END +$$; + +-- Without the default btree operator class on {{prefix}}_internal.ore_block_256 +-- (the installer skips it on insufficient_privilege), ore_fallback.sql has +-- created {{prefix}}_internal.ore_domain_unavailable and poisoned the +-- single-bound ORE domains. It cannot reach this ORE range, which exists in +-- EQL v4 only, so the same NOT VALID poison CHECK is added here. +DO $do$ +BEGIN + IF EXISTS ( + SELECT 1 + FROM pg_catalog.pg_opclass c + JOIN pg_catalog.pg_am am ON am.oid = c.opcmethod + WHERE am.amname = 'btree' + AND c.opcdefault + AND c.opcintype = '{{prefix}}_internal.ore_block_256'::pg_catalog.regtype + ) THEN + RETURN; + END IF; + + ALTER DOMAIN {{prefix}}.query_smallint_range_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, '{{prefix}}.query_smallint_range_ore', '{{prefix}}.query_smallint_range_ope (range)')) NOT VALID; +END; +$do$; diff --git a/packages/eql/src/v3/scalars/smallint/query_smallint_types.sql b/packages/eql/src/v3/scalars/smallint/query_smallint_types.sql index d2c4a334a..382dc375f 100644 --- a/packages/eql/src/v3/scalars/smallint/query_smallint_types.sql +++ b/packages/eql/src/v3/scalars/smallint/query_smallint_types.sql @@ -3,41 +3,41 @@ --! @file v3/scalars/smallint/query_smallint_types.sql --! @brief Query-operand domains for smallint (index-terms-only, no ciphertext). ---! @note Query-operand domains live in `eql_v3` (not `public`): they are +--! @note Query-operand domains live in `{{prefix}}` (not `public`): they are --! never valid column types, so they don't belong in the column-type --! namespace, and dropping the EQL-owned schema can never drop an --! application column. --! @note Cast a query operand explicitly to its `query_` domain in a predicate ---! (e.g. `WHERE col = $1::eql_v3.query_smallint_eq`). A bare, +--! (e.g. `WHERE col = $1::{{prefix}}.query_smallint_eq`). A bare, --! uncast literal RHS is ambiguous between the `query_` and `jsonb` --! operator overloads and will not resolve. DO $$ BEGIN - --! @brief Query-operand domain eql_v3.query_smallint_eq (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_smallint_eq (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_smallint_eq' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_smallint_eq' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_smallint_eq AS jsonb + CREATE DOMAIN {{prefix}}.query_smallint_eq AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'hm' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_smallint_eq IS 'EQL smallint query operand (equality)'; + COMMENT ON DOMAIN {{prefix}}.query_smallint_eq IS 'EQL smallint query operand (equality)'; - --! @brief Query-operand domain eql_v3.query_smallint_ord_ore (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_smallint_ord_ore (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_smallint_ord_ore' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_smallint_ord_ore' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_smallint_ord_ore AS jsonb + CREATE DOMAIN {{prefix}}.query_smallint_ord_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -46,46 +46,46 @@ BEGIN AND NOT (VALUE ? 'c') AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_smallint_ord_ore IS 'EQL smallint query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_smallint_ord_ore IS 'EQL smallint query operand (equality, ordering)'; - --! @brief Query-operand domain eql_v3.query_smallint_ord (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_smallint_ord (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_smallint_ord' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_smallint_ord' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_smallint_ord AS jsonb + CREATE DOMAIN {{prefix}}.query_smallint_ord AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'op' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_smallint_ord IS 'EQL smallint query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_smallint_ord IS 'EQL smallint query operand (equality, ordering)'; - --! @brief Query-operand domain eql_v3.query_smallint_ord_ope (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_smallint_ord_ope (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_smallint_ord_ope' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_smallint_ord_ope' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_smallint_ord_ope AS jsonb + CREATE DOMAIN {{prefix}}.query_smallint_ord_ope AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'op' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_smallint_ord_ope IS 'EQL smallint query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_smallint_ord_ope IS 'EQL smallint query operand (equality, ordering)'; END $$; diff --git a/packages/eql/src/v3/scalars/smallint/smallint_eq_functions.sql b/packages/eql/src/v3/scalars/smallint/smallint_eq_functions.sql index 3721f5af3..ec5cf4911 100644 --- a/packages/eql/src/v3/scalars/smallint/smallint_eq_functions.sql +++ b/packages/eql/src/v3/scalars/smallint/smallint_eq_functions.sql @@ -5,634 +5,634 @@ -- REQUIRE: src/v3/sem/hmac_256/functions.sql --! @file encrypted_domain/smallint/smallint_eq_functions.sql ---! @brief Functions for public.eql_v3_smallint_eq. +--! @brief Functions for public.{{prefix}}_smallint_eq. ---! @brief Index extractor for public.eql_v3_smallint_eq. ---! @param a public.eql_v3_smallint_eq ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a public.eql_v3_smallint_eq) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for public.{{prefix}}_smallint_eq. +--! @param a public.{{prefix}}_smallint_eq +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a public.{{prefix}}_smallint_eq) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_eq. ---! @param a public.eql_v3_smallint_eq ---! @param b public.eql_v3_smallint_eq +--! @brief Operator wrapper for public.{{prefix}}_smallint_eq. +--! @param a public.{{prefix}}_smallint_eq +--! @param b public.{{prefix}}_smallint_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_smallint_eq, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_eq, b public.{{prefix}}_smallint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_eq. ---! @param a public.eql_v3_smallint_eq +--! @brief Operator wrapper for public.{{prefix}}_smallint_eq. +--! @param a public.{{prefix}}_smallint_eq --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_smallint_eq, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b::public.eql_v3_smallint_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_smallint_eq) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_eq. +--! @brief Operator wrapper for public.{{prefix}}_smallint_eq. --! @param a jsonb ---! @param b public.eql_v3_smallint_eq +--! @param b public.{{prefix}}_smallint_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_smallint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_smallint_eq) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_smallint_eq) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_eq. ---! @param a public.eql_v3_smallint_eq ---! @param b public.eql_v3_smallint_eq +--! @brief Operator wrapper for public.{{prefix}}_smallint_eq. +--! @param a public.{{prefix}}_smallint_eq +--! @param b public.{{prefix}}_smallint_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_smallint_eq, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_eq, b public.{{prefix}}_smallint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_eq. ---! @param a public.eql_v3_smallint_eq +--! @brief Operator wrapper for public.{{prefix}}_smallint_eq. +--! @param a public.{{prefix}}_smallint_eq --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_smallint_eq, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b::public.eql_v3_smallint_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_smallint_eq) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_eq. +--! @brief Operator wrapper for public.{{prefix}}_smallint_eq. --! @param a jsonb ---! @param b public.eql_v3_smallint_eq +--! @param b public.{{prefix}}_smallint_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_smallint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_smallint_eq) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_smallint_eq) <> {{prefix}}.eq_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator ---! @param b public.eql_v3_smallint_eq right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_smallint_eq, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_smallint_eq, b public.{{prefix}}_smallint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_smallint_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_smallint_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_eq right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_smallint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator ---! @param b public.eql_v3_smallint_eq right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_smallint_eq, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_smallint_eq, b public.{{prefix}}_smallint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_smallint_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_smallint_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_eq right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_smallint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator ---! @param b public.eql_v3_smallint_eq right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_smallint_eq, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_smallint_eq, b public.{{prefix}}_smallint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_smallint_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_smallint_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_eq right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_smallint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator ---! @param b public.eql_v3_smallint_eq right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_smallint_eq, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_smallint_eq, b public.{{prefix}}_smallint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_smallint_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_smallint_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_eq right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_smallint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator ---! @param b public.eql_v3_smallint_eq right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_smallint_eq, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_smallint_eq, b public.{{prefix}}_smallint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_smallint_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_smallint_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_eq right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_smallint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator ---! @param b public.eql_v3_smallint_eq right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_smallint_eq, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_smallint_eq, b public.{{prefix}}_smallint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_smallint_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_smallint_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_eq right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_smallint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_smallint_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_smallint_eq, selector text) -RETURNS public.eql_v3_smallint_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_smallint_eq'; END; $$ +--! @return public.{{prefix}}_smallint_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_smallint_eq, selector text) +RETURNS public.{{prefix}}_smallint_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_smallint_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_smallint_eq, selector integer) -RETURNS public.eql_v3_smallint_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_smallint_eq'; END; $$ +--! @return public.{{prefix}}_smallint_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_smallint_eq, selector integer) +RETURNS public.{{prefix}}_smallint_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_smallint_eq right operand of the blocked operator ---! @return public.eql_v3_smallint_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_smallint_eq) -RETURNS public.eql_v3_smallint_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_smallint_eq'; END; $$ +--! @param selector public.{{prefix}}_smallint_eq right operand of the blocked operator +--! @return public.{{prefix}}_smallint_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_smallint_eq) +RETURNS public.{{prefix}}_smallint_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_smallint_eq, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_smallint_eq, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_smallint_eq, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_smallint_eq, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_smallint_eq right operand of the blocked operator +--! @param selector public.{{prefix}}_smallint_eq right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_smallint_eq) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_smallint_eq, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_smallint_eq, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_smallint_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_smallint_eq, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_smallint_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_smallint_eq, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_smallint_eq, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_smallint_eq, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator ---! @param b public.eql_v3_smallint_eq right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_smallint_eq, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_smallint_eq, b public.{{prefix}}_smallint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_smallint_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_smallint_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_eq right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_smallint_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_smallint_eq, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_smallint_eq, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_smallint_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_smallint_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_smallint_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_smallint_eq, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_smallint_eq, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_smallint_eq, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_smallint_eq, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_smallint_eq, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_smallint_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_smallint_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_smallint_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_smallint_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator ---! @param b public.eql_v3_smallint_eq right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_eq right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_smallint_eq, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_smallint_eq, b public.{{prefix}}_smallint_eq) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_eq left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_smallint_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_smallint_eq, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_eq right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_eq right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_smallint_eq) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_smallint_eq) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_smallint_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_smallint_eq'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/smallint/smallint_eq_operators.sql b/packages/eql/src/v3/scalars/smallint/smallint_eq_operators.sql index d69ab9fa8..2cbc24904 100644 --- a/packages/eql/src/v3/scalars/smallint/smallint_eq_operators.sql +++ b/packages/eql/src/v3/scalars/smallint/smallint_eq_operators.sql @@ -4,245 +4,245 @@ -- REQUIRE: src/v3/scalars/smallint/smallint_eq_functions.sql --! @file encrypted_domain/smallint/smallint_eq_operators.sql ---! @brief Operators for public.eql_v3_smallint_eq. +--! @brief Operators for public.{{prefix}}_smallint_eq. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = public.eql_v3_smallint_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = public.{{prefix}}_smallint_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = public.eql_v3_smallint_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = public.{{prefix}}_smallint_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = public.eql_v3_smallint_eq + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = public.{{prefix}}_smallint_eq ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_eq + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_eq ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = public.eql_v3_smallint_eq + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = public.{{prefix}}_smallint_eq ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_eq + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_eq ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = public.eql_v3_smallint_eq + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = public.{{prefix}}_smallint_eq ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_eq + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_eq ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = public.eql_v3_smallint_eq + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = public.{{prefix}}_smallint_eq ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_eq + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_eq ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = public.eql_v3_smallint_eq + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = public.{{prefix}}_smallint_eq ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_eq + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_eq ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = public.eql_v3_smallint_eq + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = public.{{prefix}}_smallint_eq ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_eq + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_eq ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_eq + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_eq ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_eq + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_eq ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = public.eql_v3_smallint_eq + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = public.{{prefix}}_smallint_eq ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_eq + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_eq ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = public.eql_v3_smallint_eq + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = public.{{prefix}}_smallint_eq ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_smallint_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_eq + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_eq ); diff --git a/packages/eql/src/v3/scalars/smallint/smallint_functions.sql b/packages/eql/src/v3/scalars/smallint/smallint_functions.sql index 3423c9a39..9f6e5462f 100644 --- a/packages/eql/src/v3/scalars/smallint/smallint_functions.sql +++ b/packages/eql/src/v3/scalars/smallint/smallint_functions.sql @@ -4,662 +4,662 @@ -- REQUIRE: src/v3/scalars/functions.sql --! @file encrypted_domain/smallint/smallint_functions.sql ---! @brief Functions for public.eql_v3_smallint. +--! @brief Functions for public.{{prefix}}_smallint. ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_smallint, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_smallint, b public.{{prefix}}_smallint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_smallint, b jsonb) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_smallint, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a jsonb, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal.eq(a jsonb, b public.{{prefix}}_smallint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_smallint, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_smallint, b public.{{prefix}}_smallint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_smallint, b jsonb) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_smallint, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a jsonb, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal.neq(a jsonb, b public.{{prefix}}_smallint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_smallint, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_smallint, b public.{{prefix}}_smallint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_smallint, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_smallint, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_smallint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_smallint, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_smallint, b public.{{prefix}}_smallint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_smallint, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_smallint, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_smallint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_smallint, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_smallint, b public.{{prefix}}_smallint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_smallint, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_smallint, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_smallint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_smallint, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_smallint, b public.{{prefix}}_smallint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_smallint, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_smallint, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_smallint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_smallint, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_smallint, b public.{{prefix}}_smallint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_smallint, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_smallint, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_smallint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_smallint, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_smallint, b public.{{prefix}}_smallint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_smallint, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_smallint, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_smallint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_smallint never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_smallint, selector text) -RETURNS public.eql_v3_smallint IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_smallint'; END; $$ +--! @return public.{{prefix}}_smallint never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_smallint, selector text) +RETURNS public.{{prefix}}_smallint IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_smallint never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_smallint, selector integer) -RETURNS public.eql_v3_smallint IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_smallint'; END; $$ +--! @return public.{{prefix}}_smallint never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_smallint, selector integer) +RETURNS public.{{prefix}}_smallint IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_smallint right operand of the blocked operator ---! @return public.eql_v3_smallint never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_smallint) -RETURNS public.eql_v3_smallint IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_smallint'; END; $$ +--! @param selector public.{{prefix}}_smallint right operand of the blocked operator +--! @return public.{{prefix}}_smallint never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_smallint) +RETURNS public.{{prefix}}_smallint IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_smallint, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_smallint, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_smallint, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_smallint, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_smallint right operand of the blocked operator +--! @param selector public.{{prefix}}_smallint right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_smallint) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_smallint, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_smallint, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_smallint, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_smallint, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_smallint, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_smallint, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_smallint, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_smallint, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_smallint, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_smallint, b public.{{prefix}}_smallint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_smallint, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_smallint, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_smallint) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_smallint, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_smallint, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_smallint, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_smallint, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_smallint, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_smallint, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_smallint, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_smallint, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_smallint, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_smallint, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_smallint, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_smallint, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_smallint, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_smallint, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_smallint, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_smallint, b public.{{prefix}}_smallint) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint left operand of the blocked operator +--! @param a public.{{prefix}}_smallint left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_smallint, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_smallint, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint right operand of the blocked operator +--! @param b public.{{prefix}}_smallint right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_smallint) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_smallint) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_smallint'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_smallint'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/smallint/smallint_operators.sql b/packages/eql/src/v3/scalars/smallint/smallint_operators.sql index b249a6835..a05eb5038 100644 --- a/packages/eql/src/v3/scalars/smallint/smallint_operators.sql +++ b/packages/eql/src/v3/scalars/smallint/smallint_operators.sql @@ -4,239 +4,239 @@ -- REQUIRE: src/v3/scalars/smallint/smallint_functions.sql --! @file encrypted_domain/smallint/smallint_operators.sql ---! @brief Operators for public.eql_v3_smallint. +--! @brief Operators for public.{{prefix}}_smallint. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_smallint, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_smallint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = jsonb ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_smallint, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_smallint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = jsonb ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_smallint, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_smallint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_smallint, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_smallint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_smallint, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_smallint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_smallint, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_smallint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_smallint, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_smallint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_smallint, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_smallint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_smallint, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_smallint, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_smallint, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_smallint, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_smallint, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_smallint, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_smallint, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_smallint, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_smallint, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_smallint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_smallint, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_smallint, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_smallint, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_smallint, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_smallint, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_smallint, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_smallint, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_smallint, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = public.{{prefix}}_smallint ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_smallint, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_smallint, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint ); diff --git a/packages/eql/src/v3/scalars/smallint/smallint_ord_aggregates.sql b/packages/eql/src/v3/scalars/smallint/smallint_ord_aggregates.sql index d5b3b6bc3..b9806af5a 100644 --- a/packages/eql/src/v3/scalars/smallint/smallint_ord_aggregates.sql +++ b/packages/eql/src/v3/scalars/smallint/smallint_ord_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/smallint/smallint_ord_operators.sql --! @file encrypted_domain/smallint/smallint_ord_aggregates.sql ---! @brief Aggregates for public.eql_v3_smallint_ord. +--! @brief Aggregates for public.{{prefix}}_smallint_ord. ---! @brief State function for min on public.eql_v3_smallint_ord. ---! @param state public.eql_v3_smallint_ord ---! @param value public.eql_v3_smallint_ord ---! @return public.eql_v3_smallint_ord -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_smallint_ord, value public.eql_v3_smallint_ord) -RETURNS public.eql_v3_smallint_ord +--! @brief State function for min on public.{{prefix}}_smallint_ord. +--! @param state public.{{prefix}}_smallint_ord +--! @param value public.{{prefix}}_smallint_ord +--! @return public.{{prefix}}_smallint_ord +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_smallint_ord, value public.{{prefix}}_smallint_ord) +RETURNS public.{{prefix}}_smallint_ord LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_smallint_ord. ---! @param input public.eql_v3_smallint_ord ---! @return public.eql_v3_smallint_ord -CREATE AGGREGATE eql_v3.min(public.eql_v3_smallint_ord) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_smallint_ord, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_smallint_ord. +--! @param input public.{{prefix}}_smallint_ord +--! @return public.{{prefix}}_smallint_ord +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_smallint_ord) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_smallint_ord, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_smallint_ord. ---! @param state public.eql_v3_smallint_ord ---! @param value public.eql_v3_smallint_ord ---! @return public.eql_v3_smallint_ord -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_smallint_ord, value public.eql_v3_smallint_ord) -RETURNS public.eql_v3_smallint_ord +--! @brief State function for max on public.{{prefix}}_smallint_ord. +--! @param state public.{{prefix}}_smallint_ord +--! @param value public.{{prefix}}_smallint_ord +--! @return public.{{prefix}}_smallint_ord +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_smallint_ord, value public.{{prefix}}_smallint_ord) +RETURNS public.{{prefix}}_smallint_ord LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_smallint_ord. ---! @param input public.eql_v3_smallint_ord ---! @return public.eql_v3_smallint_ord -CREATE AGGREGATE eql_v3.max(public.eql_v3_smallint_ord) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_smallint_ord, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_smallint_ord. +--! @param input public.{{prefix}}_smallint_ord +--! @return public.{{prefix}}_smallint_ord +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_smallint_ord) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_smallint_ord, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/smallint/smallint_ord_functions.sql b/packages/eql/src/v3/scalars/smallint/smallint_ord_functions.sql index 705a8556c..973876d47 100644 --- a/packages/eql/src/v3/scalars/smallint/smallint_ord_functions.sql +++ b/packages/eql/src/v3/scalars/smallint/smallint_ord_functions.sql @@ -5,562 +5,562 @@ -- REQUIRE: src/v3/sem/ope_cllw/functions.sql --! @file encrypted_domain/smallint/smallint_ord_functions.sql ---! @brief Functions for public.eql_v3_smallint_ord. +--! @brief Functions for public.{{prefix}}_smallint_ord. ---! @brief Index extractor for public.eql_v3_smallint_ord. ---! @param a public.eql_v3_smallint_ord ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a public.eql_v3_smallint_ord) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for public.{{prefix}}_smallint_ord. +--! @param a public.{{prefix}}_smallint_ord +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a public.{{prefix}}_smallint_ord) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord. ---! @param a public.eql_v3_smallint_ord ---! @param b public.eql_v3_smallint_ord +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord. +--! @param a public.{{prefix}}_smallint_ord +--! @param b public.{{prefix}}_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_smallint_ord, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord. ---! @param a public.eql_v3_smallint_ord +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord. +--! @param a public.{{prefix}}_smallint_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_smallint_ord, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b::public.eql_v3_smallint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord. +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a jsonb ---! @param b public.eql_v3_smallint_ord +--! @param b public.{{prefix}}_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_smallint_ord) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord. ---! @param a public.eql_v3_smallint_ord ---! @param b public.eql_v3_smallint_ord +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord. +--! @param a public.{{prefix}}_smallint_ord +--! @param b public.{{prefix}}_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_smallint_ord, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord. ---! @param a public.eql_v3_smallint_ord +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord. +--! @param a public.{{prefix}}_smallint_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_smallint_ord, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b::public.eql_v3_smallint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord. +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a jsonb ---! @param b public.eql_v3_smallint_ord +--! @param b public.{{prefix}}_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_smallint_ord) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord. ---! @param a public.eql_v3_smallint_ord ---! @param b public.eql_v3_smallint_ord +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord. +--! @param a public.{{prefix}}_smallint_ord +--! @param b public.{{prefix}}_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_smallint_ord, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord. ---! @param a public.eql_v3_smallint_ord +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord. +--! @param a public.{{prefix}}_smallint_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_smallint_ord, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_smallint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b::public.eql_v3_smallint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord. +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a jsonb ---! @param b public.eql_v3_smallint_ord +--! @param b public.{{prefix}}_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_smallint_ord) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord. ---! @param a public.eql_v3_smallint_ord ---! @param b public.eql_v3_smallint_ord +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord. +--! @param a public.{{prefix}}_smallint_ord +--! @param b public.{{prefix}}_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_smallint_ord, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord. ---! @param a public.eql_v3_smallint_ord +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord. +--! @param a public.{{prefix}}_smallint_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_smallint_ord, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_smallint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b::public.eql_v3_smallint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord. +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a jsonb ---! @param b public.eql_v3_smallint_ord +--! @param b public.{{prefix}}_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_smallint_ord) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord. ---! @param a public.eql_v3_smallint_ord ---! @param b public.eql_v3_smallint_ord +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord. +--! @param a public.{{prefix}}_smallint_ord +--! @param b public.{{prefix}}_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_smallint_ord, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord. ---! @param a public.eql_v3_smallint_ord +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord. +--! @param a public.{{prefix}}_smallint_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_smallint_ord, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_smallint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b::public.eql_v3_smallint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord. +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a jsonb ---! @param b public.eql_v3_smallint_ord +--! @param b public.{{prefix}}_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_smallint_ord) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord. ---! @param a public.eql_v3_smallint_ord ---! @param b public.eql_v3_smallint_ord +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord. +--! @param a public.{{prefix}}_smallint_ord +--! @param b public.{{prefix}}_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_smallint_ord, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord. ---! @param a public.eql_v3_smallint_ord +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord. +--! @param a public.{{prefix}}_smallint_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_smallint_ord, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_smallint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b::public.eql_v3_smallint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord. +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a jsonb ---! @param b public.eql_v3_smallint_ord +--! @param b public.{{prefix}}_smallint_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_smallint_ord) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_smallint_ord, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_smallint_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_smallint_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_smallint_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_smallint_ord, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_smallint_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_smallint_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_smallint_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_smallint_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_smallint_ord, selector text) -RETURNS public.eql_v3_smallint_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_smallint_ord'; END; $$ +--! @return public.{{prefix}}_smallint_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_smallint_ord, selector text) +RETURNS public.{{prefix}}_smallint_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_smallint_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_smallint_ord, selector integer) -RETURNS public.eql_v3_smallint_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_smallint_ord'; END; $$ +--! @return public.{{prefix}}_smallint_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_smallint_ord, selector integer) +RETURNS public.{{prefix}}_smallint_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_smallint_ord right operand of the blocked operator ---! @return public.eql_v3_smallint_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_smallint_ord) -RETURNS public.eql_v3_smallint_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_smallint_ord'; END; $$ +--! @param selector public.{{prefix}}_smallint_ord right operand of the blocked operator +--! @return public.{{prefix}}_smallint_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_smallint_ord) +RETURNS public.{{prefix}}_smallint_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_smallint_ord, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_smallint_ord, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_smallint_ord, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_smallint_ord, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_smallint_ord right operand of the blocked operator +--! @param selector public.{{prefix}}_smallint_ord right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_smallint_ord) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_smallint_ord, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_smallint_ord, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_smallint_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_smallint_ord, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_smallint_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_smallint_ord, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_smallint_ord, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_smallint_ord, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_smallint_ord, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_smallint_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_smallint_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_smallint_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_smallint_ord, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_smallint_ord, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_smallint_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_smallint_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_smallint_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_smallint_ord, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_smallint_ord, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_smallint_ord, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_smallint_ord, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_smallint_ord, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_smallint_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_smallint_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_smallint_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_smallint_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_smallint_ord, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_smallint_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_smallint_ord, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_smallint_ord) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_smallint_ord) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_smallint_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_smallint_ord'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/smallint/smallint_ord_ope_aggregates.sql b/packages/eql/src/v3/scalars/smallint/smallint_ord_ope_aggregates.sql index 2798573b8..dbb9bed18 100644 --- a/packages/eql/src/v3/scalars/smallint/smallint_ord_ope_aggregates.sql +++ b/packages/eql/src/v3/scalars/smallint/smallint_ord_ope_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/smallint/smallint_ord_ope_operators.sql --! @file encrypted_domain/smallint/smallint_ord_ope_aggregates.sql ---! @brief Aggregates for public.eql_v3_smallint_ord_ope. +--! @brief Aggregates for public.{{prefix}}_smallint_ord_ope. ---! @brief State function for min on public.eql_v3_smallint_ord_ope. ---! @param state public.eql_v3_smallint_ord_ope ---! @param value public.eql_v3_smallint_ord_ope ---! @return public.eql_v3_smallint_ord_ope -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_smallint_ord_ope, value public.eql_v3_smallint_ord_ope) -RETURNS public.eql_v3_smallint_ord_ope +--! @brief State function for min on public.{{prefix}}_smallint_ord_ope. +--! @param state public.{{prefix}}_smallint_ord_ope +--! @param value public.{{prefix}}_smallint_ord_ope +--! @return public.{{prefix}}_smallint_ord_ope +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_smallint_ord_ope, value public.{{prefix}}_smallint_ord_ope) +RETURNS public.{{prefix}}_smallint_ord_ope LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_smallint_ord_ope. ---! @param input public.eql_v3_smallint_ord_ope ---! @return public.eql_v3_smallint_ord_ope -CREATE AGGREGATE eql_v3.min(public.eql_v3_smallint_ord_ope) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_smallint_ord_ope, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_smallint_ord_ope. +--! @param input public.{{prefix}}_smallint_ord_ope +--! @return public.{{prefix}}_smallint_ord_ope +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_smallint_ord_ope) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_smallint_ord_ope, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_smallint_ord_ope. ---! @param state public.eql_v3_smallint_ord_ope ---! @param value public.eql_v3_smallint_ord_ope ---! @return public.eql_v3_smallint_ord_ope -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_smallint_ord_ope, value public.eql_v3_smallint_ord_ope) -RETURNS public.eql_v3_smallint_ord_ope +--! @brief State function for max on public.{{prefix}}_smallint_ord_ope. +--! @param state public.{{prefix}}_smallint_ord_ope +--! @param value public.{{prefix}}_smallint_ord_ope +--! @return public.{{prefix}}_smallint_ord_ope +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_smallint_ord_ope, value public.{{prefix}}_smallint_ord_ope) +RETURNS public.{{prefix}}_smallint_ord_ope LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_smallint_ord_ope. ---! @param input public.eql_v3_smallint_ord_ope ---! @return public.eql_v3_smallint_ord_ope -CREATE AGGREGATE eql_v3.max(public.eql_v3_smallint_ord_ope) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_smallint_ord_ope, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_smallint_ord_ope. +--! @param input public.{{prefix}}_smallint_ord_ope +--! @return public.{{prefix}}_smallint_ord_ope +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_smallint_ord_ope) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_smallint_ord_ope, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/smallint/smallint_ord_ope_functions.sql b/packages/eql/src/v3/scalars/smallint/smallint_ord_ope_functions.sql index 307f01c0f..0c1d4ee14 100644 --- a/packages/eql/src/v3/scalars/smallint/smallint_ord_ope_functions.sql +++ b/packages/eql/src/v3/scalars/smallint/smallint_ord_ope_functions.sql @@ -5,562 +5,562 @@ -- REQUIRE: src/v3/sem/ope_cllw/functions.sql --! @file encrypted_domain/smallint/smallint_ord_ope_functions.sql ---! @brief Functions for public.eql_v3_smallint_ord_ope. +--! @brief Functions for public.{{prefix}}_smallint_ord_ope. ---! @brief Index extractor for public.eql_v3_smallint_ord_ope. ---! @param a public.eql_v3_smallint_ord_ope ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a public.eql_v3_smallint_ord_ope) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for public.{{prefix}}_smallint_ord_ope. +--! @param a public.{{prefix}}_smallint_ord_ope +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a public.{{prefix}}_smallint_ord_ope) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ope. ---! @param a public.eql_v3_smallint_ord_ope ---! @param b public.eql_v3_smallint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. +--! @param a public.{{prefix}}_smallint_ord_ope +--! @param b public.{{prefix}}_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_smallint_ord_ope, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ope. ---! @param a public.eql_v3_smallint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. +--! @param a public.{{prefix}}_smallint_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_smallint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b::public.eql_v3_smallint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_smallint_ord_ope +--! @param b public.{{prefix}}_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_smallint_ord_ope) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ope. ---! @param a public.eql_v3_smallint_ord_ope ---! @param b public.eql_v3_smallint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. +--! @param a public.{{prefix}}_smallint_ord_ope +--! @param b public.{{prefix}}_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_smallint_ord_ope, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ope. ---! @param a public.eql_v3_smallint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. +--! @param a public.{{prefix}}_smallint_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_smallint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b::public.eql_v3_smallint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_smallint_ord_ope +--! @param b public.{{prefix}}_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_smallint_ord_ope) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ope. ---! @param a public.eql_v3_smallint_ord_ope ---! @param b public.eql_v3_smallint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. +--! @param a public.{{prefix}}_smallint_ord_ope +--! @param b public.{{prefix}}_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_smallint_ord_ope, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ope. ---! @param a public.eql_v3_smallint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. +--! @param a public.{{prefix}}_smallint_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_smallint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_smallint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b::public.eql_v3_smallint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_smallint_ord_ope +--! @param b public.{{prefix}}_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_smallint_ord_ope) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ope. ---! @param a public.eql_v3_smallint_ord_ope ---! @param b public.eql_v3_smallint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. +--! @param a public.{{prefix}}_smallint_ord_ope +--! @param b public.{{prefix}}_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_smallint_ord_ope, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ope. ---! @param a public.eql_v3_smallint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. +--! @param a public.{{prefix}}_smallint_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_smallint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_smallint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b::public.eql_v3_smallint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_smallint_ord_ope +--! @param b public.{{prefix}}_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_smallint_ord_ope) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ope. ---! @param a public.eql_v3_smallint_ord_ope ---! @param b public.eql_v3_smallint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. +--! @param a public.{{prefix}}_smallint_ord_ope +--! @param b public.{{prefix}}_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_smallint_ord_ope, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ope. ---! @param a public.eql_v3_smallint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. +--! @param a public.{{prefix}}_smallint_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_smallint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_smallint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b::public.eql_v3_smallint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_smallint_ord_ope +--! @param b public.{{prefix}}_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_smallint_ord_ope) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ope. ---! @param a public.eql_v3_smallint_ord_ope ---! @param b public.eql_v3_smallint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. +--! @param a public.{{prefix}}_smallint_ord_ope +--! @param b public.{{prefix}}_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_smallint_ord_ope, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ope. ---! @param a public.eql_v3_smallint_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. +--! @param a public.{{prefix}}_smallint_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_smallint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_smallint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b::public.eql_v3_smallint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_smallint_ord_ope +--! @param b public.{{prefix}}_smallint_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_smallint_ord_ope) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_smallint_ord_ope, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_smallint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_smallint_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_smallint_ord_ope, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_smallint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_smallint_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_smallint_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_smallint_ord_ope, selector text) -RETURNS public.eql_v3_smallint_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_smallint_ord_ope'; END; $$ +--! @return public.{{prefix}}_smallint_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_smallint_ord_ope, selector text) +RETURNS public.{{prefix}}_smallint_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_smallint_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_smallint_ord_ope, selector integer) -RETURNS public.eql_v3_smallint_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_smallint_ord_ope'; END; $$ +--! @return public.{{prefix}}_smallint_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_smallint_ord_ope, selector integer) +RETURNS public.{{prefix}}_smallint_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_smallint_ord_ope right operand of the blocked operator ---! @return public.eql_v3_smallint_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_smallint_ord_ope) -RETURNS public.eql_v3_smallint_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_smallint_ord_ope'; END; $$ +--! @param selector public.{{prefix}}_smallint_ord_ope right operand of the blocked operator +--! @return public.{{prefix}}_smallint_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_smallint_ord_ope) +RETURNS public.{{prefix}}_smallint_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_smallint_ord_ope, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_smallint_ord_ope, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_smallint_ord_ope, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_smallint_ord_ope, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_smallint_ord_ope right operand of the blocked operator +--! @param selector public.{{prefix}}_smallint_ord_ope right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_smallint_ord_ope) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_smallint_ord_ope, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_smallint_ord_ope, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_smallint_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_smallint_ord_ope, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_smallint_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_smallint_ord_ope, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_smallint_ord_ope, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_smallint_ord_ope, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_smallint_ord_ope, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_smallint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_smallint_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_smallint_ord_ope, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_smallint_ord_ope, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_smallint_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_smallint_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_smallint_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_smallint_ord_ope, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_smallint_ord_ope, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_smallint_ord_ope, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_smallint_ord_ope, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_smallint_ord_ope, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_smallint_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_smallint_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_smallint_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_smallint_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord_ope right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_smallint_ord_ope, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ope) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_smallint_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_smallint_ord_ope, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord_ope right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_smallint_ord_ope) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_smallint_ord_ope) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_smallint_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_smallint_ord_ope'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/smallint/smallint_ord_ope_operators.sql b/packages/eql/src/v3/scalars/smallint/smallint_ord_ope_operators.sql index 3f45121ed..826c80e22 100644 --- a/packages/eql/src/v3/scalars/smallint/smallint_ord_ope_operators.sql +++ b/packages/eql/src/v3/scalars/smallint/smallint_ord_ope_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/smallint/smallint_ord_ope_functions.sql --! @file encrypted_domain/smallint/smallint_ord_ope_operators.sql ---! @brief Operators for public.eql_v3_smallint_ord_ope. +--! @brief Operators for public.{{prefix}}_smallint_ord_ope. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = public.eql_v3_smallint_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = public.eql_v3_smallint_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = public.eql_v3_smallint_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = public.eql_v3_smallint_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = public.eql_v3_smallint_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = public.eql_v3_smallint_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = public.eql_v3_smallint_ord_ope + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ope ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ope + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ope ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = public.eql_v3_smallint_ord_ope + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ope ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ope + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ope ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ope + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ope ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ope + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ope ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = public.eql_v3_smallint_ord_ope + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ope ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ope + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ope ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = public.eql_v3_smallint_ord_ope + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ope ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_smallint_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ope + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ope ); diff --git a/packages/eql/src/v3/scalars/smallint/smallint_ord_operators.sql b/packages/eql/src/v3/scalars/smallint/smallint_ord_operators.sql index b5efb730c..8de4d09bc 100644 --- a/packages/eql/src/v3/scalars/smallint/smallint_ord_operators.sql +++ b/packages/eql/src/v3/scalars/smallint/smallint_ord_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/smallint/smallint_ord_functions.sql --! @file encrypted_domain/smallint/smallint_ord_operators.sql ---! @brief Operators for public.eql_v3_smallint_ord. +--! @brief Operators for public.{{prefix}}_smallint_ord. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = public.eql_v3_smallint_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = public.eql_v3_smallint_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = public.eql_v3_smallint_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = public.eql_v3_smallint_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = public.eql_v3_smallint_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = public.eql_v3_smallint_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = public.eql_v3_smallint_ord + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = public.eql_v3_smallint_ord + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = public.eql_v3_smallint_ord + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = public.eql_v3_smallint_ord + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_smallint_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord ); diff --git a/packages/eql/src/v3/scalars/smallint/smallint_ord_ore_aggregates.sql b/packages/eql/src/v3/scalars/smallint/smallint_ord_ore_aggregates.sql index e59ea3bdd..491699a6f 100644 --- a/packages/eql/src/v3/scalars/smallint/smallint_ord_ore_aggregates.sql +++ b/packages/eql/src/v3/scalars/smallint/smallint_ord_ore_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/smallint/smallint_ord_ore_operators.sql --! @file encrypted_domain/smallint/smallint_ord_ore_aggregates.sql ---! @brief Aggregates for public.eql_v3_smallint_ord_ore. +--! @brief Aggregates for public.{{prefix}}_smallint_ord_ore. ---! @brief State function for min on public.eql_v3_smallint_ord_ore. ---! @param state public.eql_v3_smallint_ord_ore ---! @param value public.eql_v3_smallint_ord_ore ---! @return public.eql_v3_smallint_ord_ore -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_smallint_ord_ore, value public.eql_v3_smallint_ord_ore) -RETURNS public.eql_v3_smallint_ord_ore +--! @brief State function for min on public.{{prefix}}_smallint_ord_ore. +--! @param state public.{{prefix}}_smallint_ord_ore +--! @param value public.{{prefix}}_smallint_ord_ore +--! @return public.{{prefix}}_smallint_ord_ore +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_smallint_ord_ore, value public.{{prefix}}_smallint_ord_ore) +RETURNS public.{{prefix}}_smallint_ord_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_smallint_ord_ore. ---! @param input public.eql_v3_smallint_ord_ore ---! @return public.eql_v3_smallint_ord_ore -CREATE AGGREGATE eql_v3.min(public.eql_v3_smallint_ord_ore) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_smallint_ord_ore, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_smallint_ord_ore. +--! @param input public.{{prefix}}_smallint_ord_ore +--! @return public.{{prefix}}_smallint_ord_ore +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_smallint_ord_ore) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_smallint_ord_ore, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_smallint_ord_ore. ---! @param state public.eql_v3_smallint_ord_ore ---! @param value public.eql_v3_smallint_ord_ore ---! @return public.eql_v3_smallint_ord_ore -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_smallint_ord_ore, value public.eql_v3_smallint_ord_ore) -RETURNS public.eql_v3_smallint_ord_ore +--! @brief State function for max on public.{{prefix}}_smallint_ord_ore. +--! @param state public.{{prefix}}_smallint_ord_ore +--! @param value public.{{prefix}}_smallint_ord_ore +--! @return public.{{prefix}}_smallint_ord_ore +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_smallint_ord_ore, value public.{{prefix}}_smallint_ord_ore) +RETURNS public.{{prefix}}_smallint_ord_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_smallint_ord_ore. ---! @param input public.eql_v3_smallint_ord_ore ---! @return public.eql_v3_smallint_ord_ore -CREATE AGGREGATE eql_v3.max(public.eql_v3_smallint_ord_ore) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_smallint_ord_ore, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_smallint_ord_ore. +--! @param input public.{{prefix}}_smallint_ord_ore +--! @return public.{{prefix}}_smallint_ord_ore +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_smallint_ord_ore) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_smallint_ord_ore, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/smallint/smallint_ord_ore_functions.sql b/packages/eql/src/v3/scalars/smallint/smallint_ord_ore_functions.sql index ae14169f0..4940f690f 100644 --- a/packages/eql/src/v3/scalars/smallint/smallint_ord_ore_functions.sql +++ b/packages/eql/src/v3/scalars/smallint/smallint_ord_ore_functions.sql @@ -6,562 +6,562 @@ -- REQUIRE: src/v3/sem/ore_block_256/operators.sql --! @file encrypted_domain/smallint/smallint_ord_ore_functions.sql ---! @brief Functions for public.eql_v3_smallint_ord_ore. +--! @brief Functions for public.{{prefix}}_smallint_ord_ore. ---! @brief Index extractor for public.eql_v3_smallint_ord_ore. ---! @param a public.eql_v3_smallint_ord_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a public.eql_v3_smallint_ord_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for public.{{prefix}}_smallint_ord_ore. +--! @param a public.{{prefix}}_smallint_ord_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a public.{{prefix}}_smallint_ord_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ore. ---! @param a public.eql_v3_smallint_ord_ore ---! @param b public.eql_v3_smallint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. +--! @param a public.{{prefix}}_smallint_ord_ore +--! @param b public.{{prefix}}_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_smallint_ord_ore, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ore. ---! @param a public.eql_v3_smallint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. +--! @param a public.{{prefix}}_smallint_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_smallint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b::public.eql_v3_smallint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{prefix}}_smallint_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_smallint_ord_ore +--! @param b public.{{prefix}}_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_smallint_ord_ore) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ore. ---! @param a public.eql_v3_smallint_ord_ore ---! @param b public.eql_v3_smallint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. +--! @param a public.{{prefix}}_smallint_ord_ore +--! @param b public.{{prefix}}_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_smallint_ord_ore, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ore. ---! @param a public.eql_v3_smallint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. +--! @param a public.{{prefix}}_smallint_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_smallint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b::public.eql_v3_smallint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{prefix}}_smallint_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_smallint_ord_ore +--! @param b public.{{prefix}}_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_smallint_ord_ore) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ore. ---! @param a public.eql_v3_smallint_ord_ore ---! @param b public.eql_v3_smallint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. +--! @param a public.{{prefix}}_smallint_ord_ore +--! @param b public.{{prefix}}_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_smallint_ord_ore, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ore. ---! @param a public.eql_v3_smallint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. +--! @param a public.{{prefix}}_smallint_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_smallint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_smallint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b::public.eql_v3_smallint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_smallint_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_smallint_ord_ore +--! @param b public.{{prefix}}_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_smallint_ord_ore) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ore. ---! @param a public.eql_v3_smallint_ord_ore ---! @param b public.eql_v3_smallint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. +--! @param a public.{{prefix}}_smallint_ord_ore +--! @param b public.{{prefix}}_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_smallint_ord_ore, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ore. ---! @param a public.eql_v3_smallint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. +--! @param a public.{{prefix}}_smallint_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_smallint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_smallint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b::public.eql_v3_smallint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_smallint_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_smallint_ord_ore +--! @param b public.{{prefix}}_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_smallint_ord_ore) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ore. ---! @param a public.eql_v3_smallint_ord_ore ---! @param b public.eql_v3_smallint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. +--! @param a public.{{prefix}}_smallint_ord_ore +--! @param b public.{{prefix}}_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_smallint_ord_ore, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ore. ---! @param a public.eql_v3_smallint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. +--! @param a public.{{prefix}}_smallint_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_smallint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_smallint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b::public.eql_v3_smallint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_smallint_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_smallint_ord_ore +--! @param b public.{{prefix}}_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_smallint_ord_ore) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ore. ---! @param a public.eql_v3_smallint_ord_ore ---! @param b public.eql_v3_smallint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. +--! @param a public.{{prefix}}_smallint_ord_ore +--! @param b public.{{prefix}}_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_smallint_ord_ore, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ore. ---! @param a public.eql_v3_smallint_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. +--! @param a public.{{prefix}}_smallint_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_smallint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_smallint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b::public.eql_v3_smallint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_smallint_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_smallint_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_smallint_ord_ore +--! @param b public.{{prefix}}_smallint_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_smallint_ord_ore) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_smallint_ord_ore, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_smallint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_smallint_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_smallint_ord_ore, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_smallint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_smallint_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_smallint_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_smallint_ord_ore, selector text) -RETURNS public.eql_v3_smallint_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_smallint_ord_ore'; END; $$ +--! @return public.{{prefix}}_smallint_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_smallint_ord_ore, selector text) +RETURNS public.{{prefix}}_smallint_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_smallint_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_smallint_ord_ore, selector integer) -RETURNS public.eql_v3_smallint_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_smallint_ord_ore'; END; $$ +--! @return public.{{prefix}}_smallint_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_smallint_ord_ore, selector integer) +RETURNS public.{{prefix}}_smallint_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_smallint_ord_ore right operand of the blocked operator ---! @return public.eql_v3_smallint_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_smallint_ord_ore) -RETURNS public.eql_v3_smallint_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_smallint_ord_ore'; END; $$ +--! @param selector public.{{prefix}}_smallint_ord_ore right operand of the blocked operator +--! @return public.{{prefix}}_smallint_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_smallint_ord_ore) +RETURNS public.{{prefix}}_smallint_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_smallint_ord_ore, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_smallint_ord_ore, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_smallint_ord_ore, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_smallint_ord_ore, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_smallint_ord_ore right operand of the blocked operator +--! @param selector public.{{prefix}}_smallint_ord_ore right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_smallint_ord_ore) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_smallint_ord_ore, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_smallint_ord_ore, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_smallint_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_smallint_ord_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_smallint_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_smallint_ord_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_smallint_ord_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_smallint_ord_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_smallint_ord_ore, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_smallint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_smallint_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_smallint_ord_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_smallint_ord_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_smallint_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_smallint_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_smallint_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_smallint_ord_ore, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_smallint_ord_ore, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_smallint_ord_ore, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_smallint_ord_ore, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_smallint_ord_ore, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_smallint_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_smallint_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_smallint_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_smallint_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_smallint_ord_ore, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_smallint_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_smallint_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_smallint_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_smallint_ord_ore, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_smallint_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_smallint_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_smallint_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_smallint_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_smallint_ord_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_smallint_ord_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_smallint_ord_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_smallint_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_smallint_ord_ore'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/smallint/smallint_ord_ore_operators.sql b/packages/eql/src/v3/scalars/smallint/smallint_ord_ore_operators.sql index 602a85417..694f2b2a8 100644 --- a/packages/eql/src/v3/scalars/smallint/smallint_ord_ore_operators.sql +++ b/packages/eql/src/v3/scalars/smallint/smallint_ord_ore_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/smallint/smallint_ord_ore_functions.sql --! @file encrypted_domain/smallint/smallint_ord_ore_operators.sql ---! @brief Operators for public.eql_v3_smallint_ord_ore. +--! @brief Operators for public.{{prefix}}_smallint_ord_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = public.eql_v3_smallint_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = public.eql_v3_smallint_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = public.eql_v3_smallint_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = public.eql_v3_smallint_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = public.eql_v3_smallint_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = public.eql_v3_smallint_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = public.eql_v3_smallint_ord_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ore ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = public.eql_v3_smallint_ord_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ore ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ore + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ore ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ore + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ore ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = public.eql_v3_smallint_ord_ore + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ore ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ore + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ore ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = public.eql_v3_smallint_ord_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ore ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_smallint_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_smallint_ord_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_smallint_ord_ore ); diff --git a/packages/eql/src/v3/scalars/smallint/smallint_types.sql b/packages/eql/src/v3/scalars/smallint/smallint_types.sql index 8a4044a86..adc4887ca 100644 --- a/packages/eql/src/v3/scalars/smallint/smallint_types.sql +++ b/packages/eql/src/v3/scalars/smallint/smallint_types.sql @@ -6,47 +6,47 @@ DO $$ BEGIN - --! @brief Encrypted domain public.eql_v3_smallint. + --! @brief Encrypted domain public.{{prefix}}_smallint. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_smallint' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_smallint' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_smallint AS jsonb + CREATE DOMAIN public.{{prefix}}_smallint AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_smallint IS 'EQL encrypted smallint (storage only)'; + COMMENT ON DOMAIN public.{{prefix}}_smallint IS 'EQL encrypted smallint (storage only)'; - --! @brief Encrypted domain public.eql_v3_smallint_eq. + --! @brief Encrypted domain public.{{prefix}}_smallint_eq. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_smallint_eq' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_smallint_eq' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_smallint_eq AS jsonb + CREATE DOMAIN public.{{prefix}}_smallint_eq AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'hm' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_smallint_eq IS 'EQL encrypted smallint (equality)'; + COMMENT ON DOMAIN public.{{prefix}}_smallint_eq IS 'EQL encrypted smallint (equality)'; - --! @brief Encrypted domain public.eql_v3_smallint_ord_ore. + --! @brief Encrypted domain public.{{prefix}}_smallint_ord_ore. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_smallint_ord_ore' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_smallint_ord_ore' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_smallint_ord_ore AS jsonb + CREATE DOMAIN public.{{prefix}}_smallint_ord_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -55,46 +55,46 @@ BEGIN AND VALUE ? 'ob' AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_smallint_ord_ore IS 'EQL encrypted smallint (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_smallint_ord_ore IS 'EQL encrypted smallint (equality, ordering)'; - --! @brief Encrypted domain public.eql_v3_smallint_ord. + --! @brief Encrypted domain public.{{prefix}}_smallint_ord. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_smallint_ord' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_smallint_ord' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_smallint_ord AS jsonb + CREATE DOMAIN public.{{prefix}}_smallint_ord AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'op' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_smallint_ord IS 'EQL encrypted smallint (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_smallint_ord IS 'EQL encrypted smallint (equality, ordering)'; - --! @brief Encrypted domain public.eql_v3_smallint_ord_ope. + --! @brief Encrypted domain public.{{prefix}}_smallint_ord_ope. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_smallint_ord_ope' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_smallint_ord_ope' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_smallint_ord_ope AS jsonb + CREATE DOMAIN public.{{prefix}}_smallint_ord_ope AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'op' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_smallint_ord_ope IS 'EQL encrypted smallint (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_smallint_ord_ope IS 'EQL encrypted smallint (equality, ordering)'; END $$; diff --git a/packages/eql/src/v3/scalars/text/json_entry_text_functions.sql b/packages/eql/src/v3/scalars/text/json_entry_text_functions.sql index 054e48c7a..57c5d45bc 100644 --- a/packages/eql/src/v3/scalars/text/json_entry_text_functions.sql +++ b/packages/eql/src/v3/scalars/text/json_entry_text_functions.sql @@ -7,412 +7,412 @@ -- REQUIRE: src/v3/scalars/text/query_text_ord_ope_functions.sql --! @file encrypted_domain/text/json_entry_text_functions.sql ---! @brief Functions for public.eql_v3_json_entry. +--! @brief Functions for public.{{prefix}}_json_entry. ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_text_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_text_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json_entry, b eql_v3.query_text_ord) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_text_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_text_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a eql_v3.query_text_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_text_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_text_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json_entry, b eql_v3.query_text_ord) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_text_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_text_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a eql_v3.query_text_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_text_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_text_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_json_entry, b eql_v3.query_text_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_text_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_text_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_text_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_text_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_text_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_text_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_json_entry, b eql_v3.query_text_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_text_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_text_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_text_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_text_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_text_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_text_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_json_entry, b eql_v3.query_text_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_text_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_text_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_text_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_text_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_text_ord +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_text_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_json_entry, b eql_v3.query_text_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_text_ord ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_text_ord +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_text_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_text_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_text_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_text_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json_entry, b eql_v3.query_text_ord_ope) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_text_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_text_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a eql_v3.query_text_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_text_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_text_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json_entry, b eql_v3.query_text_ord_ope) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_text_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_text_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a eql_v3.query_text_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_text_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_json_entry, b eql_v3.query_text_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_text_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_text_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_text_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_text_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_json_entry, b eql_v3.query_text_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_text_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_text_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_text_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_text_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_json_entry, b eql_v3.query_text_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_text_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_text_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_text_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a public.eql_v3_json_entry ---! @param b eql_v3.query_text_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a public.{{prefix}}_json_entry +--! @param b {{prefix}}.query_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_json_entry, b eql_v3.query_text_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_json_entry. ---! @param a eql_v3.query_text_ord_ope ---! @param b public.eql_v3_json_entry +--! @brief Operator wrapper for public.{{prefix}}_json_entry. +--! @param a {{prefix}}.query_text_ord_ope +--! @param b public.{{prefix}}_json_entry --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_text_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_text_search right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_text_search right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json_entry, b eql_v3.query_text_search) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_search) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_text_search left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_text_search left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a eql_v3.query_text_search, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_search, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_text_search right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_text_search right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json_entry, b eql_v3.query_text_search) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_search) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_text_search left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_text_search left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a eql_v3.query_text_search, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_search, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_text_search right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_text_search right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_json_entry, b eql_v3.query_text_search) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_search) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_text_search left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_text_search left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a eql_v3.query_text_search, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_search, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_text_search right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_text_search right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_json_entry, b eql_v3.query_text_search) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_search) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_text_search left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_text_search left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a eql_v3.query_text_search, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_search, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_text_search right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_text_search right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_json_entry, b eql_v3.query_text_search) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_search) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_text_search left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_text_search left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a eql_v3.query_text_search, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_search, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_text_search right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_text_search right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_json_entry, b eql_v3.query_text_search) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_search) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_text_search left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_text_search left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a eql_v3.query_text_search, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_search, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/text/json_entry_text_operators.sql b/packages/eql/src/v3/scalars/text/json_entry_text_operators.sql index 4f98a385b..029d55e8c 100644 --- a/packages/eql/src/v3/scalars/text/json_entry_text_operators.sql +++ b/packages/eql/src/v3/scalars/text/json_entry_text_operators.sql @@ -5,200 +5,200 @@ -- REQUIRE: src/v3/scalars/text/json_entry_text_functions.sql --! @file encrypted_domain/text/json_entry_text_operators.sql ---! @brief Operators for public.eql_v3_json_entry. +--! @brief Operators for public.{{prefix}}_json_entry. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_text_ord + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_text_ord ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = eql_v3.query_text_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_text_ord + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_text_ord ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = eql_v3.query_text_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_text_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_text_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_text_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_text_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_text_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_text_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_text_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_text_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_text_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_text_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_text_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_text_ord, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_text_ord_ope + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_text_ord_ope ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = eql_v3.query_text_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_text_ord_ope + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_text_ord_ope ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = eql_v3.query_text_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_text_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_text_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_text_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_text_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_text_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_text_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_text_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_text_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_text_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_text_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_text_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_text_ord_ope, RIGHTARG = public.eql_v3_json_entry, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_json_entry, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_text_search + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_text_search ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = eql_v3.query_text_search, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_text_search + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_text_search ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = eql_v3.query_text_search, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_text_search + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_text_search ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = eql_v3.query_text_search, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_text_search + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_text_search ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = eql_v3.query_text_search, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_text_search + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_text_search ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = eql_v3.query_text_search, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_text_search + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_text_search ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = eql_v3.query_text_search, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_json_entry ); diff --git a/packages/eql/src/v3/scalars/text/query_text_eq_functions.sql b/packages/eql/src/v3/scalars/text/query_text_eq_functions.sql index d0c0cc2e9..0e6260a19 100644 --- a/packages/eql/src/v3/scalars/text/query_text_eq_functions.sql +++ b/packages/eql/src/v3/scalars/text/query_text_eq_functions.sql @@ -4,44 +4,44 @@ -- REQUIRE: src/v3/scalars/text/text_eq_functions.sql --! @file encrypted_domain/text/query_text_eq_functions.sql ---! @brief Functions for eql_v3.query_text_eq. +--! @brief Functions for {{prefix}}.query_text_eq. ---! @brief Index extractor for eql_v3.query_text_eq. ---! @param a eql_v3.query_text_eq ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a eql_v3.query_text_eq) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for {{prefix}}.query_text_eq. +--! @param a {{prefix}}.query_text_eq +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a {{prefix}}.query_text_eq) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_text_eq. ---! @param a public.eql_v3_text_eq ---! @param b eql_v3.query_text_eq +--! @brief Operator wrapper for {{prefix}}.query_text_eq. +--! @param a public.{{prefix}}_text_eq +--! @param b {{prefix}}.query_text_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_text_eq, b eql_v3.query_text_eq) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_eq, b {{prefix}}.query_text_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_eq. ---! @param a eql_v3.query_text_eq ---! @param b public.eql_v3_text_eq +--! @brief Operator wrapper for {{prefix}}.query_text_eq. +--! @param a {{prefix}}.query_text_eq +--! @param b public.{{prefix}}_text_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_text_eq, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_text_eq, b public.{{prefix}}_text_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_eq. ---! @param a public.eql_v3_text_eq ---! @param b eql_v3.query_text_eq +--! @brief Operator wrapper for {{prefix}}.query_text_eq. +--! @param a public.{{prefix}}_text_eq +--! @param b {{prefix}}.query_text_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_text_eq, b eql_v3.query_text_eq) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_eq, b {{prefix}}.query_text_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_eq. ---! @param a eql_v3.query_text_eq ---! @param b public.eql_v3_text_eq +--! @brief Operator wrapper for {{prefix}}.query_text_eq. +--! @param a {{prefix}}.query_text_eq +--! @param b public.{{prefix}}_text_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_text_eq, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_text_eq, b public.{{prefix}}_text_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; diff --git a/packages/eql/src/v3/scalars/text/query_text_eq_operators.sql b/packages/eql/src/v3/scalars/text/query_text_eq_operators.sql index 912b0c0c4..08ad73c9c 100644 --- a/packages/eql/src/v3/scalars/text/query_text_eq_operators.sql +++ b/packages/eql/src/v3/scalars/text/query_text_eq_operators.sql @@ -4,28 +4,28 @@ -- REQUIRE: src/v3/scalars/text/query_text_eq_functions.sql --! @file encrypted_domain/text/query_text_eq_operators.sql ---! @brief Operators for eql_v3.query_text_eq. +--! @brief Operators for {{prefix}}.query_text_eq. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_text_eq, RIGHTARG = eql_v3.query_text_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = {{prefix}}.query_text_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_text_eq, RIGHTARG = public.eql_v3_text_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_text_eq, RIGHTARG = public.{{prefix}}_text_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_text_eq, RIGHTARG = eql_v3.query_text_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = {{prefix}}.query_text_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_text_eq, RIGHTARG = public.eql_v3_text_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_text_eq, RIGHTARG = public.{{prefix}}_text_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); diff --git a/packages/eql/src/v3/scalars/text/query_text_match_functions.sql b/packages/eql/src/v3/scalars/text/query_text_match_functions.sql index 21d85ed57..e877edf21 100644 --- a/packages/eql/src/v3/scalars/text/query_text_match_functions.sql +++ b/packages/eql/src/v3/scalars/text/query_text_match_functions.sql @@ -4,28 +4,28 @@ -- REQUIRE: src/v3/scalars/text/text_match_functions.sql --! @file encrypted_domain/text/query_text_match_functions.sql ---! @brief Functions for eql_v3.query_text_match. +--! @brief Functions for {{prefix}}.query_text_match. ---! @brief Index extractor for eql_v3.query_text_match. ---! @param a eql_v3.query_text_match ---! @return eql_v3_internal.bloom_filter -CREATE FUNCTION eql_v3.match_term(a eql_v3.query_text_match) -RETURNS eql_v3_internal.bloom_filter +--! @brief Index extractor for {{prefix}}.query_text_match. +--! @param a {{prefix}}.query_text_match +--! @return {{prefix}}_internal.bloom_filter +CREATE FUNCTION {{prefix}}.match_term(a {{prefix}}.query_text_match) +RETURNS {{prefix}}_internal.bloom_filter LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.bloom_filter(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.bloom_filter(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_text_match. ---! @param a public.eql_v3_text_match ---! @param b eql_v3.query_text_match +--! @brief Operator wrapper for {{prefix}}.query_text_match. +--! @param a public.{{prefix}}_text_match +--! @param b {{prefix}}.query_text_match --! @return boolean -CREATE FUNCTION eql_v3.matches(a public.eql_v3_text_match, b eql_v3.query_text_match) +CREATE FUNCTION {{prefix}}.matches(a public.{{prefix}}_text_match, b {{prefix}}.query_text_match) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT eql_v3.match_term(a) @> eql_v3.match_term(b) AND (cardinality(eql_v3.match_term(b)) > 0 OR cardinality(eql_v3.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; ---! @brief Operator wrapper for eql_v3.query_text_match. ---! @param a eql_v3.query_text_match ---! @param b public.eql_v3_text_match +--! @brief Operator wrapper for {{prefix}}.query_text_match. +--! @param a {{prefix}}.query_text_match +--! @param b public.{{prefix}}_text_match --! @return boolean -CREATE FUNCTION eql_v3.matches(a eql_v3.query_text_match, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}.matches(a {{prefix}}.query_text_match, b public.{{prefix}}_text_match) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT eql_v3.match_term(a) @> eql_v3.match_term(b) AND (cardinality(eql_v3.match_term(b)) > 0 OR cardinality(eql_v3.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; diff --git a/packages/eql/src/v3/scalars/text/query_text_match_operators.sql b/packages/eql/src/v3/scalars/text/query_text_match_operators.sql index 8a510552d..91dc013b8 100644 --- a/packages/eql/src/v3/scalars/text/query_text_match_operators.sql +++ b/packages/eql/src/v3/scalars/text/query_text_match_operators.sql @@ -4,16 +4,16 @@ -- REQUIRE: src/v3/scalars/text/query_text_match_functions.sql --! @file encrypted_domain/text/query_text_match_operators.sql ---! @brief Operators for eql_v3.query_text_match. +--! @brief Operators for {{prefix}}.query_text_match. CREATE OPERATOR @@ ( - FUNCTION = eql_v3.matches, - LEFTARG = public.eql_v3_text_match, RIGHTARG = eql_v3.query_text_match, + FUNCTION = {{prefix}}.matches, + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = {{prefix}}.query_text_match, RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3.matches, - LEFTARG = eql_v3.query_text_match, RIGHTARG = public.eql_v3_text_match, + FUNCTION = {{prefix}}.matches, + LEFTARG = {{prefix}}.query_text_match, RIGHTARG = public.{{prefix}}_text_match, RESTRICT = contsel, JOIN = contjoinsel ); diff --git a/packages/eql/src/v3/scalars/text/query_text_ord_functions.sql b/packages/eql/src/v3/scalars/text/query_text_ord_functions.sql index d2c1b932e..e54be6f50 100644 --- a/packages/eql/src/v3/scalars/text/query_text_ord_functions.sql +++ b/packages/eql/src/v3/scalars/text/query_text_ord_functions.sql @@ -4,116 +4,116 @@ -- REQUIRE: src/v3/scalars/text/text_ord_functions.sql --! @file encrypted_domain/text/query_text_ord_functions.sql ---! @brief Functions for eql_v3.query_text_ord. +--! @brief Functions for {{prefix}}.query_text_ord. ---! @brief Index extractor for eql_v3.query_text_ord. ---! @param a eql_v3.query_text_ord ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a eql_v3.query_text_ord) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for {{prefix}}.query_text_ord. +--! @param a {{prefix}}.query_text_ord +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a {{prefix}}.query_text_ord) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Index extractor for eql_v3.query_text_ord. ---! @param a eql_v3.query_text_ord ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a eql_v3.query_text_ord) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for {{prefix}}.query_text_ord. +--! @param a {{prefix}}.query_text_ord +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a {{prefix}}.query_text_ord) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord. ---! @param a public.eql_v3_text_ord ---! @param b eql_v3.query_text_ord +--! @brief Operator wrapper for {{prefix}}.query_text_ord. +--! @param a public.{{prefix}}_text_ord +--! @param b {{prefix}}.query_text_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_text_ord, b eql_v3.query_text_ord) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord. ---! @param a eql_v3.query_text_ord ---! @param b public.eql_v3_text_ord +--! @brief Operator wrapper for {{prefix}}.query_text_ord. +--! @param a {{prefix}}.query_text_ord +--! @param b public.{{prefix}}_text_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_text_ord, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord. ---! @param a public.eql_v3_text_ord ---! @param b eql_v3.query_text_ord +--! @brief Operator wrapper for {{prefix}}.query_text_ord. +--! @param a public.{{prefix}}_text_ord +--! @param b {{prefix}}.query_text_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_text_ord, b eql_v3.query_text_ord) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord. ---! @param a eql_v3.query_text_ord ---! @param b public.eql_v3_text_ord +--! @brief Operator wrapper for {{prefix}}.query_text_ord. +--! @param a {{prefix}}.query_text_ord +--! @param b public.{{prefix}}_text_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_text_ord, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord. ---! @param a public.eql_v3_text_ord ---! @param b eql_v3.query_text_ord +--! @brief Operator wrapper for {{prefix}}.query_text_ord. +--! @param a public.{{prefix}}_text_ord +--! @param b {{prefix}}.query_text_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_text_ord, b eql_v3.query_text_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord. ---! @param a eql_v3.query_text_ord ---! @param b public.eql_v3_text_ord +--! @brief Operator wrapper for {{prefix}}.query_text_ord. +--! @param a {{prefix}}.query_text_ord +--! @param b public.{{prefix}}_text_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_text_ord, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord. ---! @param a public.eql_v3_text_ord ---! @param b eql_v3.query_text_ord +--! @brief Operator wrapper for {{prefix}}.query_text_ord. +--! @param a public.{{prefix}}_text_ord +--! @param b {{prefix}}.query_text_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_text_ord, b eql_v3.query_text_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord. ---! @param a eql_v3.query_text_ord ---! @param b public.eql_v3_text_ord +--! @brief Operator wrapper for {{prefix}}.query_text_ord. +--! @param a {{prefix}}.query_text_ord +--! @param b public.{{prefix}}_text_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_text_ord, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord. ---! @param a public.eql_v3_text_ord ---! @param b eql_v3.query_text_ord +--! @brief Operator wrapper for {{prefix}}.query_text_ord. +--! @param a public.{{prefix}}_text_ord +--! @param b {{prefix}}.query_text_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_text_ord, b eql_v3.query_text_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord. ---! @param a eql_v3.query_text_ord ---! @param b public.eql_v3_text_ord +--! @brief Operator wrapper for {{prefix}}.query_text_ord. +--! @param a {{prefix}}.query_text_ord +--! @param b public.{{prefix}}_text_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_text_ord, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord. ---! @param a public.eql_v3_text_ord ---! @param b eql_v3.query_text_ord +--! @brief Operator wrapper for {{prefix}}.query_text_ord. +--! @param a public.{{prefix}}_text_ord +--! @param b {{prefix}}.query_text_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_text_ord, b eql_v3.query_text_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord. ---! @param a eql_v3.query_text_ord ---! @param b public.eql_v3_text_ord +--! @brief Operator wrapper for {{prefix}}.query_text_ord. +--! @param a {{prefix}}.query_text_ord +--! @param b public.{{prefix}}_text_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_text_ord, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/text/query_text_ord_ope_functions.sql b/packages/eql/src/v3/scalars/text/query_text_ord_ope_functions.sql index 7a111d47d..6ddd10e43 100644 --- a/packages/eql/src/v3/scalars/text/query_text_ord_ope_functions.sql +++ b/packages/eql/src/v3/scalars/text/query_text_ord_ope_functions.sql @@ -4,116 +4,116 @@ -- REQUIRE: src/v3/scalars/text/text_ord_ope_functions.sql --! @file encrypted_domain/text/query_text_ord_ope_functions.sql ---! @brief Functions for eql_v3.query_text_ord_ope. +--! @brief Functions for {{prefix}}.query_text_ord_ope. ---! @brief Index extractor for eql_v3.query_text_ord_ope. ---! @param a eql_v3.query_text_ord_ope ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a eql_v3.query_text_ord_ope) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for {{prefix}}.query_text_ord_ope. +--! @param a {{prefix}}.query_text_ord_ope +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a {{prefix}}.query_text_ord_ope) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Index extractor for eql_v3.query_text_ord_ope. ---! @param a eql_v3.query_text_ord_ope ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a eql_v3.query_text_ord_ope) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for {{prefix}}.query_text_ord_ope. +--! @param a {{prefix}}.query_text_ord_ope +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a {{prefix}}.query_text_ord_ope) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope ---! @param b eql_v3.query_text_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope +--! @param b {{prefix}}.query_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_text_ord_ope, b eql_v3.query_text_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ope. ---! @param a eql_v3.query_text_ord_ope ---! @param b public.eql_v3_text_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. +--! @param a {{prefix}}.query_text_ord_ope +--! @param b public.{{prefix}}_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_text_ord_ope, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope ---! @param b eql_v3.query_text_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope +--! @param b {{prefix}}.query_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_text_ord_ope, b eql_v3.query_text_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ope. ---! @param a eql_v3.query_text_ord_ope ---! @param b public.eql_v3_text_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. +--! @param a {{prefix}}.query_text_ord_ope +--! @param b public.{{prefix}}_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_text_ord_ope, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope ---! @param b eql_v3.query_text_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope +--! @param b {{prefix}}.query_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_text_ord_ope, b eql_v3.query_text_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ope. ---! @param a eql_v3.query_text_ord_ope ---! @param b public.eql_v3_text_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. +--! @param a {{prefix}}.query_text_ord_ope +--! @param b public.{{prefix}}_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_text_ord_ope, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope ---! @param b eql_v3.query_text_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope +--! @param b {{prefix}}.query_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_text_ord_ope, b eql_v3.query_text_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ope. ---! @param a eql_v3.query_text_ord_ope ---! @param b public.eql_v3_text_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. +--! @param a {{prefix}}.query_text_ord_ope +--! @param b public.{{prefix}}_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_text_ord_ope, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope ---! @param b eql_v3.query_text_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope +--! @param b {{prefix}}.query_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_text_ord_ope, b eql_v3.query_text_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ope. ---! @param a eql_v3.query_text_ord_ope ---! @param b public.eql_v3_text_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. +--! @param a {{prefix}}.query_text_ord_ope +--! @param b public.{{prefix}}_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_text_ord_ope, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope ---! @param b eql_v3.query_text_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope +--! @param b {{prefix}}.query_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_text_ord_ope, b eql_v3.query_text_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ope. ---! @param a eql_v3.query_text_ord_ope ---! @param b public.eql_v3_text_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. +--! @param a {{prefix}}.query_text_ord_ope +--! @param b public.{{prefix}}_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_text_ord_ope, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/text/query_text_ord_ope_operators.sql b/packages/eql/src/v3/scalars/text/query_text_ord_ope_operators.sql index 50f68e8b7..2e15e64d4 100644 --- a/packages/eql/src/v3/scalars/text/query_text_ord_ope_operators.sql +++ b/packages/eql/src/v3/scalars/text/query_text_ord_ope_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/text/query_text_ord_ope_functions.sql --! @file encrypted_domain/text/query_text_ord_ope_operators.sql ---! @brief Operators for eql_v3.query_text_ord_ope. +--! @brief Operators for {{prefix}}.query_text_ord_ope. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = eql_v3.query_text_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_text_ord_ope, RIGHTARG = public.eql_v3_text_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = eql_v3.query_text_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_text_ord_ope, RIGHTARG = public.eql_v3_text_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = eql_v3.query_text_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_text_ord_ope, RIGHTARG = public.eql_v3_text_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = eql_v3.query_text_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_text_ord_ope, RIGHTARG = public.eql_v3_text_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = eql_v3.query_text_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_text_ord_ope, RIGHTARG = public.eql_v3_text_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = eql_v3.query_text_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_text_ord_ope, RIGHTARG = public.eql_v3_text_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/text/query_text_ord_operators.sql b/packages/eql/src/v3/scalars/text/query_text_ord_operators.sql index 0e7d9be4b..8313a604a 100644 --- a/packages/eql/src/v3/scalars/text/query_text_ord_operators.sql +++ b/packages/eql/src/v3/scalars/text/query_text_ord_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/text/query_text_ord_functions.sql --! @file encrypted_domain/text/query_text_ord_operators.sql ---! @brief Operators for eql_v3.query_text_ord. +--! @brief Operators for {{prefix}}.query_text_ord. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = eql_v3.query_text_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_text_ord, RIGHTARG = public.eql_v3_text_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = eql_v3.query_text_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_text_ord, RIGHTARG = public.eql_v3_text_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = eql_v3.query_text_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_text_ord, RIGHTARG = public.eql_v3_text_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = eql_v3.query_text_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_text_ord, RIGHTARG = public.eql_v3_text_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = eql_v3.query_text_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_text_ord, RIGHTARG = public.eql_v3_text_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = eql_v3.query_text_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_text_ord, RIGHTARG = public.eql_v3_text_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/text/query_text_ord_ore_functions.sql b/packages/eql/src/v3/scalars/text/query_text_ord_ore_functions.sql index d790a4396..f0f4b99f2 100644 --- a/packages/eql/src/v3/scalars/text/query_text_ord_ore_functions.sql +++ b/packages/eql/src/v3/scalars/text/query_text_ord_ore_functions.sql @@ -4,116 +4,116 @@ -- REQUIRE: src/v3/scalars/text/text_ord_ore_functions.sql --! @file encrypted_domain/text/query_text_ord_ore_functions.sql ---! @brief Functions for eql_v3.query_text_ord_ore. +--! @brief Functions for {{prefix}}.query_text_ord_ore. ---! @brief Index extractor for eql_v3.query_text_ord_ore. ---! @param a eql_v3.query_text_ord_ore ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a eql_v3.query_text_ord_ore) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for {{prefix}}.query_text_ord_ore. +--! @param a {{prefix}}.query_text_ord_ore +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a {{prefix}}.query_text_ord_ore) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Index extractor for eql_v3.query_text_ord_ore. ---! @param a eql_v3.query_text_ord_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a eql_v3.query_text_ord_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for {{prefix}}.query_text_ord_ore. +--! @param a {{prefix}}.query_text_ord_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a {{prefix}}.query_text_ord_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore ---! @param b eql_v3.query_text_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore +--! @param b {{prefix}}.query_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_text_ord_ore, b eql_v3.query_text_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ore. ---! @param a eql_v3.query_text_ord_ore ---! @param b public.eql_v3_text_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. +--! @param a {{prefix}}.query_text_ord_ore +--! @param b public.{{prefix}}_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_text_ord_ore, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore ---! @param b eql_v3.query_text_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore +--! @param b {{prefix}}.query_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_text_ord_ore, b eql_v3.query_text_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ore. ---! @param a eql_v3.query_text_ord_ore ---! @param b public.eql_v3_text_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. +--! @param a {{prefix}}.query_text_ord_ore +--! @param b public.{{prefix}}_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_text_ord_ore, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore ---! @param b eql_v3.query_text_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore +--! @param b {{prefix}}.query_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_text_ord_ore, b eql_v3.query_text_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ore. ---! @param a eql_v3.query_text_ord_ore ---! @param b public.eql_v3_text_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. +--! @param a {{prefix}}.query_text_ord_ore +--! @param b public.{{prefix}}_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_text_ord_ore, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore ---! @param b eql_v3.query_text_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore +--! @param b {{prefix}}.query_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_text_ord_ore, b eql_v3.query_text_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ore. ---! @param a eql_v3.query_text_ord_ore ---! @param b public.eql_v3_text_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. +--! @param a {{prefix}}.query_text_ord_ore +--! @param b public.{{prefix}}_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_text_ord_ore, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore ---! @param b eql_v3.query_text_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore +--! @param b {{prefix}}.query_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_text_ord_ore, b eql_v3.query_text_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ore. ---! @param a eql_v3.query_text_ord_ore ---! @param b public.eql_v3_text_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. +--! @param a {{prefix}}.query_text_ord_ore +--! @param b public.{{prefix}}_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_text_ord_ore, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore ---! @param b eql_v3.query_text_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore +--! @param b {{prefix}}.query_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_text_ord_ore, b eql_v3.query_text_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_ord_ore. ---! @param a eql_v3.query_text_ord_ore ---! @param b public.eql_v3_text_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. +--! @param a {{prefix}}.query_text_ord_ore +--! @param b public.{{prefix}}_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_text_ord_ore, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; diff --git a/packages/eql/src/v3/scalars/text/query_text_ord_ore_operators.sql b/packages/eql/src/v3/scalars/text/query_text_ord_ore_operators.sql index a7526f6f9..52d75e747 100644 --- a/packages/eql/src/v3/scalars/text/query_text_ord_ore_operators.sql +++ b/packages/eql/src/v3/scalars/text/query_text_ord_ore_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/text/query_text_ord_ore_functions.sql --! @file encrypted_domain/text/query_text_ord_ore_operators.sql ---! @brief Operators for eql_v3.query_text_ord_ore. +--! @brief Operators for {{prefix}}.query_text_ord_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = eql_v3.query_text_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_text_ord_ore, RIGHTARG = public.eql_v3_text_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = eql_v3.query_text_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_text_ord_ore, RIGHTARG = public.eql_v3_text_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = eql_v3.query_text_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_text_ord_ore, RIGHTARG = public.eql_v3_text_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = eql_v3.query_text_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_text_ord_ore, RIGHTARG = public.eql_v3_text_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = eql_v3.query_text_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_text_ord_ore, RIGHTARG = public.eql_v3_text_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = eql_v3.query_text_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_text_ord_ore, RIGHTARG = public.eql_v3_text_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/text/query_text_range_functions.sql b/packages/eql/src/v3/scalars/text/query_text_range_functions.sql new file mode 100644 index 000000000..34735635d --- /dev/null +++ b/packages/eql/src/v3/scalars/text/query_text_range_functions.sql @@ -0,0 +1,244 @@ +-- AUTOMATICALLY GENERATED FILE. +-- ONLY EQL VERSION: 4 +-- REQUIRE: src/v3/schema.sql +-- REQUIRE: src/v3/scalars/text/query_text_range_types.sql +-- REQUIRE: src/v3/scalars/text/text_ord_ore_functions.sql +-- REQUIRE: src/v3/scalars/text/text_search_ore_functions.sql +-- REQUIRE: src/v3/scalars/text/text_ord_functions.sql +-- REQUIRE: src/v3/scalars/text/text_ord_ope_functions.sql +-- REQUIRE: src/v3/scalars/text/text_search_functions.sql +-- REQUIRE: src/v3/sem/ore_block_256/functions.sql +-- REQUIRE: src/v3/sem/ore_block_256/operators.sql +-- REQUIRE: src/v3/sem/ope_cllw/functions.sql + +--! @file v3/scalars/text/query_text_range_functions.sql +--! @brief The bound accessors and `{{prefix}}.between` for text's range query domains. +--! @note EQL version {{eql_version}} only, like the range domains themselves. + +--! @brief The low bound of a {{prefix}}.query_text_range_ore, as a block ORE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_text_range_ore Range query operand +--! @return {{prefix}}_internal.ore_block_256 The low bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.lo(r {{prefix}}.query_text_range_ore) +RETURNS {{prefix}}_internal.ore_block_256 +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ore_block_256(jsonb_build_object('ob', r::jsonb -> 'lo')) $$; + +--! @brief The high bound of a {{prefix}}.query_text_range_ore, as a block ORE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_text_range_ore Range query operand +--! @return {{prefix}}_internal.ore_block_256 The high bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.hi(r {{prefix}}.query_text_range_ore) +RETURNS {{prefix}}_internal.ore_block_256 +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ore_block_256(jsonb_build_object('ob', r::jsonb -> 'hi')) $$; + +--! @brief The low bound of a {{prefix}}.query_text_range_ope, as a CLLW OPE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_text_range_ope Range query operand +--! @return {{prefix}}_internal.ope_cllw The low bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.lo(r {{prefix}}.query_text_range_ope) +RETURNS {{prefix}}_internal.ope_cllw +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> 'lo')) $$; + +--! @brief The high bound of a {{prefix}}.query_text_range_ope, as a CLLW OPE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_text_range_ope Range query operand +--! @return {{prefix}}_internal.ope_cllw The high bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.hi(r {{prefix}}.query_text_range_ope) +RETURNS {{prefix}}_internal.ope_cllw +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> 'hi')) $$; + +--! @brief Whether a public.{{prefix}}_text_ord_ore value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_text_range_ore)`. +--! +--! @param a public.{{prefix}}_text_ord_ore Encrypted column value +--! @param r {{prefix}}.query_text_range_ore Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term_ore(a)`, which a btree index on that expression +--! serves as one range scan. For this ORE range that index needs the +--! default btree operator class on {{prefix}}_internal.ore_block_256, which the +--! installer creates only with superuser privileges. Without it (on Supabase, +--! for instance) the installer disables the ORE column domains and this ORE range, +--! so use an OPE column (`public.{{prefix}}_text_ord`, `public.{{prefix}}_text_ord_ope`, `public.{{prefix}}_text_search`) +--! and `{{prefix}}.query_text_range_ope`, which index everywhere. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_text_range_ore`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_text_ord_ore, r {{prefix}}.query_text_range_ore) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_text_search_ore value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_text_range_ore)`. +--! +--! @param a public.{{prefix}}_text_search_ore Encrypted column value +--! @param r {{prefix}}.query_text_range_ore Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term_ore(a)`, which a btree index on that expression +--! serves as one range scan. For this ORE range that index needs the +--! default btree operator class on {{prefix}}_internal.ore_block_256, which the +--! installer creates only with superuser privileges. Without it (on Supabase, +--! for instance) the installer disables the ORE column domains and this ORE range, +--! so use an OPE column (`public.{{prefix}}_text_ord`, `public.{{prefix}}_text_ord_ope`, `public.{{prefix}}_text_search`) +--! and `{{prefix}}.query_text_range_ope`, which index everywhere. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_text_range_ore`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_text_search_ore, r {{prefix}}.query_text_range_ore) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_text_ord value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_text_range_ope)`. +--! +--! @param a public.{{prefix}}_text_ord Encrypted column value +--! @param r {{prefix}}.query_text_range_ope Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term(a)`, which a btree index on that expression +--! serves as one range scan. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_text_range_ope`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_text_ord, r {{prefix}}.query_text_range_ope) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_text_ord_ope value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_text_range_ope)`. +--! +--! @param a public.{{prefix}}_text_ord_ope Encrypted column value +--! @param r {{prefix}}.query_text_range_ope Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term(a)`, which a btree index on that expression +--! serves as one range scan. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_text_range_ope`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_text_ord_ope, r {{prefix}}.query_text_range_ope) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_text_search value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_text_range_ope)`. +--! +--! @param a public.{{prefix}}_text_search Encrypted column value +--! @param r {{prefix}}.query_text_range_ope Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term(a)`, which a btree index on that expression +--! serves as one range scan. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_text_range_ope`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_text_search, r {{prefix}}.query_text_range_ope) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r) $$; diff --git a/packages/eql/src/v3/scalars/text/query_text_range_types.sql b/packages/eql/src/v3/scalars/text/query_text_range_types.sql new file mode 100644 index 000000000..4b1fb707f --- /dev/null +++ b/packages/eql/src/v3/scalars/text/query_text_range_types.sql @@ -0,0 +1,107 @@ +-- AUTOMATICALLY GENERATED FILE. +-- ONLY EQL VERSION: 4 +-- REQUIRE: src/v3/schema.sql +-- REQUIRE: src/v3/scalars/ore_fallback.sql + +--! @file v3/scalars/text/query_text_range_types.sql +--! @brief Range query-operand domains for text: the operand of `{{prefix}}.between`. +--! @note A range holds both bounds of one `BETWEEN` as one value: +--! `{"v": {{eql_version}}, "i": {...}, "lo": , "hi": }`. Each bound is the +--! single-bound query domain's `ob` (ORE) or `op` (OPE) value, in a +--! `{v, i, lo, hi}` envelope. Both bounds are included. There is one +--! range domain per ordering term the family stores (ADR-0009, +--! decisions 7 and 8). +--! @note Cast the range parameter to its exact range domain +--! (`$1::{{prefix}}.query_text_range_ore`). An uncast `$1`, a `jsonb` +--! parameter, or a range of another term or family fails with 42725 +--! ("function ... is not unique"); see `{{prefix}}.between`. +--! @note EQL version {{eql_version}} only: the `-- ONLY EQL VERSION:` line above keeps this +--! file out of every other version's installer. +--! @note Like every query operand, a range lives in `{{prefix}}`, not `public`, +--! and holds no ciphertext `c`. A range whose low bound is above its +--! high bound matches no row, as with SQL `BETWEEN`; the SQL does not +--! reorder the bounds. +--! @note On an install without the ORE operator class (a non-superuser +--! install, on Supabase for instance), the ORE range domain is disabled +--! as the single-bound ORE domains are: a value cast to it raises +--! `feature_not_supported`, naming the OPE range. See +--! `v3/scalars/ore_fallback.sql`. + +DO $$ +BEGIN + --! @brief Range query-operand domain {{prefix}}.query_text_range_ore (two block ORE bounds; no `c`). + IF NOT EXISTS ( + SELECT 1 FROM pg_type + WHERE typname = 'query_text_range_ore' AND typnamespace = '{{prefix}}'::regnamespace + ) THEN + CREATE DOMAIN {{prefix}}.query_text_range_ore AS jsonb + CHECK ( + jsonb_typeof(VALUE) = 'object' + AND VALUE ? 'v' + AND VALUE ? 'i' + AND VALUE ? 'lo' + AND VALUE ? 'hi' + AND NOT (VALUE ? 'c') + AND jsonb_typeof(VALUE -> 'lo') = 'array' + AND jsonb_array_length(VALUE -> 'lo') > 0 + AND jsonb_typeof(VALUE -> 'hi') = 'array' + AND jsonb_array_length(VALUE -> 'hi') > 0 + -- `"v": null` makes the comparison NULL, and a CHECK that is NULL + -- passes, so COALESCE refuses it. A NULL range still passes (no row + -- matches it). The comparison keeps the one form the v4 isolation + -- gate accepts. + AND COALESCE(VALUE->>'v' = '{{eql_version}}', VALUE IS NULL) + ); + END IF; + + COMMENT ON DOMAIN {{prefix}}.query_text_range_ore IS 'EQL text range query operand (block ORE)'; + + --! @brief Range query-operand domain {{prefix}}.query_text_range_ope (two CLLW OPE bounds; no `c`). + IF NOT EXISTS ( + SELECT 1 FROM pg_type + WHERE typname = 'query_text_range_ope' AND typnamespace = '{{prefix}}'::regnamespace + ) THEN + CREATE DOMAIN {{prefix}}.query_text_range_ope AS jsonb + CHECK ( + jsonb_typeof(VALUE) = 'object' + AND VALUE ? 'v' + AND VALUE ? 'i' + AND VALUE ? 'lo' + AND VALUE ? 'hi' + AND NOT (VALUE ? 'c') + AND jsonb_typeof(VALUE -> 'lo') = 'string' + AND jsonb_typeof(VALUE -> 'hi') = 'string' + -- `"v": null` makes the comparison NULL, and a CHECK that is NULL + -- passes, so COALESCE refuses it. A NULL range still passes (no row + -- matches it). The comparison keeps the one form the v4 isolation + -- gate accepts. + AND COALESCE(VALUE->>'v' = '{{eql_version}}', VALUE IS NULL) + ); + END IF; + + COMMENT ON DOMAIN {{prefix}}.query_text_range_ope IS 'EQL text range query operand (CLLW OPE)'; +END +$$; + +-- Without the default btree operator class on {{prefix}}_internal.ore_block_256 +-- (the installer skips it on insufficient_privilege), ore_fallback.sql has +-- created {{prefix}}_internal.ore_domain_unavailable and poisoned the +-- single-bound ORE domains. It cannot reach this ORE range, which exists in +-- EQL v4 only, so the same NOT VALID poison CHECK is added here. +DO $do$ +BEGIN + IF EXISTS ( + SELECT 1 + FROM pg_catalog.pg_opclass c + JOIN pg_catalog.pg_am am ON am.oid = c.opcmethod + WHERE am.amname = 'btree' + AND c.opcdefault + AND c.opcintype = '{{prefix}}_internal.ore_block_256'::pg_catalog.regtype + ) THEN + RETURN; + END IF; + + ALTER DOMAIN {{prefix}}.query_text_range_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, '{{prefix}}.query_text_range_ore', '{{prefix}}.query_text_range_ope (range)')) NOT VALID; +END; +$do$; diff --git a/packages/eql/src/v3/scalars/text/query_text_search_functions.sql b/packages/eql/src/v3/scalars/text/query_text_search_functions.sql index c5f472ac1..0bc6d563b 100644 --- a/packages/eql/src/v3/scalars/text/query_text_search_functions.sql +++ b/packages/eql/src/v3/scalars/text/query_text_search_functions.sql @@ -4,140 +4,140 @@ -- REQUIRE: src/v3/scalars/text/text_search_functions.sql --! @file encrypted_domain/text/query_text_search_functions.sql ---! @brief Functions for eql_v3.query_text_search. +--! @brief Functions for {{prefix}}.query_text_search. ---! @brief Index extractor for eql_v3.query_text_search. ---! @param a eql_v3.query_text_search ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a eql_v3.query_text_search) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for {{prefix}}.query_text_search. +--! @param a {{prefix}}.query_text_search +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a {{prefix}}.query_text_search) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Index extractor for eql_v3.query_text_search. ---! @param a eql_v3.query_text_search ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a eql_v3.query_text_search) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for {{prefix}}.query_text_search. +--! @param a {{prefix}}.query_text_search +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a {{prefix}}.query_text_search) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Index extractor for eql_v3.query_text_search. ---! @param a eql_v3.query_text_search ---! @return eql_v3_internal.bloom_filter -CREATE FUNCTION eql_v3.match_term(a eql_v3.query_text_search) -RETURNS eql_v3_internal.bloom_filter +--! @brief Index extractor for {{prefix}}.query_text_search. +--! @param a {{prefix}}.query_text_search +--! @return {{prefix}}_internal.bloom_filter +CREATE FUNCTION {{prefix}}.match_term(a {{prefix}}.query_text_search) +RETURNS {{prefix}}_internal.bloom_filter LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.bloom_filter(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.bloom_filter(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_text_search. ---! @param a public.eql_v3_text_search ---! @param b eql_v3.query_text_search +--! @brief Operator wrapper for {{prefix}}.query_text_search. +--! @param a public.{{prefix}}_text_search +--! @param b {{prefix}}.query_text_search --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_text_search, b eql_v3.query_text_search) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search. ---! @param a eql_v3.query_text_search ---! @param b public.eql_v3_text_search +--! @brief Operator wrapper for {{prefix}}.query_text_search. +--! @param a {{prefix}}.query_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_text_search, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search. ---! @param a public.eql_v3_text_search ---! @param b eql_v3.query_text_search +--! @brief Operator wrapper for {{prefix}}.query_text_search. +--! @param a public.{{prefix}}_text_search +--! @param b {{prefix}}.query_text_search --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_text_search, b eql_v3.query_text_search) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search. ---! @param a eql_v3.query_text_search ---! @param b public.eql_v3_text_search +--! @brief Operator wrapper for {{prefix}}.query_text_search. +--! @param a {{prefix}}.query_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_text_search, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search. ---! @param a public.eql_v3_text_search ---! @param b eql_v3.query_text_search +--! @brief Operator wrapper for {{prefix}}.query_text_search. +--! @param a public.{{prefix}}_text_search +--! @param b {{prefix}}.query_text_search --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_text_search, b eql_v3.query_text_search) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search. ---! @param a eql_v3.query_text_search ---! @param b public.eql_v3_text_search +--! @brief Operator wrapper for {{prefix}}.query_text_search. +--! @param a {{prefix}}.query_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_text_search, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search. ---! @param a public.eql_v3_text_search ---! @param b eql_v3.query_text_search +--! @brief Operator wrapper for {{prefix}}.query_text_search. +--! @param a public.{{prefix}}_text_search +--! @param b {{prefix}}.query_text_search --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_text_search, b eql_v3.query_text_search) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search. ---! @param a eql_v3.query_text_search ---! @param b public.eql_v3_text_search +--! @brief Operator wrapper for {{prefix}}.query_text_search. +--! @param a {{prefix}}.query_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_text_search, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search. ---! @param a public.eql_v3_text_search ---! @param b eql_v3.query_text_search +--! @brief Operator wrapper for {{prefix}}.query_text_search. +--! @param a public.{{prefix}}_text_search +--! @param b {{prefix}}.query_text_search --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_text_search, b eql_v3.query_text_search) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search. ---! @param a eql_v3.query_text_search ---! @param b public.eql_v3_text_search +--! @brief Operator wrapper for {{prefix}}.query_text_search. +--! @param a {{prefix}}.query_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_text_search, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search. ---! @param a public.eql_v3_text_search ---! @param b eql_v3.query_text_search +--! @brief Operator wrapper for {{prefix}}.query_text_search. +--! @param a public.{{prefix}}_text_search +--! @param b {{prefix}}.query_text_search --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_text_search, b eql_v3.query_text_search) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search. ---! @param a eql_v3.query_text_search ---! @param b public.eql_v3_text_search +--! @brief Operator wrapper for {{prefix}}.query_text_search. +--! @param a {{prefix}}.query_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_text_search, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search. ---! @param a public.eql_v3_text_search ---! @param b eql_v3.query_text_search +--! @brief Operator wrapper for {{prefix}}.query_text_search. +--! @param a public.{{prefix}}_text_search +--! @param b {{prefix}}.query_text_search --! @return boolean -CREATE FUNCTION eql_v3.matches(a public.eql_v3_text_search, b eql_v3.query_text_search) +CREATE FUNCTION {{prefix}}.matches(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT eql_v3.match_term(a) @> eql_v3.match_term(b) AND (cardinality(eql_v3.match_term(b)) > 0 OR cardinality(eql_v3.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; ---! @brief Operator wrapper for eql_v3.query_text_search. ---! @param a eql_v3.query_text_search ---! @param b public.eql_v3_text_search +--! @brief Operator wrapper for {{prefix}}.query_text_search. +--! @param a {{prefix}}.query_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.matches(a eql_v3.query_text_search, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.matches(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT eql_v3.match_term(a) @> eql_v3.match_term(b) AND (cardinality(eql_v3.match_term(b)) > 0 OR cardinality(eql_v3.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; diff --git a/packages/eql/src/v3/scalars/text/query_text_search_operators.sql b/packages/eql/src/v3/scalars/text/query_text_search_operators.sql index 6a5502c37..546618c7e 100644 --- a/packages/eql/src/v3/scalars/text/query_text_search_operators.sql +++ b/packages/eql/src/v3/scalars/text/query_text_search_operators.sql @@ -4,88 +4,88 @@ -- REQUIRE: src/v3/scalars/text/query_text_search_functions.sql --! @file encrypted_domain/text/query_text_search_operators.sql ---! @brief Operators for eql_v3.query_text_search. +--! @brief Operators for {{prefix}}.query_text_search. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_text_search, RIGHTARG = eql_v3.query_text_search, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_search, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_text_search, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_search, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_text_search, RIGHTARG = eql_v3.query_text_search, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_search, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_text_search, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_search, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_text_search, RIGHTARG = eql_v3.query_text_search, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_search, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_text_search, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_search, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_text_search, RIGHTARG = eql_v3.query_text_search, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_search, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_text_search, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_search, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_text_search, RIGHTARG = eql_v3.query_text_search, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_search, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_text_search, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_search, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_text_search, RIGHTARG = eql_v3.query_text_search, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_search, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_text_search, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_search, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3.matches, - LEFTARG = public.eql_v3_text_search, RIGHTARG = eql_v3.query_text_search, + FUNCTION = {{prefix}}.matches, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_search, RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3.matches, - LEFTARG = eql_v3.query_text_search, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.matches, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_search, RESTRICT = contsel, JOIN = contjoinsel ); diff --git a/packages/eql/src/v3/scalars/text/query_text_search_ore_functions.sql b/packages/eql/src/v3/scalars/text/query_text_search_ore_functions.sql index 205a47be1..4f1f4e94a 100644 --- a/packages/eql/src/v3/scalars/text/query_text_search_ore_functions.sql +++ b/packages/eql/src/v3/scalars/text/query_text_search_ore_functions.sql @@ -4,140 +4,140 @@ -- REQUIRE: src/v3/scalars/text/text_search_ore_functions.sql --! @file encrypted_domain/text/query_text_search_ore_functions.sql ---! @brief Functions for eql_v3.query_text_search_ore. +--! @brief Functions for {{prefix}}.query_text_search_ore. ---! @brief Index extractor for eql_v3.query_text_search_ore. ---! @param a eql_v3.query_text_search_ore ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a eql_v3.query_text_search_ore) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for {{prefix}}.query_text_search_ore. +--! @param a {{prefix}}.query_text_search_ore +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a {{prefix}}.query_text_search_ore) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Index extractor for eql_v3.query_text_search_ore. ---! @param a eql_v3.query_text_search_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a eql_v3.query_text_search_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for {{prefix}}.query_text_search_ore. +--! @param a {{prefix}}.query_text_search_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a {{prefix}}.query_text_search_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Index extractor for eql_v3.query_text_search_ore. ---! @param a eql_v3.query_text_search_ore ---! @return eql_v3_internal.bloom_filter -CREATE FUNCTION eql_v3.match_term(a eql_v3.query_text_search_ore) -RETURNS eql_v3_internal.bloom_filter +--! @brief Index extractor for {{prefix}}.query_text_search_ore. +--! @param a {{prefix}}.query_text_search_ore +--! @return {{prefix}}_internal.bloom_filter +CREATE FUNCTION {{prefix}}.match_term(a {{prefix}}.query_text_search_ore) +RETURNS {{prefix}}_internal.bloom_filter LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.bloom_filter(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.bloom_filter(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_text_search_ore. ---! @param a public.eql_v3_text_search_ore ---! @param b eql_v3.query_text_search_ore +--! @brief Operator wrapper for {{prefix}}.query_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore +--! @param b {{prefix}}.query_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_text_search_ore, b eql_v3.query_text_search_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search_ore. ---! @param a eql_v3.query_text_search_ore ---! @param b public.eql_v3_text_search_ore +--! @brief Operator wrapper for {{prefix}}.query_text_search_ore. +--! @param a {{prefix}}.query_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_text_search_ore, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search_ore. ---! @param a public.eql_v3_text_search_ore ---! @param b eql_v3.query_text_search_ore +--! @brief Operator wrapper for {{prefix}}.query_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore +--! @param b {{prefix}}.query_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_text_search_ore, b eql_v3.query_text_search_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search_ore. ---! @param a eql_v3.query_text_search_ore ---! @param b public.eql_v3_text_search_ore +--! @brief Operator wrapper for {{prefix}}.query_text_search_ore. +--! @param a {{prefix}}.query_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_text_search_ore, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search_ore. ---! @param a public.eql_v3_text_search_ore ---! @param b eql_v3.query_text_search_ore +--! @brief Operator wrapper for {{prefix}}.query_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore +--! @param b {{prefix}}.query_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_text_search_ore, b eql_v3.query_text_search_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search_ore. ---! @param a eql_v3.query_text_search_ore ---! @param b public.eql_v3_text_search_ore +--! @brief Operator wrapper for {{prefix}}.query_text_search_ore. +--! @param a {{prefix}}.query_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_text_search_ore, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search_ore. ---! @param a public.eql_v3_text_search_ore ---! @param b eql_v3.query_text_search_ore +--! @brief Operator wrapper for {{prefix}}.query_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore +--! @param b {{prefix}}.query_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_text_search_ore, b eql_v3.query_text_search_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search_ore. ---! @param a eql_v3.query_text_search_ore ---! @param b public.eql_v3_text_search_ore +--! @brief Operator wrapper for {{prefix}}.query_text_search_ore. +--! @param a {{prefix}}.query_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_text_search_ore, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search_ore. ---! @param a public.eql_v3_text_search_ore ---! @param b eql_v3.query_text_search_ore +--! @brief Operator wrapper for {{prefix}}.query_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore +--! @param b {{prefix}}.query_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_text_search_ore, b eql_v3.query_text_search_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search_ore. ---! @param a eql_v3.query_text_search_ore ---! @param b public.eql_v3_text_search_ore +--! @brief Operator wrapper for {{prefix}}.query_text_search_ore. +--! @param a {{prefix}}.query_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_text_search_ore, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search_ore. ---! @param a public.eql_v3_text_search_ore ---! @param b eql_v3.query_text_search_ore +--! @brief Operator wrapper for {{prefix}}.query_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore +--! @param b {{prefix}}.query_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_text_search_ore, b eql_v3.query_text_search_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search_ore. ---! @param a eql_v3.query_text_search_ore ---! @param b public.eql_v3_text_search_ore +--! @brief Operator wrapper for {{prefix}}.query_text_search_ore. +--! @param a {{prefix}}.query_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_text_search_ore, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_text_search_ore. ---! @param a public.eql_v3_text_search_ore ---! @param b eql_v3.query_text_search_ore +--! @brief Operator wrapper for {{prefix}}.query_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore +--! @param b {{prefix}}.query_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.matches(a public.eql_v3_text_search_ore, b eql_v3.query_text_search_ore) +CREATE FUNCTION {{prefix}}.matches(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT eql_v3.match_term(a) @> eql_v3.match_term(b) AND (cardinality(eql_v3.match_term(b)) > 0 OR cardinality(eql_v3.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; ---! @brief Operator wrapper for eql_v3.query_text_search_ore. ---! @param a eql_v3.query_text_search_ore ---! @param b public.eql_v3_text_search_ore +--! @brief Operator wrapper for {{prefix}}.query_text_search_ore. +--! @param a {{prefix}}.query_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.matches(a eql_v3.query_text_search_ore, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.matches(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT eql_v3.match_term(a) @> eql_v3.match_term(b) AND (cardinality(eql_v3.match_term(b)) > 0 OR cardinality(eql_v3.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; diff --git a/packages/eql/src/v3/scalars/text/query_text_search_ore_operators.sql b/packages/eql/src/v3/scalars/text/query_text_search_ore_operators.sql index 0a78693fe..1d148ee5f 100644 --- a/packages/eql/src/v3/scalars/text/query_text_search_ore_operators.sql +++ b/packages/eql/src/v3/scalars/text/query_text_search_ore_operators.sql @@ -4,88 +4,88 @@ -- REQUIRE: src/v3/scalars/text/query_text_search_ore_functions.sql --! @file encrypted_domain/text/query_text_search_ore_operators.sql ---! @brief Operators for eql_v3.query_text_search_ore. +--! @brief Operators for {{prefix}}.query_text_search_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = eql_v3.query_text_search_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_search_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_text_search_ore, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_search_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = eql_v3.query_text_search_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_search_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_text_search_ore, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_search_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = eql_v3.query_text_search_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_search_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_text_search_ore, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_search_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = eql_v3.query_text_search_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_search_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_text_search_ore, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_search_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = eql_v3.query_text_search_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_search_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_text_search_ore, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_search_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = eql_v3.query_text_search_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_search_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_text_search_ore, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_search_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3.matches, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = eql_v3.query_text_search_ore, + FUNCTION = {{prefix}}.matches, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_search_ore, RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3.matches, - LEFTARG = eql_v3.query_text_search_ore, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.matches, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_search_ore, RESTRICT = contsel, JOIN = contjoinsel ); diff --git a/packages/eql/src/v3/scalars/text/query_text_types.sql b/packages/eql/src/v3/scalars/text/query_text_types.sql index eec1a886e..9360a9fbf 100644 --- a/packages/eql/src/v3/scalars/text/query_text_types.sql +++ b/packages/eql/src/v3/scalars/text/query_text_types.sql @@ -3,59 +3,59 @@ --! @file v3/scalars/text/query_text_types.sql --! @brief Query-operand domains for text (index-terms-only, no ciphertext). ---! @note Query-operand domains live in `eql_v3` (not `public`): they are +--! @note Query-operand domains live in `{{prefix}}` (not `public`): they are --! never valid column types, so they don't belong in the column-type --! namespace, and dropping the EQL-owned schema can never drop an --! application column. --! @note Cast a query operand explicitly to its `query_` domain in a predicate ---! (e.g. `WHERE col = $1::eql_v3.query_text_eq`). A bare, +--! (e.g. `WHERE col = $1::{{prefix}}.query_text_eq`). A bare, --! uncast literal RHS is ambiguous between the `query_` and `jsonb` --! operator overloads and will not resolve. DO $$ BEGIN - --! @brief Query-operand domain eql_v3.query_text_eq (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_text_eq (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_text_eq' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_text_eq' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_text_eq AS jsonb + CREATE DOMAIN {{prefix}}.query_text_eq AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'hm' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_text_eq IS 'EQL text query operand (equality)'; + COMMENT ON DOMAIN {{prefix}}.query_text_eq IS 'EQL text query operand (equality)'; - --! @brief Query-operand domain eql_v3.query_text_match (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_text_match (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_text_match' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_text_match' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_text_match AS jsonb + CREATE DOMAIN {{prefix}}.query_text_match AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'bf' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_text_match IS 'EQL text query operand (matching)'; + COMMENT ON DOMAIN {{prefix}}.query_text_match IS 'EQL text query operand (matching)'; - --! @brief Query-operand domain eql_v3.query_text_ord_ore (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_text_ord_ore (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_text_ord_ore' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_text_ord_ore' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_text_ord_ore AS jsonb + CREATE DOMAIN {{prefix}}.query_text_ord_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -65,18 +65,18 @@ BEGIN AND NOT (VALUE ? 'c') AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_text_ord_ore IS 'EQL text query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_text_ord_ore IS 'EQL text query operand (equality, ordering)'; - --! @brief Query-operand domain eql_v3.query_text_ord (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_text_ord (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_text_ord' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_text_ord' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_text_ord AS jsonb + CREATE DOMAIN {{prefix}}.query_text_ord AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -84,18 +84,18 @@ BEGIN AND VALUE ? 'hm' AND VALUE ? 'op' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_text_ord IS 'EQL text query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_text_ord IS 'EQL text query operand (equality, ordering)'; - --! @brief Query-operand domain eql_v3.query_text_ord_ope (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_text_ord_ope (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_text_ord_ope' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_text_ord_ope' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_text_ord_ope AS jsonb + CREATE DOMAIN {{prefix}}.query_text_ord_ope AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -103,18 +103,18 @@ BEGIN AND VALUE ? 'hm' AND VALUE ? 'op' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_text_ord_ope IS 'EQL text query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_text_ord_ope IS 'EQL text query operand (equality, ordering)'; - --! @brief Query-operand domain eql_v3.query_text_search_ore (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_text_search_ore (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_text_search_ore' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_text_search_ore' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_text_search_ore AS jsonb + CREATE DOMAIN {{prefix}}.query_text_search_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -125,18 +125,18 @@ BEGIN AND NOT (VALUE ? 'c') AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_text_search_ore IS 'EQL text query operand (equality, ordering, matching)'; + COMMENT ON DOMAIN {{prefix}}.query_text_search_ore IS 'EQL text query operand (equality, ordering, matching)'; - --! @brief Query-operand domain eql_v3.query_text_search (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_text_search (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_text_search' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_text_search' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_text_search AS jsonb + CREATE DOMAIN {{prefix}}.query_text_search AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -145,10 +145,10 @@ BEGIN AND VALUE ? 'op' AND VALUE ? 'bf' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_text_search IS 'EQL text query operand (equality, ordering, matching)'; + COMMENT ON DOMAIN {{prefix}}.query_text_search IS 'EQL text query operand (equality, ordering, matching)'; END $$; diff --git a/packages/eql/src/v3/scalars/text/text_eq_functions.sql b/packages/eql/src/v3/scalars/text/text_eq_functions.sql index 2bdd95fcf..bbdc0441f 100644 --- a/packages/eql/src/v3/scalars/text/text_eq_functions.sql +++ b/packages/eql/src/v3/scalars/text/text_eq_functions.sql @@ -5,634 +5,634 @@ -- REQUIRE: src/v3/sem/hmac_256/functions.sql --! @file encrypted_domain/text/text_eq_functions.sql ---! @brief Functions for public.eql_v3_text_eq. +--! @brief Functions for public.{{prefix}}_text_eq. ---! @brief Index extractor for public.eql_v3_text_eq. ---! @param a public.eql_v3_text_eq ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a public.eql_v3_text_eq) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for public.{{prefix}}_text_eq. +--! @param a public.{{prefix}}_text_eq +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a public.{{prefix}}_text_eq) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_text_eq. ---! @param a public.eql_v3_text_eq ---! @param b public.eql_v3_text_eq +--! @brief Operator wrapper for public.{{prefix}}_text_eq. +--! @param a public.{{prefix}}_text_eq +--! @param b public.{{prefix}}_text_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_text_eq, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_eq, b public.{{prefix}}_text_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_eq. ---! @param a public.eql_v3_text_eq +--! @brief Operator wrapper for public.{{prefix}}_text_eq. +--! @param a public.{{prefix}}_text_eq --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_text_eq, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b::public.eql_v3_text_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_text_eq) $$; ---! @brief Operator wrapper for public.eql_v3_text_eq. +--! @brief Operator wrapper for public.{{prefix}}_text_eq. --! @param a jsonb ---! @param b public.eql_v3_text_eq +--! @param b public.{{prefix}}_text_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_text_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_text_eq) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_eq) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_eq. ---! @param a public.eql_v3_text_eq ---! @param b public.eql_v3_text_eq +--! @brief Operator wrapper for public.{{prefix}}_text_eq. +--! @param a public.{{prefix}}_text_eq +--! @param b public.{{prefix}}_text_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_text_eq, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_eq, b public.{{prefix}}_text_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_eq. ---! @param a public.eql_v3_text_eq +--! @brief Operator wrapper for public.{{prefix}}_text_eq. +--! @param a public.{{prefix}}_text_eq --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_text_eq, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b::public.eql_v3_text_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_text_eq) $$; ---! @brief Operator wrapper for public.eql_v3_text_eq. +--! @brief Operator wrapper for public.{{prefix}}_text_eq. --! @param a jsonb ---! @param b public.eql_v3_text_eq +--! @param b public.{{prefix}}_text_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_text_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_text_eq) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_eq) <> {{prefix}}.eq_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator ---! @param b public.eql_v3_text_eq right operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator +--! @param b public.{{prefix}}_text_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_text_eq, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_eq, b public.{{prefix}}_text_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_text_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_eq right operand of the blocked operator +--! @param b public.{{prefix}}_text_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_text_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator ---! @param b public.eql_v3_text_eq right operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator +--! @param b public.{{prefix}}_text_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_text_eq, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_eq, b public.{{prefix}}_text_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_text_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_eq right operand of the blocked operator +--! @param b public.{{prefix}}_text_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_text_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator ---! @param b public.eql_v3_text_eq right operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator +--! @param b public.{{prefix}}_text_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_text_eq, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_eq, b public.{{prefix}}_text_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_text_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_eq right operand of the blocked operator +--! @param b public.{{prefix}}_text_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_text_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator ---! @param b public.eql_v3_text_eq right operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator +--! @param b public.{{prefix}}_text_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_text_eq, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_eq, b public.{{prefix}}_text_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_text_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_eq right operand of the blocked operator +--! @param b public.{{prefix}}_text_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_text_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator ---! @param b public.eql_v3_text_eq right operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator +--! @param b public.{{prefix}}_text_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_text_eq, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_text_eq, b public.{{prefix}}_text_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_text_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_text_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_eq right operand of the blocked operator +--! @param b public.{{prefix}}_text_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_text_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator ---! @param b public.eql_v3_text_eq right operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator +--! @param b public.{{prefix}}_text_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_text_eq, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_text_eq, b public.{{prefix}}_text_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_text_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_text_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_eq right operand of the blocked operator +--! @param b public.{{prefix}}_text_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_text_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_text_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_text_eq, selector text) -RETURNS public.eql_v3_text_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_eq'; END; $$ +--! @return public.{{prefix}}_text_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_text_eq, selector text) +RETURNS public.{{prefix}}_text_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_text_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_text_eq, selector integer) -RETURNS public.eql_v3_text_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_eq'; END; $$ +--! @return public.{{prefix}}_text_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_text_eq, selector integer) +RETURNS public.{{prefix}}_text_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_text_eq right operand of the blocked operator ---! @return public.eql_v3_text_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_text_eq) -RETURNS public.eql_v3_text_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_eq'; END; $$ +--! @param selector public.{{prefix}}_text_eq right operand of the blocked operator +--! @return public.{{prefix}}_text_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_text_eq) +RETURNS public.{{prefix}}_text_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_text_eq, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_text_eq, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_text_eq, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_text_eq, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_text_eq right operand of the blocked operator +--! @param selector public.{{prefix}}_text_eq right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_text_eq) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_text_eq, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_text_eq, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_text_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_text_eq, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_text_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_text_eq, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_text_eq, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_text_eq, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator ---! @param b public.eql_v3_text_eq right operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator +--! @param b public.{{prefix}}_text_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_text_eq, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_eq, b public.{{prefix}}_text_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_text_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_eq right operand of the blocked operator +--! @param b public.{{prefix}}_text_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_text_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_text_eq, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_eq, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_text_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_text_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_text_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_text_eq, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_eq, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_eq, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_eq, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_eq, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_text_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_text_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator ---! @param b public.eql_v3_text_eq right operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator +--! @param b public.{{prefix}}_text_eq right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_text_eq, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_text_eq, b public.{{prefix}}_text_eq) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_eq left operand of the blocked operator +--! @param a public.{{prefix}}_text_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_text_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_text_eq, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_eq right operand of the blocked operator +--! @param b public.{{prefix}}_text_eq right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_text_eq) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_text_eq) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_eq'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/text/text_eq_operators.sql b/packages/eql/src/v3/scalars/text/text_eq_operators.sql index b58d0ade5..de57e0ae8 100644 --- a/packages/eql/src/v3/scalars/text/text_eq_operators.sql +++ b/packages/eql/src/v3/scalars/text/text_eq_operators.sql @@ -4,245 +4,245 @@ -- REQUIRE: src/v3/scalars/text/text_eq_functions.sql --! @file encrypted_domain/text/text_eq_operators.sql ---! @brief Operators for public.eql_v3_text_eq. +--! @brief Operators for public.{{prefix}}_text_eq. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_text_eq, RIGHTARG = public.eql_v3_text_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = public.{{prefix}}_text_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_text_eq, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_text_eq, RIGHTARG = public.eql_v3_text_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = public.{{prefix}}_text_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_text_eq, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_text_eq, RIGHTARG = public.eql_v3_text_eq + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = public.{{prefix}}_text_eq ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_text_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_eq + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_eq ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_text_eq, RIGHTARG = public.eql_v3_text_eq + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = public.{{prefix}}_text_eq ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_text_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_eq + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_eq ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_text_eq, RIGHTARG = public.eql_v3_text_eq + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = public.{{prefix}}_text_eq ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_text_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_eq + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_eq ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_text_eq, RIGHTARG = public.eql_v3_text_eq + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = public.{{prefix}}_text_eq ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_text_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_eq + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_eq ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_text_eq, RIGHTARG = public.eql_v3_text_eq + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = public.{{prefix}}_text_eq ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_text_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_eq + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_eq ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_text_eq, RIGHTARG = public.eql_v3_text_eq + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = public.{{prefix}}_text_eq ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_text_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_eq + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_eq ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_text_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_text_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_eq + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_eq ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_text_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_text_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_eq + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_eq ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_text_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_text_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_text_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_text_eq, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_text_eq, RIGHTARG = public.eql_v3_text_eq + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = public.{{prefix}}_text_eq ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_text_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_eq + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_eq ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_text_eq, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_text_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_text_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_text_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_text_eq, RIGHTARG = public.eql_v3_text_eq + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = public.{{prefix}}_text_eq ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_text_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_eq + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_eq ); diff --git a/packages/eql/src/v3/scalars/text/text_functions.sql b/packages/eql/src/v3/scalars/text/text_functions.sql index 6a4e06dae..e6047c1fa 100644 --- a/packages/eql/src/v3/scalars/text/text_functions.sql +++ b/packages/eql/src/v3/scalars/text/text_functions.sql @@ -4,662 +4,662 @@ -- REQUIRE: src/v3/scalars/functions.sql --! @file encrypted_domain/text/text_functions.sql ---! @brief Functions for public.eql_v3_text. +--! @brief Functions for public.{{prefix}}_text. ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_text, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text, b public.{{prefix}}_text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_text, b jsonb) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a jsonb, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal.eq(a jsonb, b public.{{prefix}}_text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_text, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text, b public.{{prefix}}_text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_text, b jsonb) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a jsonb, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal.neq(a jsonb, b public.{{prefix}}_text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_text, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text, b public.{{prefix}}_text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_text, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_text, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text, b public.{{prefix}}_text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_text, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_text, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text, b public.{{prefix}}_text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_text, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_text, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text, b public.{{prefix}}_text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_text, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_text, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_text, b public.{{prefix}}_text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_text, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_text, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_text, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_text, b public.{{prefix}}_text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_text, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_text, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_text, selector text) -RETURNS public.eql_v3_text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text'; END; $$ +--! @return public.{{prefix}}_text never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_text, selector text) +RETURNS public.{{prefix}}_text IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_text, selector integer) -RETURNS public.eql_v3_text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text'; END; $$ +--! @return public.{{prefix}}_text never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_text, selector integer) +RETURNS public.{{prefix}}_text IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_text right operand of the blocked operator ---! @return public.eql_v3_text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_text) -RETURNS public.eql_v3_text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text'; END; $$ +--! @param selector public.{{prefix}}_text right operand of the blocked operator +--! @return public.{{prefix}}_text never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_text) +RETURNS public.{{prefix}}_text IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_text, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_text, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_text, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_text, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_text right operand of the blocked operator +--! @param selector public.{{prefix}}_text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_text, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_text, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_text, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_text, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_text, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_text, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_text, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_text, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_text, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text, b public.{{prefix}}_text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_text, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_text, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_text, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_text, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_text, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_text, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_text, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_text, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_text, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_text, b public.{{prefix}}_text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text left operand of the blocked operator +--! @param a public.{{prefix}}_text left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_text, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_text, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text. +--! @brief Unsupported operator blocker for public.{{prefix}}_text. --! ---! Intercepts an operator that is not supported on public.eql_v3_text and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text right operand of the blocked operator +--! @param b public.{{prefix}}_text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_text) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/text/text_match_functions.sql b/packages/eql/src/v3/scalars/text/text_match_functions.sql index 9005ad5ba..a89752611 100644 --- a/packages/eql/src/v3/scalars/text/text_match_functions.sql +++ b/packages/eql/src/v3/scalars/text/text_match_functions.sql @@ -5,652 +5,652 @@ -- REQUIRE: src/v3/sem/bloom_filter/functions.sql --! @file encrypted_domain/text/text_match_functions.sql ---! @brief Functions for public.eql_v3_text_match. +--! @brief Functions for public.{{prefix}}_text_match. ---! @brief Index extractor for public.eql_v3_text_match. ---! @param a public.eql_v3_text_match ---! @return eql_v3_internal.bloom_filter -CREATE FUNCTION eql_v3.match_term(a public.eql_v3_text_match) -RETURNS eql_v3_internal.bloom_filter +--! @brief Index extractor for public.{{prefix}}_text_match. +--! @param a public.{{prefix}}_text_match +--! @return {{prefix}}_internal.bloom_filter +CREATE FUNCTION {{prefix}}.match_term(a public.{{prefix}}_text_match) +RETURNS {{prefix}}_internal.bloom_filter LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.bloom_filter(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.bloom_filter(a::jsonb) $$; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator ---! @param b public.eql_v3_text_match right operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator +--! @param b public.{{prefix}}_text_match right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_text_match, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_match, b public.{{prefix}}_text_match) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_text_match, b jsonb) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_match, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_match right operand of the blocked operator +--! @param b public.{{prefix}}_text_match right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a jsonb, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}_internal.eq(a jsonb, b public.{{prefix}}_text_match) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator ---! @param b public.eql_v3_text_match right operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator +--! @param b public.{{prefix}}_text_match right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_text_match, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_match, b public.{{prefix}}_text_match) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_text_match, b jsonb) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_match, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_match right operand of the blocked operator +--! @param b public.{{prefix}}_text_match right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a jsonb, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}_internal.neq(a jsonb, b public.{{prefix}}_text_match) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator ---! @param b public.eql_v3_text_match right operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator +--! @param b public.{{prefix}}_text_match right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_text_match, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_match, b public.{{prefix}}_text_match) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_text_match, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_match, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_match right operand of the blocked operator +--! @param b public.{{prefix}}_text_match right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_text_match) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator ---! @param b public.eql_v3_text_match right operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator +--! @param b public.{{prefix}}_text_match right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_text_match, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_match, b public.{{prefix}}_text_match) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_text_match, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_match, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_match right operand of the blocked operator +--! @param b public.{{prefix}}_text_match right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_text_match) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator ---! @param b public.eql_v3_text_match right operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator +--! @param b public.{{prefix}}_text_match right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_text_match, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_match, b public.{{prefix}}_text_match) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_text_match, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_match, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_match right operand of the blocked operator +--! @param b public.{{prefix}}_text_match right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_text_match) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator ---! @param b public.eql_v3_text_match right operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator +--! @param b public.{{prefix}}_text_match right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_text_match, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_match, b public.{{prefix}}_text_match) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_text_match, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_match, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_match right operand of the blocked operator +--! @param b public.{{prefix}}_text_match right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_text_match) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator ---! @param b public.eql_v3_text_match right operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator +--! @param b public.{{prefix}}_text_match right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_text_match, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_text_match, b public.{{prefix}}_text_match) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_text_match, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_text_match, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_match right operand of the blocked operator +--! @param b public.{{prefix}}_text_match right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_text_match) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator ---! @param b public.eql_v3_text_match right operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator +--! @param b public.{{prefix}}_text_match right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_text_match, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_text_match, b public.{{prefix}}_text_match) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_text_match, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_text_match, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_match right operand of the blocked operator +--! @param b public.{{prefix}}_text_match right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_text_match) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_text_match never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_text_match, selector text) -RETURNS public.eql_v3_text_match IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_match'; END; $$ +--! @return public.{{prefix}}_text_match never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_text_match, selector text) +RETURNS public.{{prefix}}_text_match IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_text_match never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_text_match, selector integer) -RETURNS public.eql_v3_text_match IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_match'; END; $$ +--! @return public.{{prefix}}_text_match never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_text_match, selector integer) +RETURNS public.{{prefix}}_text_match IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_text_match right operand of the blocked operator ---! @return public.eql_v3_text_match never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_text_match) -RETURNS public.eql_v3_text_match IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_match'; END; $$ +--! @param selector public.{{prefix}}_text_match right operand of the blocked operator +--! @return public.{{prefix}}_text_match never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_text_match) +RETURNS public.{{prefix}}_text_match IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_text_match, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_text_match, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_text_match, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_text_match, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_text_match right operand of the blocked operator +--! @param selector public.{{prefix}}_text_match right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_text_match) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_text_match, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_text_match, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_text_match, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_text_match, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_text_match, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_text_match, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_text_match, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_text_match, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Operator wrapper for public.eql_v3_text_match. ---! @param a public.eql_v3_text_match ---! @param b public.eql_v3_text_match +--! @brief Operator wrapper for public.{{prefix}}_text_match. +--! @param a public.{{prefix}}_text_match +--! @param b public.{{prefix}}_text_match --! @return boolean -CREATE FUNCTION eql_v3.matches(a public.eql_v3_text_match, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}.matches(a public.{{prefix}}_text_match, b public.{{prefix}}_text_match) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT eql_v3.match_term(a) @> eql_v3.match_term(b) AND (cardinality(eql_v3.match_term(b)) > 0 OR cardinality(eql_v3.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; ---! @brief Operator wrapper for public.eql_v3_text_match. ---! @param a public.eql_v3_text_match +--! @brief Operator wrapper for public.{{prefix}}_text_match. +--! @param a public.{{prefix}}_text_match --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.matches(a public.eql_v3_text_match, b jsonb) +CREATE FUNCTION {{prefix}}.matches(a public.{{prefix}}_text_match, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT eql_v3.match_term(a) @> eql_v3.match_term(b::public.eql_v3_text_match) AND (cardinality(eql_v3.match_term(b::public.eql_v3_text_match)) > 0 OR cardinality(eql_v3.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b::public.{{prefix}}_text_match) AND (cardinality({{prefix}}.match_term(b::public.{{prefix}}_text_match)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; ---! @brief Operator wrapper for public.eql_v3_text_match. +--! @brief Operator wrapper for public.{{prefix}}_text_match. --! @param a jsonb ---! @param b public.eql_v3_text_match +--! @param b public.{{prefix}}_text_match --! @return boolean -CREATE FUNCTION eql_v3.matches(a jsonb, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}.matches(a jsonb, b public.{{prefix}}_text_match) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT eql_v3.match_term(a::public.eql_v3_text_match) @> eql_v3.match_term(b) AND (cardinality(eql_v3.match_term(b)) > 0 OR cardinality(eql_v3.match_term(a::public.eql_v3_text_match)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a::public.{{prefix}}_text_match) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a::public.{{prefix}}_text_match)) = 0) $$; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_text_match, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_match, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_text_match, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_text_match, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_text_match, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_text_match, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_match, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_match, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_match, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_match, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_match, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_match, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_text_match, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_text_match, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator ---! @param b public.eql_v3_text_match right operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator +--! @param b public.{{prefix}}_text_match right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_text_match, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_text_match, b public.{{prefix}}_text_match) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_match left operand of the blocked operator +--! @param a public.{{prefix}}_text_match left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_text_match, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_text_match, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_match. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_match and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_match and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_match right operand of the blocked operator +--! @param b public.{{prefix}}_text_match right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_text_match) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_text_match) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_match'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_match'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/text/text_match_operators.sql b/packages/eql/src/v3/scalars/text/text_match_operators.sql index 8f8bae19c..3a8bd4553 100644 --- a/packages/eql/src/v3/scalars/text/text_match_operators.sql +++ b/packages/eql/src/v3/scalars/text/text_match_operators.sql @@ -4,242 +4,242 @@ -- REQUIRE: src/v3/scalars/text/text_match_functions.sql --! @file encrypted_domain/text/text_match_operators.sql ---! @brief Operators for public.eql_v3_text_match. +--! @brief Operators for public.{{prefix}}_text_match. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_text_match, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = public.{{prefix}}_text_match ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_text_match, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = jsonb ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_match ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_text_match, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = public.{{prefix}}_text_match ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_text_match, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = jsonb ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_match ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_text_match, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = public.{{prefix}}_text_match ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_text_match, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_match ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_text_match, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = public.{{prefix}}_text_match ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_text_match, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_match ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_text_match, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = public.{{prefix}}_text_match ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_text_match, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_match ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_text_match, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = public.{{prefix}}_text_match ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_text_match, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_match ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_text_match, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = public.{{prefix}}_text_match ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_text_match, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_match ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_text_match, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = public.{{prefix}}_text_match ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_text_match, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_match ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_text_match, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_text_match, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_match ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_text_match, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_text_match, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_match ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_text_match, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_text_match, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_text_match, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_text_match, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3.matches, - LEFTARG = public.eql_v3_text_match, RIGHTARG = public.eql_v3_text_match, + FUNCTION = {{prefix}}.matches, + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = public.{{prefix}}_text_match, RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3.matches, - LEFTARG = public.eql_v3_text_match, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.matches, + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = jsonb, RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3.matches, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_match, + FUNCTION = {{prefix}}.matches, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_match, RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_text_match, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_text_match, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_text_match, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_match, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_match, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_match, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_text_match, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_text_match, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = public.{{prefix}}_text_match ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_text_match, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_match + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_match ); diff --git a/packages/eql/src/v3/scalars/text/text_operators.sql b/packages/eql/src/v3/scalars/text/text_operators.sql index 73c967969..649d86b9e 100644 --- a/packages/eql/src/v3/scalars/text/text_operators.sql +++ b/packages/eql/src/v3/scalars/text/text_operators.sql @@ -4,239 +4,239 @@ -- REQUIRE: src/v3/scalars/text/text_functions.sql --! @file encrypted_domain/text/text_operators.sql ---! @brief Operators for public.eql_v3_text. +--! @brief Operators for public.{{prefix}}_text. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_text, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_text, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text, RIGHTARG = jsonb ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_text, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_text, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text, RIGHTARG = jsonb ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_text, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_text, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_text, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_text, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_text, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_text, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_text, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_text, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_text, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_text, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_text, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_text, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_text, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_text, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_text, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_text, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_text, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_text, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_text, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_text, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_text, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_text, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_text, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_text, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_text, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_text, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_text, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_text, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_text, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_text, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_text, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_text, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_text, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_text, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_text, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_text, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_text, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_text, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_text, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_text, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_text, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_text, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_text, RIGHTARG = public.{{prefix}}_text ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_text, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_text, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text ); diff --git a/packages/eql/src/v3/scalars/text/text_ord_aggregates.sql b/packages/eql/src/v3/scalars/text/text_ord_aggregates.sql index b73708a46..996be49d3 100644 --- a/packages/eql/src/v3/scalars/text/text_ord_aggregates.sql +++ b/packages/eql/src/v3/scalars/text/text_ord_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/text/text_ord_operators.sql --! @file encrypted_domain/text/text_ord_aggregates.sql ---! @brief Aggregates for public.eql_v3_text_ord. +--! @brief Aggregates for public.{{prefix}}_text_ord. ---! @brief State function for min on public.eql_v3_text_ord. ---! @param state public.eql_v3_text_ord ---! @param value public.eql_v3_text_ord ---! @return public.eql_v3_text_ord -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_text_ord, value public.eql_v3_text_ord) -RETURNS public.eql_v3_text_ord +--! @brief State function for min on public.{{prefix}}_text_ord. +--! @param state public.{{prefix}}_text_ord +--! @param value public.{{prefix}}_text_ord +--! @return public.{{prefix}}_text_ord +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_text_ord, value public.{{prefix}}_text_ord) +RETURNS public.{{prefix}}_text_ord LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_text_ord. ---! @param input public.eql_v3_text_ord ---! @return public.eql_v3_text_ord -CREATE AGGREGATE eql_v3.min(public.eql_v3_text_ord) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_text_ord, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_text_ord. +--! @param input public.{{prefix}}_text_ord +--! @return public.{{prefix}}_text_ord +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_text_ord) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_text_ord, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_text_ord. ---! @param state public.eql_v3_text_ord ---! @param value public.eql_v3_text_ord ---! @return public.eql_v3_text_ord -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_text_ord, value public.eql_v3_text_ord) -RETURNS public.eql_v3_text_ord +--! @brief State function for max on public.{{prefix}}_text_ord. +--! @param state public.{{prefix}}_text_ord +--! @param value public.{{prefix}}_text_ord +--! @return public.{{prefix}}_text_ord +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_text_ord, value public.{{prefix}}_text_ord) +RETURNS public.{{prefix}}_text_ord LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_text_ord. ---! @param input public.eql_v3_text_ord ---! @return public.eql_v3_text_ord -CREATE AGGREGATE eql_v3.max(public.eql_v3_text_ord) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_text_ord, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_text_ord. +--! @param input public.{{prefix}}_text_ord +--! @return public.{{prefix}}_text_ord +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_text_ord) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_text_ord, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/text/text_ord_functions.sql b/packages/eql/src/v3/scalars/text/text_ord_functions.sql index b8257790c..afd8d5e8c 100644 --- a/packages/eql/src/v3/scalars/text/text_ord_functions.sql +++ b/packages/eql/src/v3/scalars/text/text_ord_functions.sql @@ -6,570 +6,570 @@ -- REQUIRE: src/v3/sem/ope_cllw/functions.sql --! @file encrypted_domain/text/text_ord_functions.sql ---! @brief Functions for public.eql_v3_text_ord. +--! @brief Functions for public.{{prefix}}_text_ord. ---! @brief Index extractor for public.eql_v3_text_ord. ---! @param a public.eql_v3_text_ord ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a public.eql_v3_text_ord) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for public.{{prefix}}_text_ord. +--! @param a public.{{prefix}}_text_ord +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a public.{{prefix}}_text_ord) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Index extractor for public.eql_v3_text_ord. ---! @param a public.eql_v3_text_ord ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a public.eql_v3_text_ord) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for public.{{prefix}}_text_ord. +--! @param a public.{{prefix}}_text_ord +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a public.{{prefix}}_text_ord) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord. ---! @param a public.eql_v3_text_ord ---! @param b public.eql_v3_text_ord +--! @brief Operator wrapper for public.{{prefix}}_text_ord. +--! @param a public.{{prefix}}_text_ord +--! @param b public.{{prefix}}_text_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_text_ord, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord. ---! @param a public.eql_v3_text_ord +--! @brief Operator wrapper for public.{{prefix}}_text_ord. +--! @param a public.{{prefix}}_text_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_text_ord, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b::public.eql_v3_text_ord) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_text_ord) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord. +--! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a jsonb ---! @param b public.eql_v3_text_ord +--! @param b public.{{prefix}}_text_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_text_ord) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord. ---! @param a public.eql_v3_text_ord ---! @param b public.eql_v3_text_ord +--! @brief Operator wrapper for public.{{prefix}}_text_ord. +--! @param a public.{{prefix}}_text_ord +--! @param b public.{{prefix}}_text_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_text_ord, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord. ---! @param a public.eql_v3_text_ord +--! @brief Operator wrapper for public.{{prefix}}_text_ord. +--! @param a public.{{prefix}}_text_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_text_ord, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b::public.eql_v3_text_ord) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_text_ord) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord. +--! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a jsonb ---! @param b public.eql_v3_text_ord +--! @param b public.{{prefix}}_text_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_text_ord) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord. ---! @param a public.eql_v3_text_ord ---! @param b public.eql_v3_text_ord +--! @brief Operator wrapper for public.{{prefix}}_text_ord. +--! @param a public.{{prefix}}_text_ord +--! @param b public.{{prefix}}_text_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_text_ord, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord. ---! @param a public.eql_v3_text_ord +--! @brief Operator wrapper for public.{{prefix}}_text_ord. +--! @param a public.{{prefix}}_text_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_text_ord, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b::public.eql_v3_text_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_text_ord) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord. +--! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a jsonb ---! @param b public.eql_v3_text_ord +--! @param b public.{{prefix}}_text_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_text_ord) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord. ---! @param a public.eql_v3_text_ord ---! @param b public.eql_v3_text_ord +--! @brief Operator wrapper for public.{{prefix}}_text_ord. +--! @param a public.{{prefix}}_text_ord +--! @param b public.{{prefix}}_text_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_text_ord, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord. ---! @param a public.eql_v3_text_ord +--! @brief Operator wrapper for public.{{prefix}}_text_ord. +--! @param a public.{{prefix}}_text_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_text_ord, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b::public.eql_v3_text_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_text_ord) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord. +--! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a jsonb ---! @param b public.eql_v3_text_ord +--! @param b public.{{prefix}}_text_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_text_ord) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord. ---! @param a public.eql_v3_text_ord ---! @param b public.eql_v3_text_ord +--! @brief Operator wrapper for public.{{prefix}}_text_ord. +--! @param a public.{{prefix}}_text_ord +--! @param b public.{{prefix}}_text_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_text_ord, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord. ---! @param a public.eql_v3_text_ord +--! @brief Operator wrapper for public.{{prefix}}_text_ord. +--! @param a public.{{prefix}}_text_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_text_ord, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b::public.eql_v3_text_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_text_ord) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord. +--! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a jsonb ---! @param b public.eql_v3_text_ord +--! @param b public.{{prefix}}_text_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_text_ord) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord. ---! @param a public.eql_v3_text_ord ---! @param b public.eql_v3_text_ord +--! @brief Operator wrapper for public.{{prefix}}_text_ord. +--! @param a public.{{prefix}}_text_ord +--! @param b public.{{prefix}}_text_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_text_ord, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord. ---! @param a public.eql_v3_text_ord +--! @brief Operator wrapper for public.{{prefix}}_text_ord. +--! @param a public.{{prefix}}_text_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_text_ord, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b::public.eql_v3_text_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_text_ord) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord. +--! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a jsonb ---! @param b public.eql_v3_text_ord +--! @param b public.{{prefix}}_text_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_text_ord) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator ---! @param b public.eql_v3_text_ord right operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator +--! @param b public.{{prefix}}_text_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_text_ord, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_text_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_text_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_ord right operand of the blocked operator +--! @param b public.{{prefix}}_text_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_text_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator ---! @param b public.eql_v3_text_ord right operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator +--! @param b public.{{prefix}}_text_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_text_ord, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_text_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_text_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_ord right operand of the blocked operator +--! @param b public.{{prefix}}_text_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_text_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_text_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_text_ord, selector text) -RETURNS public.eql_v3_text_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_ord'; END; $$ +--! @return public.{{prefix}}_text_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_text_ord, selector text) +RETURNS public.{{prefix}}_text_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_text_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_text_ord, selector integer) -RETURNS public.eql_v3_text_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_ord'; END; $$ +--! @return public.{{prefix}}_text_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_text_ord, selector integer) +RETURNS public.{{prefix}}_text_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_text_ord right operand of the blocked operator ---! @return public.eql_v3_text_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_text_ord) -RETURNS public.eql_v3_text_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_ord'; END; $$ +--! @param selector public.{{prefix}}_text_ord right operand of the blocked operator +--! @return public.{{prefix}}_text_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_text_ord) +RETURNS public.{{prefix}}_text_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_text_ord, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_text_ord, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_text_ord, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_text_ord, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_text_ord right operand of the blocked operator +--! @param selector public.{{prefix}}_text_ord right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_text_ord) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_text_ord, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_text_ord, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_text_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_text_ord, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_text_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_text_ord, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_text_ord, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_text_ord, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator ---! @param b public.eql_v3_text_ord right operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator +--! @param b public.{{prefix}}_text_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_text_ord, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_text_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_ord right operand of the blocked operator +--! @param b public.{{prefix}}_text_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_text_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_text_ord, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_ord, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_text_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_text_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_text_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_text_ord, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_ord, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_ord, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_ord, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_ord, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_text_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_text_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator ---! @param b public.eql_v3_text_ord right operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator +--! @param b public.{{prefix}}_text_ord right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_text_ord, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_text_ord, b public.{{prefix}}_text_ord) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_text_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_text_ord, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_ord right operand of the blocked operator +--! @param b public.{{prefix}}_text_ord right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_text_ord) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_text_ord) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_ord'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/text/text_ord_ope_aggregates.sql b/packages/eql/src/v3/scalars/text/text_ord_ope_aggregates.sql index 1508bbb48..c7e436d00 100644 --- a/packages/eql/src/v3/scalars/text/text_ord_ope_aggregates.sql +++ b/packages/eql/src/v3/scalars/text/text_ord_ope_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/text/text_ord_ope_operators.sql --! @file encrypted_domain/text/text_ord_ope_aggregates.sql ---! @brief Aggregates for public.eql_v3_text_ord_ope. +--! @brief Aggregates for public.{{prefix}}_text_ord_ope. ---! @brief State function for min on public.eql_v3_text_ord_ope. ---! @param state public.eql_v3_text_ord_ope ---! @param value public.eql_v3_text_ord_ope ---! @return public.eql_v3_text_ord_ope -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_text_ord_ope, value public.eql_v3_text_ord_ope) -RETURNS public.eql_v3_text_ord_ope +--! @brief State function for min on public.{{prefix}}_text_ord_ope. +--! @param state public.{{prefix}}_text_ord_ope +--! @param value public.{{prefix}}_text_ord_ope +--! @return public.{{prefix}}_text_ord_ope +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_text_ord_ope, value public.{{prefix}}_text_ord_ope) +RETURNS public.{{prefix}}_text_ord_ope LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_text_ord_ope. ---! @param input public.eql_v3_text_ord_ope ---! @return public.eql_v3_text_ord_ope -CREATE AGGREGATE eql_v3.min(public.eql_v3_text_ord_ope) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_text_ord_ope, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_text_ord_ope. +--! @param input public.{{prefix}}_text_ord_ope +--! @return public.{{prefix}}_text_ord_ope +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_text_ord_ope) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_text_ord_ope, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_text_ord_ope. ---! @param state public.eql_v3_text_ord_ope ---! @param value public.eql_v3_text_ord_ope ---! @return public.eql_v3_text_ord_ope -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_text_ord_ope, value public.eql_v3_text_ord_ope) -RETURNS public.eql_v3_text_ord_ope +--! @brief State function for max on public.{{prefix}}_text_ord_ope. +--! @param state public.{{prefix}}_text_ord_ope +--! @param value public.{{prefix}}_text_ord_ope +--! @return public.{{prefix}}_text_ord_ope +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_text_ord_ope, value public.{{prefix}}_text_ord_ope) +RETURNS public.{{prefix}}_text_ord_ope LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_text_ord_ope. ---! @param input public.eql_v3_text_ord_ope ---! @return public.eql_v3_text_ord_ope -CREATE AGGREGATE eql_v3.max(public.eql_v3_text_ord_ope) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_text_ord_ope, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_text_ord_ope. +--! @param input public.{{prefix}}_text_ord_ope +--! @return public.{{prefix}}_text_ord_ope +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_text_ord_ope) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_text_ord_ope, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/text/text_ord_ope_functions.sql b/packages/eql/src/v3/scalars/text/text_ord_ope_functions.sql index a2b05930f..6a3566036 100644 --- a/packages/eql/src/v3/scalars/text/text_ord_ope_functions.sql +++ b/packages/eql/src/v3/scalars/text/text_ord_ope_functions.sql @@ -6,570 +6,570 @@ -- REQUIRE: src/v3/sem/ope_cllw/functions.sql --! @file encrypted_domain/text/text_ord_ope_functions.sql ---! @brief Functions for public.eql_v3_text_ord_ope. +--! @brief Functions for public.{{prefix}}_text_ord_ope. ---! @brief Index extractor for public.eql_v3_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a public.eql_v3_text_ord_ope) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for public.{{prefix}}_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a public.{{prefix}}_text_ord_ope) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Index extractor for public.eql_v3_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a public.eql_v3_text_ord_ope) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for public.{{prefix}}_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a public.{{prefix}}_text_ord_ope) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope ---! @param b public.eql_v3_text_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope +--! @param b public.{{prefix}}_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_text_ord_ope, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_ord_ope, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_text_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b::public.eql_v3_text_ord_ope) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_text_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_text_ord_ope +--! @param b public.{{prefix}}_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_text_ord_ope) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord_ope) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope ---! @param b public.eql_v3_text_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope +--! @param b public.{{prefix}}_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_text_ord_ope, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_ord_ope, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_text_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b::public.eql_v3_text_ord_ope) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_text_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_text_ord_ope +--! @param b public.{{prefix}}_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_text_ord_ope) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord_ope) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope ---! @param b public.eql_v3_text_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope +--! @param b public.{{prefix}}_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_text_ord_ope, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_ord_ope, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_text_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b::public.eql_v3_text_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_text_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_text_ord_ope +--! @param b public.{{prefix}}_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_text_ord_ope) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord_ope) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope ---! @param b public.eql_v3_text_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope +--! @param b public.{{prefix}}_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_text_ord_ope, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_ord_ope, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_text_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b::public.eql_v3_text_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_text_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_text_ord_ope +--! @param b public.{{prefix}}_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_text_ord_ope) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord_ope) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope ---! @param b public.eql_v3_text_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope +--! @param b public.{{prefix}}_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_text_ord_ope, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_ord_ope, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_text_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b::public.eql_v3_text_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_text_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_text_ord_ope +--! @param b public.{{prefix}}_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_text_ord_ope) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord_ope) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope ---! @param b public.eql_v3_text_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope +--! @param b public.{{prefix}}_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_text_ord_ope, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_ord_ope, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ope. ---! @param a public.eql_v3_text_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. +--! @param a public.{{prefix}}_text_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_text_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b::public.eql_v3_text_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_text_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_text_ord_ope +--! @param b public.{{prefix}}_text_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_text_ord_ope) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord_ope) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_text_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_text_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_text_ord_ope, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_text_ord_ope, b public.{{prefix}}_text_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_text_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_text_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_text_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_text_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_text_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_text_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_text_ord_ope, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_text_ord_ope, b public.{{prefix}}_text_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_text_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_text_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_text_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_text_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_text_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_text_ord_ope, selector text) -RETURNS public.eql_v3_text_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_ord_ope'; END; $$ +--! @return public.{{prefix}}_text_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_text_ord_ope, selector text) +RETURNS public.{{prefix}}_text_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_text_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_text_ord_ope, selector integer) -RETURNS public.eql_v3_text_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_ord_ope'; END; $$ +--! @return public.{{prefix}}_text_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_text_ord_ope, selector integer) +RETURNS public.{{prefix}}_text_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_text_ord_ope right operand of the blocked operator ---! @return public.eql_v3_text_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_text_ord_ope) -RETURNS public.eql_v3_text_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_ord_ope'; END; $$ +--! @param selector public.{{prefix}}_text_ord_ope right operand of the blocked operator +--! @return public.{{prefix}}_text_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_text_ord_ope) +RETURNS public.{{prefix}}_text_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_text_ord_ope, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_text_ord_ope, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_text_ord_ope, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_text_ord_ope, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_text_ord_ope right operand of the blocked operator +--! @param selector public.{{prefix}}_text_ord_ope right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_text_ord_ope) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_text_ord_ope, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_text_ord_ope, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_text_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_text_ord_ope, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_text_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_text_ord_ope, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_text_ord_ope, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_text_ord_ope, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_text_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_text_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_text_ord_ope, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_ord_ope, b public.{{prefix}}_text_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_text_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_text_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_text_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_text_ord_ope, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_ord_ope, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_text_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_text_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_text_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_text_ord_ope, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_ord_ope, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_ord_ope, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_ord_ope, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_ord_ope, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_text_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_text_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_text_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_text_ord_ope right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_text_ord_ope, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_text_ord_ope, b public.{{prefix}}_text_ord_ope) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_text_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_text_ord_ope, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_text_ord_ope right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_text_ord_ope) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_text_ord_ope) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_ord_ope'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/text/text_ord_ope_operators.sql b/packages/eql/src/v3/scalars/text/text_ord_ope_operators.sql index 90609b417..cba59dbf4 100644 --- a/packages/eql/src/v3/scalars/text/text_ord_ope_operators.sql +++ b/packages/eql/src/v3/scalars/text/text_ord_ope_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/text/text_ord_ope_functions.sql --! @file encrypted_domain/text/text_ord_ope_operators.sql ---! @brief Operators for public.eql_v3_text_ord_ope. +--! @brief Operators for public.{{prefix}}_text_ord_ope. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = public.eql_v3_text_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = public.eql_v3_text_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = public.eql_v3_text_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = public.eql_v3_text_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = public.eql_v3_text_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = public.eql_v3_text_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = public.eql_v3_text_ord_ope + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ope ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ope + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ope ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = public.eql_v3_text_ord_ope + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ope ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ope + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ope ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ope + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ope ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ope + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ope ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = public.eql_v3_text_ord_ope + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ope ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ope + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ope ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = public.eql_v3_text_ord_ope + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ope ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_text_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ope + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ope ); diff --git a/packages/eql/src/v3/scalars/text/text_ord_operators.sql b/packages/eql/src/v3/scalars/text/text_ord_operators.sql index bbfceaeec..b371ea398 100644 --- a/packages/eql/src/v3/scalars/text/text_ord_operators.sql +++ b/packages/eql/src/v3/scalars/text/text_ord_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/text/text_ord_functions.sql --! @file encrypted_domain/text/text_ord_operators.sql ---! @brief Operators for public.eql_v3_text_ord. +--! @brief Operators for public.{{prefix}}_text_ord. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = public.eql_v3_text_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = public.{{prefix}}_text_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = public.eql_v3_text_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = public.{{prefix}}_text_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = public.eql_v3_text_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = public.{{prefix}}_text_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = public.eql_v3_text_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = public.{{prefix}}_text_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = public.eql_v3_text_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = public.{{prefix}}_text_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = public.eql_v3_text_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = public.{{prefix}}_text_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = public.eql_v3_text_ord + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = public.{{prefix}}_text_ord ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = public.eql_v3_text_ord + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = public.{{prefix}}_text_ord ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_text_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_text_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_text_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_text_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_text_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_text_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_text_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_text_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_text_ord, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_text_ord, RIGHTARG = public.eql_v3_text_ord + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = public.{{prefix}}_text_ord ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_text_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_text_ord, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_text_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_text_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_text_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_text_ord, RIGHTARG = public.eql_v3_text_ord + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = public.{{prefix}}_text_ord ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_text_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord ); diff --git a/packages/eql/src/v3/scalars/text/text_ord_ore_aggregates.sql b/packages/eql/src/v3/scalars/text/text_ord_ore_aggregates.sql index cf4628582..be2e574b8 100644 --- a/packages/eql/src/v3/scalars/text/text_ord_ore_aggregates.sql +++ b/packages/eql/src/v3/scalars/text/text_ord_ore_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/text/text_ord_ore_operators.sql --! @file encrypted_domain/text/text_ord_ore_aggregates.sql ---! @brief Aggregates for public.eql_v3_text_ord_ore. +--! @brief Aggregates for public.{{prefix}}_text_ord_ore. ---! @brief State function for min on public.eql_v3_text_ord_ore. ---! @param state public.eql_v3_text_ord_ore ---! @param value public.eql_v3_text_ord_ore ---! @return public.eql_v3_text_ord_ore -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_text_ord_ore, value public.eql_v3_text_ord_ore) -RETURNS public.eql_v3_text_ord_ore +--! @brief State function for min on public.{{prefix}}_text_ord_ore. +--! @param state public.{{prefix}}_text_ord_ore +--! @param value public.{{prefix}}_text_ord_ore +--! @return public.{{prefix}}_text_ord_ore +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_text_ord_ore, value public.{{prefix}}_text_ord_ore) +RETURNS public.{{prefix}}_text_ord_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_text_ord_ore. ---! @param input public.eql_v3_text_ord_ore ---! @return public.eql_v3_text_ord_ore -CREATE AGGREGATE eql_v3.min(public.eql_v3_text_ord_ore) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_text_ord_ore, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_text_ord_ore. +--! @param input public.{{prefix}}_text_ord_ore +--! @return public.{{prefix}}_text_ord_ore +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_text_ord_ore) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_text_ord_ore, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_text_ord_ore. ---! @param state public.eql_v3_text_ord_ore ---! @param value public.eql_v3_text_ord_ore ---! @return public.eql_v3_text_ord_ore -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_text_ord_ore, value public.eql_v3_text_ord_ore) -RETURNS public.eql_v3_text_ord_ore +--! @brief State function for max on public.{{prefix}}_text_ord_ore. +--! @param state public.{{prefix}}_text_ord_ore +--! @param value public.{{prefix}}_text_ord_ore +--! @return public.{{prefix}}_text_ord_ore +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_text_ord_ore, value public.{{prefix}}_text_ord_ore) +RETURNS public.{{prefix}}_text_ord_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_text_ord_ore. ---! @param input public.eql_v3_text_ord_ore ---! @return public.eql_v3_text_ord_ore -CREATE AGGREGATE eql_v3.max(public.eql_v3_text_ord_ore) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_text_ord_ore, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_text_ord_ore. +--! @param input public.{{prefix}}_text_ord_ore +--! @return public.{{prefix}}_text_ord_ore +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_text_ord_ore) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_text_ord_ore, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/text/text_ord_ore_functions.sql b/packages/eql/src/v3/scalars/text/text_ord_ore_functions.sql index f0bae2ed9..d61d16612 100644 --- a/packages/eql/src/v3/scalars/text/text_ord_ore_functions.sql +++ b/packages/eql/src/v3/scalars/text/text_ord_ore_functions.sql @@ -7,570 +7,570 @@ -- REQUIRE: src/v3/sem/ore_block_256/operators.sql --! @file encrypted_domain/text/text_ord_ore_functions.sql ---! @brief Functions for public.eql_v3_text_ord_ore. +--! @brief Functions for public.{{prefix}}_text_ord_ore. ---! @brief Index extractor for public.eql_v3_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a public.eql_v3_text_ord_ore) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for public.{{prefix}}_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a public.{{prefix}}_text_ord_ore) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Index extractor for public.eql_v3_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a public.eql_v3_text_ord_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for public.{{prefix}}_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a public.{{prefix}}_text_ord_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore ---! @param b public.eql_v3_text_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore +--! @param b public.{{prefix}}_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_text_ord_ore, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_ord_ore, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_text_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b::public.eql_v3_text_ord_ore) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_text_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_text_ord_ore +--! @param b public.{{prefix}}_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_text_ord_ore) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord_ore) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore ---! @param b public.eql_v3_text_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore +--! @param b public.{{prefix}}_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_text_ord_ore, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_ord_ore, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_text_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b::public.eql_v3_text_ord_ore) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_text_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_text_ord_ore +--! @param b public.{{prefix}}_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_text_ord_ore) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord_ore) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore ---! @param b public.eql_v3_text_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore +--! @param b public.{{prefix}}_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_text_ord_ore, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_ord_ore, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_text_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b::public.eql_v3_text_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_text_ord_ore +--! @param b public.{{prefix}}_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_text_ord_ore) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_ord_ore) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore ---! @param b public.eql_v3_text_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore +--! @param b public.{{prefix}}_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_text_ord_ore, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_ord_ore, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_text_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b::public.eql_v3_text_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_text_ord_ore +--! @param b public.{{prefix}}_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_text_ord_ore) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_ord_ore) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore ---! @param b public.eql_v3_text_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore +--! @param b public.{{prefix}}_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_text_ord_ore, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_ord_ore, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_text_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b::public.eql_v3_text_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_text_ord_ore +--! @param b public.{{prefix}}_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_text_ord_ore) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_ord_ore) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore ---! @param b public.eql_v3_text_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore +--! @param b public.{{prefix}}_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_text_ord_ore, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_ord_ore, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ore. ---! @param a public.eql_v3_text_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. +--! @param a public.{{prefix}}_text_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_text_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b::public.eql_v3_text_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_text_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_text_ord_ore +--! @param b public.{{prefix}}_text_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_text_ord_ore) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_ord_ore) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_text_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_text_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_text_ord_ore, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_text_ord_ore, b public.{{prefix}}_text_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_text_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_text_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_text_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_text_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_text_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_text_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_text_ord_ore, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_text_ord_ore, b public.{{prefix}}_text_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_text_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_text_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_text_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_text_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_text_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_text_ord_ore, selector text) -RETURNS public.eql_v3_text_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_ord_ore'; END; $$ +--! @return public.{{prefix}}_text_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_text_ord_ore, selector text) +RETURNS public.{{prefix}}_text_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_text_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_text_ord_ore, selector integer) -RETURNS public.eql_v3_text_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_ord_ore'; END; $$ +--! @return public.{{prefix}}_text_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_text_ord_ore, selector integer) +RETURNS public.{{prefix}}_text_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_text_ord_ore right operand of the blocked operator ---! @return public.eql_v3_text_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_text_ord_ore) -RETURNS public.eql_v3_text_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_ord_ore'; END; $$ +--! @param selector public.{{prefix}}_text_ord_ore right operand of the blocked operator +--! @return public.{{prefix}}_text_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_text_ord_ore) +RETURNS public.{{prefix}}_text_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_text_ord_ore, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_text_ord_ore, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_text_ord_ore, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_text_ord_ore, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_text_ord_ore right operand of the blocked operator +--! @param selector public.{{prefix}}_text_ord_ore right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_text_ord_ore) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_text_ord_ore, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_text_ord_ore, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_text_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_text_ord_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_text_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_text_ord_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_text_ord_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_text_ord_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_text_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_text_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_text_ord_ore, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_ord_ore, b public.{{prefix}}_text_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_text_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_text_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_text_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_text_ord_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_ord_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_text_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_text_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_text_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_text_ord_ore, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_ord_ore, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_ord_ore, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_ord_ore, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_ord_ore, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_text_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_text_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_text_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_text_ord_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_text_ord_ore, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_text_ord_ore, b public.{{prefix}}_text_ord_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_text_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_text_ord_ore, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_text_ord_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_text_ord_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_text_ord_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_ord_ore'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/text/text_ord_ore_operators.sql b/packages/eql/src/v3/scalars/text/text_ord_ore_operators.sql index bead4d0c1..4a4a9d957 100644 --- a/packages/eql/src/v3/scalars/text/text_ord_ore_operators.sql +++ b/packages/eql/src/v3/scalars/text/text_ord_ore_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/text/text_ord_ore_functions.sql --! @file encrypted_domain/text/text_ord_ore_operators.sql ---! @brief Operators for public.eql_v3_text_ord_ore. +--! @brief Operators for public.{{prefix}}_text_ord_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = public.eql_v3_text_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = public.eql_v3_text_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = public.eql_v3_text_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = public.eql_v3_text_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = public.eql_v3_text_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = public.eql_v3_text_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = public.eql_v3_text_ord_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ore ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = public.eql_v3_text_ord_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ore ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ore + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ore ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ore + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ore ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = public.eql_v3_text_ord_ore + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ore ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ore + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ore ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = public.eql_v3_text_ord_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ore ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_text_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_ord_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_ord_ore ); diff --git a/packages/eql/src/v3/scalars/text/text_search_aggregates.sql b/packages/eql/src/v3/scalars/text/text_search_aggregates.sql index cd7377420..eb105ee61 100644 --- a/packages/eql/src/v3/scalars/text/text_search_aggregates.sql +++ b/packages/eql/src/v3/scalars/text/text_search_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/text/text_search_operators.sql --! @file encrypted_domain/text/text_search_aggregates.sql ---! @brief Aggregates for public.eql_v3_text_search. +--! @brief Aggregates for public.{{prefix}}_text_search. ---! @brief State function for min on public.eql_v3_text_search. ---! @param state public.eql_v3_text_search ---! @param value public.eql_v3_text_search ---! @return public.eql_v3_text_search -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_text_search, value public.eql_v3_text_search) -RETURNS public.eql_v3_text_search +--! @brief State function for min on public.{{prefix}}_text_search. +--! @param state public.{{prefix}}_text_search +--! @param value public.{{prefix}}_text_search +--! @return public.{{prefix}}_text_search +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_text_search, value public.{{prefix}}_text_search) +RETURNS public.{{prefix}}_text_search LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_text_search. ---! @param input public.eql_v3_text_search ---! @return public.eql_v3_text_search -CREATE AGGREGATE eql_v3.min(public.eql_v3_text_search) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_text_search, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_text_search. +--! @param input public.{{prefix}}_text_search +--! @return public.{{prefix}}_text_search +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_text_search) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_text_search, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_text_search. ---! @param state public.eql_v3_text_search ---! @param value public.eql_v3_text_search ---! @return public.eql_v3_text_search -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_text_search, value public.eql_v3_text_search) -RETURNS public.eql_v3_text_search +--! @brief State function for max on public.{{prefix}}_text_search. +--! @param state public.{{prefix}}_text_search +--! @param value public.{{prefix}}_text_search +--! @return public.{{prefix}}_text_search +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_text_search, value public.{{prefix}}_text_search) +RETURNS public.{{prefix}}_text_search LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_text_search. ---! @param input public.eql_v3_text_search ---! @return public.eql_v3_text_search -CREATE AGGREGATE eql_v3.max(public.eql_v3_text_search) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_text_search, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_text_search. +--! @param input public.{{prefix}}_text_search +--! @return public.{{prefix}}_text_search +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_text_search) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_text_search, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/text/text_search_functions.sql b/packages/eql/src/v3/scalars/text/text_search_functions.sql index b4cf3f5d2..22dfe9043 100644 --- a/packages/eql/src/v3/scalars/text/text_search_functions.sql +++ b/packages/eql/src/v3/scalars/text/text_search_functions.sql @@ -7,560 +7,560 @@ -- REQUIRE: src/v3/sem/bloom_filter/functions.sql --! @file encrypted_domain/text/text_search_functions.sql ---! @brief Functions for public.eql_v3_text_search. +--! @brief Functions for public.{{prefix}}_text_search. ---! @brief Index extractor for public.eql_v3_text_search. ---! @param a public.eql_v3_text_search ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a public.eql_v3_text_search) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for public.{{prefix}}_text_search. +--! @param a public.{{prefix}}_text_search +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a public.{{prefix}}_text_search) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Index extractor for public.eql_v3_text_search. ---! @param a public.eql_v3_text_search ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a public.eql_v3_text_search) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for public.{{prefix}}_text_search. +--! @param a public.{{prefix}}_text_search +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a public.{{prefix}}_text_search) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Index extractor for public.eql_v3_text_search. ---! @param a public.eql_v3_text_search ---! @return eql_v3_internal.bloom_filter -CREATE FUNCTION eql_v3.match_term(a public.eql_v3_text_search) -RETURNS eql_v3_internal.bloom_filter +--! @brief Index extractor for public.{{prefix}}_text_search. +--! @param a public.{{prefix}}_text_search +--! @return {{prefix}}_internal.bloom_filter +CREATE FUNCTION {{prefix}}.match_term(a public.{{prefix}}_text_search) +RETURNS {{prefix}}_internal.bloom_filter LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.bloom_filter(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.bloom_filter(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. ---! @param a public.eql_v3_text_search ---! @param b public.eql_v3_text_search +--! @brief Operator wrapper for public.{{prefix}}_text_search. +--! @param a public.{{prefix}}_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_text_search, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. ---! @param a public.eql_v3_text_search +--! @brief Operator wrapper for public.{{prefix}}_text_search. +--! @param a public.{{prefix}}_text_search --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_text_search, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_search, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b::public.eql_v3_text_search) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_text_search) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. +--! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a jsonb ---! @param b public.eql_v3_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_text_search) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_search) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. ---! @param a public.eql_v3_text_search ---! @param b public.eql_v3_text_search +--! @brief Operator wrapper for public.{{prefix}}_text_search. +--! @param a public.{{prefix}}_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_text_search, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. ---! @param a public.eql_v3_text_search +--! @brief Operator wrapper for public.{{prefix}}_text_search. +--! @param a public.{{prefix}}_text_search --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_text_search, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_search, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b::public.eql_v3_text_search) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_text_search) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. +--! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a jsonb ---! @param b public.eql_v3_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_text_search) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_search) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. ---! @param a public.eql_v3_text_search ---! @param b public.eql_v3_text_search +--! @brief Operator wrapper for public.{{prefix}}_text_search. +--! @param a public.{{prefix}}_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_text_search, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. ---! @param a public.eql_v3_text_search +--! @brief Operator wrapper for public.{{prefix}}_text_search. +--! @param a public.{{prefix}}_text_search --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_text_search, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_search, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b::public.eql_v3_text_search) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_text_search) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. +--! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a jsonb ---! @param b public.eql_v3_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_text_search) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_search) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. ---! @param a public.eql_v3_text_search ---! @param b public.eql_v3_text_search +--! @brief Operator wrapper for public.{{prefix}}_text_search. +--! @param a public.{{prefix}}_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_text_search, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. ---! @param a public.eql_v3_text_search +--! @brief Operator wrapper for public.{{prefix}}_text_search. +--! @param a public.{{prefix}}_text_search --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_text_search, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_search, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b::public.eql_v3_text_search) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_text_search) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. +--! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a jsonb ---! @param b public.eql_v3_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_text_search) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_search) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. ---! @param a public.eql_v3_text_search ---! @param b public.eql_v3_text_search +--! @brief Operator wrapper for public.{{prefix}}_text_search. +--! @param a public.{{prefix}}_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_text_search, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. ---! @param a public.eql_v3_text_search +--! @brief Operator wrapper for public.{{prefix}}_text_search. +--! @param a public.{{prefix}}_text_search --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_text_search, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_search, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b::public.eql_v3_text_search) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_text_search) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. +--! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a jsonb ---! @param b public.eql_v3_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_text_search) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_search) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. ---! @param a public.eql_v3_text_search ---! @param b public.eql_v3_text_search +--! @brief Operator wrapper for public.{{prefix}}_text_search. +--! @param a public.{{prefix}}_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_text_search, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. ---! @param a public.eql_v3_text_search +--! @brief Operator wrapper for public.{{prefix}}_text_search. +--! @param a public.{{prefix}}_text_search --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_text_search, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_search, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b::public.eql_v3_text_search) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_text_search) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. +--! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a jsonb ---! @param b public.eql_v3_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_text_search) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_search) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator ---! @param b public.eql_v3_text_search right operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator +--! @param b public.{{prefix}}_text_search right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_text_search, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_text_search, b public.{{prefix}}_text_search) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_text_search, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_text_search, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_search right operand of the blocked operator +--! @param b public.{{prefix}}_text_search right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_text_search) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator ---! @param b public.eql_v3_text_search right operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator +--! @param b public.{{prefix}}_text_search right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_text_search, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_text_search, b public.{{prefix}}_text_search) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_text_search, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_text_search, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_search right operand of the blocked operator +--! @param b public.{{prefix}}_text_search right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_text_search) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_text_search never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_text_search, selector text) -RETURNS public.eql_v3_text_search IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_search'; END; $$ +--! @return public.{{prefix}}_text_search never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_text_search, selector text) +RETURNS public.{{prefix}}_text_search IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_text_search never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_text_search, selector integer) -RETURNS public.eql_v3_text_search IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_search'; END; $$ +--! @return public.{{prefix}}_text_search never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_text_search, selector integer) +RETURNS public.{{prefix}}_text_search IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_text_search right operand of the blocked operator ---! @return public.eql_v3_text_search never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_text_search) -RETURNS public.eql_v3_text_search IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_search'; END; $$ +--! @param selector public.{{prefix}}_text_search right operand of the blocked operator +--! @return public.{{prefix}}_text_search never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_text_search) +RETURNS public.{{prefix}}_text_search IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_text_search, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_text_search, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_text_search, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_text_search, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_text_search right operand of the blocked operator +--! @param selector public.{{prefix}}_text_search right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_text_search) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_text_search, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_text_search, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_text_search, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_text_search, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_text_search, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_text_search, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_text_search, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_text_search, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Operator wrapper for public.eql_v3_text_search. ---! @param a public.eql_v3_text_search ---! @param b public.eql_v3_text_search +--! @brief Operator wrapper for public.{{prefix}}_text_search. +--! @param a public.{{prefix}}_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.matches(a public.eql_v3_text_search, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.matches(a public.{{prefix}}_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT eql_v3.match_term(a) @> eql_v3.match_term(b) AND (cardinality(eql_v3.match_term(b)) > 0 OR cardinality(eql_v3.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. ---! @param a public.eql_v3_text_search +--! @brief Operator wrapper for public.{{prefix}}_text_search. +--! @param a public.{{prefix}}_text_search --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.matches(a public.eql_v3_text_search, b jsonb) +CREATE FUNCTION {{prefix}}.matches(a public.{{prefix}}_text_search, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT eql_v3.match_term(a) @> eql_v3.match_term(b::public.eql_v3_text_search) AND (cardinality(eql_v3.match_term(b::public.eql_v3_text_search)) > 0 OR cardinality(eql_v3.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b::public.{{prefix}}_text_search) AND (cardinality({{prefix}}.match_term(b::public.{{prefix}}_text_search)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; ---! @brief Operator wrapper for public.eql_v3_text_search. +--! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a jsonb ---! @param b public.eql_v3_text_search +--! @param b public.{{prefix}}_text_search --! @return boolean -CREATE FUNCTION eql_v3.matches(a jsonb, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}.matches(a jsonb, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT eql_v3.match_term(a::public.eql_v3_text_search) @> eql_v3.match_term(b) AND (cardinality(eql_v3.match_term(b)) > 0 OR cardinality(eql_v3.match_term(a::public.eql_v3_text_search)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a::public.{{prefix}}_text_search) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a::public.{{prefix}}_text_search)) = 0) $$; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_text_search, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_search, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_text_search, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_text_search, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_text_search, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_text_search, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_search, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_search, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_search, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_search, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_search, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_search, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_text_search, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_text_search, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator ---! @param b public.eql_v3_text_search right operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator +--! @param b public.{{prefix}}_text_search right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_text_search, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_text_search, b public.{{prefix}}_text_search) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search left operand of the blocked operator +--! @param a public.{{prefix}}_text_search left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_text_search, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_text_search, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_search right operand of the blocked operator +--! @param b public.{{prefix}}_text_search right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_text_search) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_text_search) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_search'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_search'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/text/text_search_operators.sql b/packages/eql/src/v3/scalars/text/text_search_operators.sql index 68181488c..e335cfc71 100644 --- a/packages/eql/src/v3/scalars/text/text_search_operators.sql +++ b/packages/eql/src/v3/scalars/text/text_search_operators.sql @@ -4,260 +4,260 @@ -- REQUIRE: src/v3/scalars/text/text_search_functions.sql --! @file encrypted_domain/text/text_search_operators.sql ---! @brief Operators for public.eql_v3_text_search. +--! @brief Operators for public.{{prefix}}_text_search. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_text_search, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = public.{{prefix}}_text_search, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_text_search, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_text_search, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = public.{{prefix}}_text_search, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_text_search, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_text_search, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = public.{{prefix}}_text_search, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_text_search, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_text_search, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = public.{{prefix}}_text_search, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_text_search, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_text_search, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = public.{{prefix}}_text_search, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_text_search, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_text_search, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = public.{{prefix}}_text_search, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_text_search, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_text_search, RIGHTARG = public.eql_v3_text_search + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = public.{{prefix}}_text_search ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_text_search, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_text_search, RIGHTARG = public.eql_v3_text_search + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = public.{{prefix}}_text_search ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_text_search, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_text_search, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_text_search, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_text_search, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_text_search, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_text_search, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_text_search, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_text_search, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_text_search, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3.matches, - LEFTARG = public.eql_v3_text_search, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.matches, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = public.{{prefix}}_text_search, RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3.matches, - LEFTARG = public.eql_v3_text_search, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.matches, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = jsonb, RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3.matches, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search, + FUNCTION = {{prefix}}.matches, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search, RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_text_search, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_text_search, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_text_search, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_search, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_search, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_search, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_text_search, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_text_search, RIGHTARG = public.eql_v3_text_search + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = public.{{prefix}}_text_search ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_text_search, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search ); diff --git a/packages/eql/src/v3/scalars/text/text_search_ore_aggregates.sql b/packages/eql/src/v3/scalars/text/text_search_ore_aggregates.sql index 5204b2f58..0f67b6f9f 100644 --- a/packages/eql/src/v3/scalars/text/text_search_ore_aggregates.sql +++ b/packages/eql/src/v3/scalars/text/text_search_ore_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/text/text_search_ore_operators.sql --! @file encrypted_domain/text/text_search_ore_aggregates.sql ---! @brief Aggregates for public.eql_v3_text_search_ore. +--! @brief Aggregates for public.{{prefix}}_text_search_ore. ---! @brief State function for min on public.eql_v3_text_search_ore. ---! @param state public.eql_v3_text_search_ore ---! @param value public.eql_v3_text_search_ore ---! @return public.eql_v3_text_search_ore -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_text_search_ore, value public.eql_v3_text_search_ore) -RETURNS public.eql_v3_text_search_ore +--! @brief State function for min on public.{{prefix}}_text_search_ore. +--! @param state public.{{prefix}}_text_search_ore +--! @param value public.{{prefix}}_text_search_ore +--! @return public.{{prefix}}_text_search_ore +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_text_search_ore, value public.{{prefix}}_text_search_ore) +RETURNS public.{{prefix}}_text_search_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_text_search_ore. ---! @param input public.eql_v3_text_search_ore ---! @return public.eql_v3_text_search_ore -CREATE AGGREGATE eql_v3.min(public.eql_v3_text_search_ore) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_text_search_ore, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_text_search_ore. +--! @param input public.{{prefix}}_text_search_ore +--! @return public.{{prefix}}_text_search_ore +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_text_search_ore) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_text_search_ore, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_text_search_ore. ---! @param state public.eql_v3_text_search_ore ---! @param value public.eql_v3_text_search_ore ---! @return public.eql_v3_text_search_ore -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_text_search_ore, value public.eql_v3_text_search_ore) -RETURNS public.eql_v3_text_search_ore +--! @brief State function for max on public.{{prefix}}_text_search_ore. +--! @param state public.{{prefix}}_text_search_ore +--! @param value public.{{prefix}}_text_search_ore +--! @return public.{{prefix}}_text_search_ore +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_text_search_ore, value public.{{prefix}}_text_search_ore) +RETURNS public.{{prefix}}_text_search_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_text_search_ore. ---! @param input public.eql_v3_text_search_ore ---! @return public.eql_v3_text_search_ore -CREATE AGGREGATE eql_v3.max(public.eql_v3_text_search_ore) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_text_search_ore, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_text_search_ore. +--! @param input public.{{prefix}}_text_search_ore +--! @return public.{{prefix}}_text_search_ore +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_text_search_ore) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_text_search_ore, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/text/text_search_ore_functions.sql b/packages/eql/src/v3/scalars/text/text_search_ore_functions.sql index 60f75a5ed..fb3eaa35d 100644 --- a/packages/eql/src/v3/scalars/text/text_search_ore_functions.sql +++ b/packages/eql/src/v3/scalars/text/text_search_ore_functions.sql @@ -8,560 +8,560 @@ -- REQUIRE: src/v3/sem/bloom_filter/functions.sql --! @file encrypted_domain/text/text_search_ore_functions.sql ---! @brief Functions for public.eql_v3_text_search_ore. +--! @brief Functions for public.{{prefix}}_text_search_ore. ---! @brief Index extractor for public.eql_v3_text_search_ore. ---! @param a public.eql_v3_text_search_ore ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a public.eql_v3_text_search_ore) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for public.{{prefix}}_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a public.{{prefix}}_text_search_ore) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Index extractor for public.eql_v3_text_search_ore. ---! @param a public.eql_v3_text_search_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a public.eql_v3_text_search_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for public.{{prefix}}_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a public.{{prefix}}_text_search_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Index extractor for public.eql_v3_text_search_ore. ---! @param a public.eql_v3_text_search_ore ---! @return eql_v3_internal.bloom_filter -CREATE FUNCTION eql_v3.match_term(a public.eql_v3_text_search_ore) -RETURNS eql_v3_internal.bloom_filter +--! @brief Index extractor for public.{{prefix}}_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore +--! @return {{prefix}}_internal.bloom_filter +CREATE FUNCTION {{prefix}}.match_term(a public.{{prefix}}_text_search_ore) +RETURNS {{prefix}}_internal.bloom_filter LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.bloom_filter(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.bloom_filter(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. ---! @param a public.eql_v3_text_search_ore ---! @param b public.eql_v3_text_search_ore +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_text_search_ore, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_search_ore, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. ---! @param a public.eql_v3_text_search_ore +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_text_search_ore, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_search_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b::public.eql_v3_text_search_ore) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_text_search_ore) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a jsonb ---! @param b public.eql_v3_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_text_search_ore) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_search_ore) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. ---! @param a public.eql_v3_text_search_ore ---! @param b public.eql_v3_text_search_ore +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_text_search_ore, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_search_ore, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. ---! @param a public.eql_v3_text_search_ore +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_text_search_ore, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_search_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b::public.eql_v3_text_search_ore) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_text_search_ore) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a jsonb ---! @param b public.eql_v3_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_text_search_ore) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_search_ore) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. ---! @param a public.eql_v3_text_search_ore ---! @param b public.eql_v3_text_search_ore +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_text_search_ore, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_search_ore, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. ---! @param a public.eql_v3_text_search_ore +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_text_search_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_search_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b::public.eql_v3_text_search_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_search_ore) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a jsonb ---! @param b public.eql_v3_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_text_search_ore) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_search_ore) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. ---! @param a public.eql_v3_text_search_ore ---! @param b public.eql_v3_text_search_ore +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_text_search_ore, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_search_ore, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. ---! @param a public.eql_v3_text_search_ore +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_text_search_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_search_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b::public.eql_v3_text_search_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_search_ore) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a jsonb ---! @param b public.eql_v3_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_text_search_ore) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_search_ore) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. ---! @param a public.eql_v3_text_search_ore ---! @param b public.eql_v3_text_search_ore +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_text_search_ore, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_search_ore, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. ---! @param a public.eql_v3_text_search_ore +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_text_search_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_search_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b::public.eql_v3_text_search_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_search_ore) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a jsonb ---! @param b public.eql_v3_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_text_search_ore) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_search_ore) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. ---! @param a public.eql_v3_text_search_ore ---! @param b public.eql_v3_text_search_ore +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_text_search_ore, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_search_ore, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. ---! @param a public.eql_v3_text_search_ore +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_text_search_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_search_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b::public.eql_v3_text_search_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_search_ore) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a jsonb ---! @param b public.eql_v3_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_text_search_ore) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_search_ore) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator ---! @param b public.eql_v3_text_search_ore right operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator +--! @param b public.{{prefix}}_text_search_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_text_search_ore, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_text_search_ore, b public.{{prefix}}_text_search_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_text_search_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_text_search_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_search_ore right operand of the blocked operator +--! @param b public.{{prefix}}_text_search_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_text_search_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator ---! @param b public.eql_v3_text_search_ore right operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator +--! @param b public.{{prefix}}_text_search_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_text_search_ore, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_text_search_ore, b public.{{prefix}}_text_search_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_text_search_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_text_search_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_search_ore right operand of the blocked operator +--! @param b public.{{prefix}}_text_search_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_text_search_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_text_search_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_text_search_ore, selector text) -RETURNS public.eql_v3_text_search_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_search_ore'; END; $$ +--! @return public.{{prefix}}_text_search_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_text_search_ore, selector text) +RETURNS public.{{prefix}}_text_search_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_text_search_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_text_search_ore, selector integer) -RETURNS public.eql_v3_text_search_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_search_ore'; END; $$ +--! @return public.{{prefix}}_text_search_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_text_search_ore, selector integer) +RETURNS public.{{prefix}}_text_search_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_text_search_ore right operand of the blocked operator ---! @return public.eql_v3_text_search_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_text_search_ore) -RETURNS public.eql_v3_text_search_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_text_search_ore'; END; $$ +--! @param selector public.{{prefix}}_text_search_ore right operand of the blocked operator +--! @return public.{{prefix}}_text_search_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_text_search_ore) +RETURNS public.{{prefix}}_text_search_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_text_search_ore, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_text_search_ore, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_text_search_ore, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_text_search_ore, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_text_search_ore right operand of the blocked operator +--! @param selector public.{{prefix}}_text_search_ore right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_text_search_ore) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_text_search_ore, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_text_search_ore, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_text_search_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_text_search_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_text_search_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_text_search_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_text_search_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_text_search_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. ---! @param a public.eql_v3_text_search_ore ---! @param b public.eql_v3_text_search_ore +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.matches(a public.eql_v3_text_search_ore, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.matches(a public.{{prefix}}_text_search_ore, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT eql_v3.match_term(a) @> eql_v3.match_term(b) AND (cardinality(eql_v3.match_term(b)) > 0 OR cardinality(eql_v3.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. ---! @param a public.eql_v3_text_search_ore +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. +--! @param a public.{{prefix}}_text_search_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.matches(a public.eql_v3_text_search_ore, b jsonb) +CREATE FUNCTION {{prefix}}.matches(a public.{{prefix}}_text_search_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT eql_v3.match_term(a) @> eql_v3.match_term(b::public.eql_v3_text_search_ore) AND (cardinality(eql_v3.match_term(b::public.eql_v3_text_search_ore)) > 0 OR cardinality(eql_v3.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b::public.{{prefix}}_text_search_ore) AND (cardinality({{prefix}}.match_term(b::public.{{prefix}}_text_search_ore)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; ---! @brief Operator wrapper for public.eql_v3_text_search_ore. +--! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a jsonb ---! @param b public.eql_v3_text_search_ore +--! @param b public.{{prefix}}_text_search_ore --! @return boolean -CREATE FUNCTION eql_v3.matches(a jsonb, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}.matches(a jsonb, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT eql_v3.match_term(a::public.eql_v3_text_search_ore) @> eql_v3.match_term(b) AND (cardinality(eql_v3.match_term(b)) > 0 OR cardinality(eql_v3.match_term(a::public.eql_v3_text_search_ore)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a::public.{{prefix}}_text_search_ore) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a::public.{{prefix}}_text_search_ore)) = 0) $$; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_text_search_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_search_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_text_search_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_text_search_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_text_search_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_text_search_ore, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_search_ore, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_search_ore, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_search_ore, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_search_ore, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_text_search_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_text_search_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_text_search_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_text_search_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator ---! @param b public.eql_v3_text_search_ore right operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator +--! @param b public.{{prefix}}_text_search_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_text_search_ore, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_text_search_ore, b public.{{prefix}}_text_search_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_text_search_ore left operand of the blocked operator +--! @param a public.{{prefix}}_text_search_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_text_search_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_text_search_ore, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_text_search_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_text_search_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_text_search_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_text_search_ore right operand of the blocked operator +--! @param b public.{{prefix}}_text_search_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_text_search_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_text_search_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_text_search_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_text_search_ore'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/text/text_search_ore_operators.sql b/packages/eql/src/v3/scalars/text/text_search_ore_operators.sql index b1980cc7d..a8d35616d 100644 --- a/packages/eql/src/v3/scalars/text/text_search_ore_operators.sql +++ b/packages/eql/src/v3/scalars/text/text_search_ore_operators.sql @@ -4,260 +4,260 @@ -- REQUIRE: src/v3/scalars/text/text_search_ore_functions.sql --! @file encrypted_domain/text/text_search_ore_operators.sql ---! @brief Operators for public.eql_v3_text_search_ore. +--! @brief Operators for public.{{prefix}}_text_search_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = public.{{prefix}}_text_search_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = public.{{prefix}}_text_search_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = public.{{prefix}}_text_search_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = public.{{prefix}}_text_search_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = public.{{prefix}}_text_search_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = public.{{prefix}}_text_search_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = public.eql_v3_text_search_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = public.{{prefix}}_text_search_ore ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = public.eql_v3_text_search_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = public.{{prefix}}_text_search_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search_ore ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search_ore + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search_ore ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search_ore + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search_ore ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3.matches, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.matches, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = public.{{prefix}}_text_search_ore, RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3.matches, - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.matches, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = jsonb, RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3.matches, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search_ore, + FUNCTION = {{prefix}}.matches, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search_ore, RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = public.eql_v3_text_search_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = public.{{prefix}}_text_search_ore ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_text_search_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_text_search_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_text_search_ore ); diff --git a/packages/eql/src/v3/scalars/text/text_types.sql b/packages/eql/src/v3/scalars/text/text_types.sql index 28f2718bb..c4c93d202 100644 --- a/packages/eql/src/v3/scalars/text/text_types.sql +++ b/packages/eql/src/v3/scalars/text/text_types.sql @@ -6,65 +6,65 @@ DO $$ BEGIN - --! @brief Encrypted domain public.eql_v3_text. + --! @brief Encrypted domain public.{{prefix}}_text. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_text' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_text' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_text AS jsonb + CREATE DOMAIN public.{{prefix}}_text AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_text IS 'EQL encrypted text (storage only)'; + COMMENT ON DOMAIN public.{{prefix}}_text IS 'EQL encrypted text (storage only)'; - --! @brief Encrypted domain public.eql_v3_text_eq. + --! @brief Encrypted domain public.{{prefix}}_text_eq. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_text_eq' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_text_eq' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_text_eq AS jsonb + CREATE DOMAIN public.{{prefix}}_text_eq AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'hm' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_text_eq IS 'EQL encrypted text (equality)'; + COMMENT ON DOMAIN public.{{prefix}}_text_eq IS 'EQL encrypted text (equality)'; - --! @brief Encrypted domain public.eql_v3_text_match. + --! @brief Encrypted domain public.{{prefix}}_text_match. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_text_match' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_text_match' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_text_match AS jsonb + CREATE DOMAIN public.{{prefix}}_text_match AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'bf' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_text_match IS 'EQL encrypted text (matching)'; + COMMENT ON DOMAIN public.{{prefix}}_text_match IS 'EQL encrypted text (matching)'; - --! @brief Encrypted domain public.eql_v3_text_ord_ore. + --! @brief Encrypted domain public.{{prefix}}_text_ord_ore. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_text_ord_ore' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_text_ord_ore' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_text_ord_ore AS jsonb + CREATE DOMAIN public.{{prefix}}_text_ord_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -74,18 +74,18 @@ BEGIN AND VALUE ? 'ob' AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_text_ord_ore IS 'EQL encrypted text (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_text_ord_ore IS 'EQL encrypted text (equality, ordering)'; - --! @brief Encrypted domain public.eql_v3_text_ord. + --! @brief Encrypted domain public.{{prefix}}_text_ord. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_text_ord' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_text_ord' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_text_ord AS jsonb + CREATE DOMAIN public.{{prefix}}_text_ord AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -93,18 +93,18 @@ BEGIN AND VALUE ? 'c' AND VALUE ? 'hm' AND VALUE ? 'op' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_text_ord IS 'EQL encrypted text (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_text_ord IS 'EQL encrypted text (equality, ordering)'; - --! @brief Encrypted domain public.eql_v3_text_ord_ope. + --! @brief Encrypted domain public.{{prefix}}_text_ord_ope. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_text_ord_ope' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_text_ord_ope' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_text_ord_ope AS jsonb + CREATE DOMAIN public.{{prefix}}_text_ord_ope AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -112,18 +112,18 @@ BEGIN AND VALUE ? 'c' AND VALUE ? 'hm' AND VALUE ? 'op' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_text_ord_ope IS 'EQL encrypted text (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_text_ord_ope IS 'EQL encrypted text (equality, ordering)'; - --! @brief Encrypted domain public.eql_v3_text_search_ore. + --! @brief Encrypted domain public.{{prefix}}_text_search_ore. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_text_search_ore' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_text_search_ore' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_text_search_ore AS jsonb + CREATE DOMAIN public.{{prefix}}_text_search_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -134,18 +134,18 @@ BEGIN AND VALUE ? 'bf' AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_text_search_ore IS 'EQL encrypted text (equality, ordering, matching)'; + COMMENT ON DOMAIN public.{{prefix}}_text_search_ore IS 'EQL encrypted text (equality, ordering, matching)'; - --! @brief Encrypted domain public.eql_v3_text_search. + --! @brief Encrypted domain public.{{prefix}}_text_search. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_text_search' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_text_search' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_text_search AS jsonb + CREATE DOMAIN public.{{prefix}}_text_search AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -154,10 +154,10 @@ BEGIN AND VALUE ? 'hm' AND VALUE ? 'op' AND VALUE ? 'bf' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_text_search IS 'EQL encrypted text (equality, ordering, matching)'; + COMMENT ON DOMAIN public.{{prefix}}_text_search IS 'EQL encrypted text (equality, ordering, matching)'; END $$; diff --git a/packages/eql/src/v3/scalars/timestamp/json_entry_timestamp_functions.sql b/packages/eql/src/v3/scalars/timestamp/json_entry_timestamp_functions.sql index 56f32c95a..69d61924d 100644 --- a/packages/eql/src/v3/scalars/timestamp/json_entry_timestamp_functions.sql +++ b/packages/eql/src/v3/scalars/timestamp/json_entry_timestamp_functions.sql @@ -5,340 +5,340 @@ -- REQUIRE: src/v3/scalars/timestamp/query_timestamp_types.sql --! @file encrypted_domain/timestamp/json_entry_timestamp_functions.sql ---! @brief Functions for public.eql_v3_json_entry. +--! @brief Functions for public.{{prefix}}_json_entry. ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_timestamp_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_timestamp_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json_entry, b eql_v3.query_timestamp_ord) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json_entry, b {{prefix}}.query_timestamp_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_timestamp_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_timestamp_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a eql_v3.query_timestamp_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_timestamp_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_timestamp_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json_entry, b eql_v3.query_timestamp_ord) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json_entry, b {{prefix}}.query_timestamp_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_timestamp_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_timestamp_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a eql_v3.query_timestamp_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_timestamp_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_timestamp_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_json_entry, b eql_v3.query_timestamp_ord) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_timestamp_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_timestamp_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_timestamp_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a eql_v3.query_timestamp_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_timestamp_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_timestamp_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_json_entry, b eql_v3.query_timestamp_ord) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_timestamp_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_timestamp_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_timestamp_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a eql_v3.query_timestamp_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_timestamp_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_timestamp_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_json_entry, b eql_v3.query_timestamp_ord) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_timestamp_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_timestamp_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_timestamp_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a eql_v3.query_timestamp_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_timestamp_ord right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_timestamp_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_json_entry, b eql_v3.query_timestamp_ord) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_timestamp_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_timestamp_ord left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_timestamp_ord left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a eql_v3.query_timestamp_ord, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_timestamp_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_timestamp_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_json_entry, b eql_v3.query_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_json_entry, b {{prefix}}.query_timestamp_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_timestamp_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_timestamp_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a eql_v3.query_timestamp_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_timestamp_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_timestamp_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_json_entry, b eql_v3.query_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_json_entry, b {{prefix}}.query_timestamp_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_timestamp_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_timestamp_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a eql_v3.query_timestamp_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_timestamp_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_timestamp_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_json_entry, b eql_v3.query_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_timestamp_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_timestamp_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_timestamp_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a eql_v3.query_timestamp_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_timestamp_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_timestamp_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_json_entry, b eql_v3.query_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_timestamp_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_timestamp_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_timestamp_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a eql_v3.query_timestamp_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_timestamp_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_timestamp_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_json_entry, b eql_v3.query_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_timestamp_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_timestamp_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_timestamp_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a eql_v3.query_timestamp_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_json_entry left operand of the blocked operator ---! @param b eql_v3.query_timestamp_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_json_entry left operand of the blocked operator +--! @param b {{prefix}}.query_timestamp_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_json_entry, b eql_v3.query_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_timestamp_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_json_entry. +--! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! ---! Intercepts an operator that is not supported on public.eql_v3_json_entry and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_json_entry and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a eql_v3.query_timestamp_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_json_entry right operand of the blocked operator +--! @param a {{prefix}}.query_timestamp_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_json_entry right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a eql_v3.query_timestamp_ord_ope, b public.eql_v3_json_entry) +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_json_entry) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_json_entry'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_json_entry'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/timestamp/json_entry_timestamp_operators.sql b/packages/eql/src/v3/scalars/timestamp/json_entry_timestamp_operators.sql index 2da514109..99c06b37e 100644 --- a/packages/eql/src/v3/scalars/timestamp/json_entry_timestamp_operators.sql +++ b/packages/eql/src/v3/scalars/timestamp/json_entry_timestamp_operators.sql @@ -5,124 +5,124 @@ -- REQUIRE: src/v3/scalars/timestamp/json_entry_timestamp_functions.sql --! @file encrypted_domain/timestamp/json_entry_timestamp_operators.sql ---! @brief Operators for public.eql_v3_json_entry. +--! @brief Operators for public.{{prefix}}_json_entry. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_timestamp_ord + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_timestamp_ord ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = eql_v3.query_timestamp_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_timestamp_ord + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_timestamp_ord ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = eql_v3.query_timestamp_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_timestamp_ord + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_timestamp_ord ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = eql_v3.query_timestamp_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_timestamp_ord + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_timestamp_ord ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = eql_v3.query_timestamp_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_timestamp_ord + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_timestamp_ord ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = eql_v3.query_timestamp_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_timestamp_ord + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_timestamp_ord ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = eql_v3.query_timestamp_ord, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_timestamp_ord_ope + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_timestamp_ord_ope ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = eql_v3.query_timestamp_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_timestamp_ord_ope + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_timestamp_ord_ope ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = eql_v3.query_timestamp_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_timestamp_ord_ope + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_timestamp_ord_ope ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = eql_v3.query_timestamp_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_timestamp_ord_ope + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_timestamp_ord_ope ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = eql_v3.query_timestamp_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_timestamp_ord_ope + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_timestamp_ord_ope ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = eql_v3.query_timestamp_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_json_entry, RIGHTARG = eql_v3.query_timestamp_ord_ope + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_json_entry, RIGHTARG = {{prefix}}.query_timestamp_ord_ope ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = eql_v3.query_timestamp_ord_ope, RIGHTARG = public.eql_v3_json_entry + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_json_entry ); diff --git a/packages/eql/src/v3/scalars/timestamp/query_timestamp_eq_functions.sql b/packages/eql/src/v3/scalars/timestamp/query_timestamp_eq_functions.sql index 9bee74f0d..9adbce317 100644 --- a/packages/eql/src/v3/scalars/timestamp/query_timestamp_eq_functions.sql +++ b/packages/eql/src/v3/scalars/timestamp/query_timestamp_eq_functions.sql @@ -4,44 +4,44 @@ -- REQUIRE: src/v3/scalars/timestamp/timestamp_eq_functions.sql --! @file encrypted_domain/timestamp/query_timestamp_eq_functions.sql ---! @brief Functions for eql_v3.query_timestamp_eq. +--! @brief Functions for {{prefix}}.query_timestamp_eq. ---! @brief Index extractor for eql_v3.query_timestamp_eq. ---! @param a eql_v3.query_timestamp_eq ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a eql_v3.query_timestamp_eq) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for {{prefix}}.query_timestamp_eq. +--! @param a {{prefix}}.query_timestamp_eq +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a {{prefix}}.query_timestamp_eq) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_eq. ---! @param a public.eql_v3_timestamp_eq ---! @param b eql_v3.query_timestamp_eq +--! @brief Operator wrapper for {{prefix}}.query_timestamp_eq. +--! @param a public.{{prefix}}_timestamp_eq +--! @param b {{prefix}}.query_timestamp_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_timestamp_eq, b eql_v3.query_timestamp_eq) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_eq, b {{prefix}}.query_timestamp_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_eq. ---! @param a eql_v3.query_timestamp_eq ---! @param b public.eql_v3_timestamp_eq +--! @brief Operator wrapper for {{prefix}}.query_timestamp_eq. +--! @param a {{prefix}}.query_timestamp_eq +--! @param b public.{{prefix}}_timestamp_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_timestamp_eq, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_timestamp_eq, b public.{{prefix}}_timestamp_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_eq. ---! @param a public.eql_v3_timestamp_eq ---! @param b eql_v3.query_timestamp_eq +--! @brief Operator wrapper for {{prefix}}.query_timestamp_eq. +--! @param a public.{{prefix}}_timestamp_eq +--! @param b {{prefix}}.query_timestamp_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_timestamp_eq, b eql_v3.query_timestamp_eq) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_eq, b {{prefix}}.query_timestamp_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_eq. ---! @param a eql_v3.query_timestamp_eq ---! @param b public.eql_v3_timestamp_eq +--! @brief Operator wrapper for {{prefix}}.query_timestamp_eq. +--! @param a {{prefix}}.query_timestamp_eq +--! @param b public.{{prefix}}_timestamp_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_timestamp_eq, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_timestamp_eq, b public.{{prefix}}_timestamp_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; diff --git a/packages/eql/src/v3/scalars/timestamp/query_timestamp_eq_operators.sql b/packages/eql/src/v3/scalars/timestamp/query_timestamp_eq_operators.sql index 59115cfd1..da1d3981f 100644 --- a/packages/eql/src/v3/scalars/timestamp/query_timestamp_eq_operators.sql +++ b/packages/eql/src/v3/scalars/timestamp/query_timestamp_eq_operators.sql @@ -4,28 +4,28 @@ -- REQUIRE: src/v3/scalars/timestamp/query_timestamp_eq_functions.sql --! @file encrypted_domain/timestamp/query_timestamp_eq_operators.sql ---! @brief Operators for eql_v3.query_timestamp_eq. +--! @brief Operators for {{prefix}}.query_timestamp_eq. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = eql_v3.query_timestamp_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = {{prefix}}.query_timestamp_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_timestamp_eq, RIGHTARG = public.eql_v3_timestamp_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_timestamp_eq, RIGHTARG = public.{{prefix}}_timestamp_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = eql_v3.query_timestamp_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = {{prefix}}.query_timestamp_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_timestamp_eq, RIGHTARG = public.eql_v3_timestamp_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_timestamp_eq, RIGHTARG = public.{{prefix}}_timestamp_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); diff --git a/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_functions.sql b/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_functions.sql index 4fbc3c5a8..fb15aea1c 100644 --- a/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_functions.sql +++ b/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/timestamp/timestamp_ord_functions.sql --! @file encrypted_domain/timestamp/query_timestamp_ord_functions.sql ---! @brief Functions for eql_v3.query_timestamp_ord. +--! @brief Functions for {{prefix}}.query_timestamp_ord. ---! @brief Index extractor for eql_v3.query_timestamp_ord. ---! @param a eql_v3.query_timestamp_ord ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a eql_v3.query_timestamp_ord) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for {{prefix}}.query_timestamp_ord. +--! @param a {{prefix}}.query_timestamp_ord +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a {{prefix}}.query_timestamp_ord) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord. ---! @param a public.eql_v3_timestamp_ord ---! @param b eql_v3.query_timestamp_ord +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. +--! @param a public.{{prefix}}_timestamp_ord +--! @param b {{prefix}}.query_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_timestamp_ord, b eql_v3.query_timestamp_ord) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord. ---! @param a eql_v3.query_timestamp_ord ---! @param b public.eql_v3_timestamp_ord +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. +--! @param a {{prefix}}.query_timestamp_ord +--! @param b public.{{prefix}}_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_timestamp_ord, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord. ---! @param a public.eql_v3_timestamp_ord ---! @param b eql_v3.query_timestamp_ord +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. +--! @param a public.{{prefix}}_timestamp_ord +--! @param b {{prefix}}.query_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_timestamp_ord, b eql_v3.query_timestamp_ord) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord. ---! @param a eql_v3.query_timestamp_ord ---! @param b public.eql_v3_timestamp_ord +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. +--! @param a {{prefix}}.query_timestamp_ord +--! @param b public.{{prefix}}_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_timestamp_ord, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord. ---! @param a public.eql_v3_timestamp_ord ---! @param b eql_v3.query_timestamp_ord +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. +--! @param a public.{{prefix}}_timestamp_ord +--! @param b {{prefix}}.query_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_timestamp_ord, b eql_v3.query_timestamp_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord. ---! @param a eql_v3.query_timestamp_ord ---! @param b public.eql_v3_timestamp_ord +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. +--! @param a {{prefix}}.query_timestamp_ord +--! @param b public.{{prefix}}_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_timestamp_ord, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord. ---! @param a public.eql_v3_timestamp_ord ---! @param b eql_v3.query_timestamp_ord +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. +--! @param a public.{{prefix}}_timestamp_ord +--! @param b {{prefix}}.query_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_timestamp_ord, b eql_v3.query_timestamp_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord. ---! @param a eql_v3.query_timestamp_ord ---! @param b public.eql_v3_timestamp_ord +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. +--! @param a {{prefix}}.query_timestamp_ord +--! @param b public.{{prefix}}_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_timestamp_ord, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord. ---! @param a public.eql_v3_timestamp_ord ---! @param b eql_v3.query_timestamp_ord +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. +--! @param a public.{{prefix}}_timestamp_ord +--! @param b {{prefix}}.query_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_timestamp_ord, b eql_v3.query_timestamp_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord. ---! @param a eql_v3.query_timestamp_ord ---! @param b public.eql_v3_timestamp_ord +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. +--! @param a {{prefix}}.query_timestamp_ord +--! @param b public.{{prefix}}_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_timestamp_ord, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord. ---! @param a public.eql_v3_timestamp_ord ---! @param b eql_v3.query_timestamp_ord +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. +--! @param a public.{{prefix}}_timestamp_ord +--! @param b {{prefix}}.query_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_timestamp_ord, b eql_v3.query_timestamp_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord. ---! @param a eql_v3.query_timestamp_ord ---! @param b public.eql_v3_timestamp_ord +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. +--! @param a {{prefix}}.query_timestamp_ord +--! @param b public.{{prefix}}_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_timestamp_ord, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_ope_functions.sql b/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_ope_functions.sql index 9570cfaa7..a6073f700 100644 --- a/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_ope_functions.sql +++ b/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_ope_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/timestamp/timestamp_ord_ope_functions.sql --! @file encrypted_domain/timestamp/query_timestamp_ord_ope_functions.sql ---! @brief Functions for eql_v3.query_timestamp_ord_ope. +--! @brief Functions for {{prefix}}.query_timestamp_ord_ope. ---! @brief Index extractor for eql_v3.query_timestamp_ord_ope. ---! @param a eql_v3.query_timestamp_ord_ope ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a eql_v3.query_timestamp_ord_ope) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for {{prefix}}.query_timestamp_ord_ope. +--! @param a {{prefix}}.query_timestamp_ord_ope +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a {{prefix}}.query_timestamp_ord_ope) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ope. ---! @param a public.eql_v3_timestamp_ord_ope ---! @param b eql_v3.query_timestamp_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. +--! @param a public.{{prefix}}_timestamp_ord_ope +--! @param b {{prefix}}.query_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_timestamp_ord_ope, b eql_v3.query_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ope. ---! @param a eql_v3.query_timestamp_ord_ope ---! @param b public.eql_v3_timestamp_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. +--! @param a {{prefix}}.query_timestamp_ord_ope +--! @param b public.{{prefix}}_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_timestamp_ord_ope, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ope. ---! @param a public.eql_v3_timestamp_ord_ope ---! @param b eql_v3.query_timestamp_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. +--! @param a public.{{prefix}}_timestamp_ord_ope +--! @param b {{prefix}}.query_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_timestamp_ord_ope, b eql_v3.query_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ope. ---! @param a eql_v3.query_timestamp_ord_ope ---! @param b public.eql_v3_timestamp_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. +--! @param a {{prefix}}.query_timestamp_ord_ope +--! @param b public.{{prefix}}_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_timestamp_ord_ope, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ope. ---! @param a public.eql_v3_timestamp_ord_ope ---! @param b eql_v3.query_timestamp_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. +--! @param a public.{{prefix}}_timestamp_ord_ope +--! @param b {{prefix}}.query_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_timestamp_ord_ope, b eql_v3.query_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ope. ---! @param a eql_v3.query_timestamp_ord_ope ---! @param b public.eql_v3_timestamp_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. +--! @param a {{prefix}}.query_timestamp_ord_ope +--! @param b public.{{prefix}}_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_timestamp_ord_ope, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ope. ---! @param a public.eql_v3_timestamp_ord_ope ---! @param b eql_v3.query_timestamp_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. +--! @param a public.{{prefix}}_timestamp_ord_ope +--! @param b {{prefix}}.query_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_timestamp_ord_ope, b eql_v3.query_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ope. ---! @param a eql_v3.query_timestamp_ord_ope ---! @param b public.eql_v3_timestamp_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. +--! @param a {{prefix}}.query_timestamp_ord_ope +--! @param b public.{{prefix}}_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_timestamp_ord_ope, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ope. ---! @param a public.eql_v3_timestamp_ord_ope ---! @param b eql_v3.query_timestamp_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. +--! @param a public.{{prefix}}_timestamp_ord_ope +--! @param b {{prefix}}.query_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_timestamp_ord_ope, b eql_v3.query_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ope. ---! @param a eql_v3.query_timestamp_ord_ope ---! @param b public.eql_v3_timestamp_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. +--! @param a {{prefix}}.query_timestamp_ord_ope +--! @param b public.{{prefix}}_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_timestamp_ord_ope, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ope. ---! @param a public.eql_v3_timestamp_ord_ope ---! @param b eql_v3.query_timestamp_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. +--! @param a public.{{prefix}}_timestamp_ord_ope +--! @param b {{prefix}}.query_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_timestamp_ord_ope, b eql_v3.query_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ope. ---! @param a eql_v3.query_timestamp_ord_ope ---! @param b public.eql_v3_timestamp_ord_ope +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. +--! @param a {{prefix}}.query_timestamp_ord_ope +--! @param b public.{{prefix}}_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_timestamp_ord_ope, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; diff --git a/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_ope_operators.sql b/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_ope_operators.sql index bea80edde..5bd5cdd90 100644 --- a/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_ope_operators.sql +++ b/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_ope_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/timestamp/query_timestamp_ord_ope_functions.sql --! @file encrypted_domain/timestamp/query_timestamp_ord_ope_operators.sql ---! @brief Operators for eql_v3.query_timestamp_ord_ope. +--! @brief Operators for {{prefix}}.query_timestamp_ord_ope. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = eql_v3.query_timestamp_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_timestamp_ord_ope, RIGHTARG = public.eql_v3_timestamp_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = eql_v3.query_timestamp_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_timestamp_ord_ope, RIGHTARG = public.eql_v3_timestamp_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = eql_v3.query_timestamp_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_timestamp_ord_ope, RIGHTARG = public.eql_v3_timestamp_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = eql_v3.query_timestamp_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_timestamp_ord_ope, RIGHTARG = public.eql_v3_timestamp_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = eql_v3.query_timestamp_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_timestamp_ord_ope, RIGHTARG = public.eql_v3_timestamp_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = eql_v3.query_timestamp_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_timestamp_ord_ope, RIGHTARG = public.eql_v3_timestamp_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_operators.sql b/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_operators.sql index e8aba6361..303def929 100644 --- a/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_operators.sql +++ b/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/timestamp/query_timestamp_ord_functions.sql --! @file encrypted_domain/timestamp/query_timestamp_ord_operators.sql ---! @brief Operators for eql_v3.query_timestamp_ord. +--! @brief Operators for {{prefix}}.query_timestamp_ord. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = eql_v3.query_timestamp_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_timestamp_ord, RIGHTARG = public.eql_v3_timestamp_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = eql_v3.query_timestamp_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_timestamp_ord, RIGHTARG = public.eql_v3_timestamp_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = eql_v3.query_timestamp_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_timestamp_ord, RIGHTARG = public.eql_v3_timestamp_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = eql_v3.query_timestamp_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_timestamp_ord, RIGHTARG = public.eql_v3_timestamp_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = eql_v3.query_timestamp_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_timestamp_ord, RIGHTARG = public.eql_v3_timestamp_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = eql_v3.query_timestamp_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_timestamp_ord, RIGHTARG = public.eql_v3_timestamp_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_ore_functions.sql b/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_ore_functions.sql index 41c697170..b081475a3 100644 --- a/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_ore_functions.sql +++ b/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_ore_functions.sql @@ -4,108 +4,108 @@ -- REQUIRE: src/v3/scalars/timestamp/timestamp_ord_ore_functions.sql --! @file encrypted_domain/timestamp/query_timestamp_ord_ore_functions.sql ---! @brief Functions for eql_v3.query_timestamp_ord_ore. +--! @brief Functions for {{prefix}}.query_timestamp_ord_ore. ---! @brief Index extractor for eql_v3.query_timestamp_ord_ore. ---! @param a eql_v3.query_timestamp_ord_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a eql_v3.query_timestamp_ord_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for {{prefix}}.query_timestamp_ord_ore. +--! @param a {{prefix}}.query_timestamp_ord_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a {{prefix}}.query_timestamp_ord_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ore. ---! @param a public.eql_v3_timestamp_ord_ore ---! @param b eql_v3.query_timestamp_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. +--! @param a public.{{prefix}}_timestamp_ord_ore +--! @param b {{prefix}}.query_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_timestamp_ord_ore, b eql_v3.query_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ore. ---! @param a eql_v3.query_timestamp_ord_ore ---! @param b public.eql_v3_timestamp_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. +--! @param a {{prefix}}.query_timestamp_ord_ore +--! @param b public.{{prefix}}_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a eql_v3.query_timestamp_ord_ore, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ore. ---! @param a public.eql_v3_timestamp_ord_ore ---! @param b eql_v3.query_timestamp_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. +--! @param a public.{{prefix}}_timestamp_ord_ore +--! @param b {{prefix}}.query_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_timestamp_ord_ore, b eql_v3.query_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ore. ---! @param a eql_v3.query_timestamp_ord_ore ---! @param b public.eql_v3_timestamp_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. +--! @param a {{prefix}}.query_timestamp_ord_ore +--! @param b public.{{prefix}}_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a eql_v3.query_timestamp_ord_ore, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ore. ---! @param a public.eql_v3_timestamp_ord_ore ---! @param b eql_v3.query_timestamp_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. +--! @param a public.{{prefix}}_timestamp_ord_ore +--! @param b {{prefix}}.query_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_timestamp_ord_ore, b eql_v3.query_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ore. ---! @param a eql_v3.query_timestamp_ord_ore ---! @param b public.eql_v3_timestamp_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. +--! @param a {{prefix}}.query_timestamp_ord_ore +--! @param b public.{{prefix}}_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a eql_v3.query_timestamp_ord_ore, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ore. ---! @param a public.eql_v3_timestamp_ord_ore ---! @param b eql_v3.query_timestamp_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. +--! @param a public.{{prefix}}_timestamp_ord_ore +--! @param b {{prefix}}.query_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_timestamp_ord_ore, b eql_v3.query_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ore. ---! @param a eql_v3.query_timestamp_ord_ore ---! @param b public.eql_v3_timestamp_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. +--! @param a {{prefix}}.query_timestamp_ord_ore +--! @param b public.{{prefix}}_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a eql_v3.query_timestamp_ord_ore, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ore. ---! @param a public.eql_v3_timestamp_ord_ore ---! @param b eql_v3.query_timestamp_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. +--! @param a public.{{prefix}}_timestamp_ord_ore +--! @param b {{prefix}}.query_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_timestamp_ord_ore, b eql_v3.query_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ore. ---! @param a eql_v3.query_timestamp_ord_ore ---! @param b public.eql_v3_timestamp_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. +--! @param a {{prefix}}.query_timestamp_ord_ore +--! @param b public.{{prefix}}_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a eql_v3.query_timestamp_ord_ore, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ore. ---! @param a public.eql_v3_timestamp_ord_ore ---! @param b eql_v3.query_timestamp_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. +--! @param a public.{{prefix}}_timestamp_ord_ore +--! @param b {{prefix}}.query_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_timestamp_ord_ore, b eql_v3.query_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for eql_v3.query_timestamp_ord_ore. ---! @param a eql_v3.query_timestamp_ord_ore ---! @param b public.eql_v3_timestamp_ord_ore +--! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. +--! @param a {{prefix}}.query_timestamp_ord_ore +--! @param b public.{{prefix}}_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a eql_v3.query_timestamp_ord_ore, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; diff --git a/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_ore_operators.sql b/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_ore_operators.sql index 63a7acda9..13b0cecd9 100644 --- a/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_ore_operators.sql +++ b/packages/eql/src/v3/scalars/timestamp/query_timestamp_ord_ore_operators.sql @@ -4,76 +4,76 @@ -- REQUIRE: src/v3/scalars/timestamp/query_timestamp_ord_ore_functions.sql --! @file encrypted_domain/timestamp/query_timestamp_ord_ore_operators.sql ---! @brief Operators for eql_v3.query_timestamp_ord_ore. +--! @brief Operators for {{prefix}}.query_timestamp_ord_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = eql_v3.query_timestamp_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = eql_v3.query_timestamp_ord_ore, RIGHTARG = public.eql_v3_timestamp_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = eql_v3.query_timestamp_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = eql_v3.query_timestamp_ord_ore, RIGHTARG = public.eql_v3_timestamp_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = eql_v3.query_timestamp_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = eql_v3.query_timestamp_ord_ore, RIGHTARG = public.eql_v3_timestamp_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = eql_v3.query_timestamp_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = eql_v3.query_timestamp_ord_ore, RIGHTARG = public.eql_v3_timestamp_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = eql_v3.query_timestamp_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = eql_v3.query_timestamp_ord_ore, RIGHTARG = public.eql_v3_timestamp_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = eql_v3.query_timestamp_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = eql_v3.query_timestamp_ord_ore, RIGHTARG = public.eql_v3_timestamp_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); diff --git a/packages/eql/src/v3/scalars/timestamp/query_timestamp_range_functions.sql b/packages/eql/src/v3/scalars/timestamp/query_timestamp_range_functions.sql new file mode 100644 index 000000000..6c1a95c89 --- /dev/null +++ b/packages/eql/src/v3/scalars/timestamp/query_timestamp_range_functions.sql @@ -0,0 +1,177 @@ +-- AUTOMATICALLY GENERATED FILE. +-- ONLY EQL VERSION: 4 +-- REQUIRE: src/v3/schema.sql +-- REQUIRE: src/v3/scalars/timestamp/query_timestamp_range_types.sql +-- REQUIRE: src/v3/scalars/timestamp/timestamp_ord_ore_functions.sql +-- REQUIRE: src/v3/scalars/timestamp/timestamp_ord_functions.sql +-- REQUIRE: src/v3/scalars/timestamp/timestamp_ord_ope_functions.sql +-- REQUIRE: src/v3/sem/ore_block_256/functions.sql +-- REQUIRE: src/v3/sem/ore_block_256/operators.sql +-- REQUIRE: src/v3/sem/ope_cllw/functions.sql + +--! @file v3/scalars/timestamp/query_timestamp_range_functions.sql +--! @brief The bound accessors and `{{prefix}}.between` for timestamp's range query domains. +--! @note EQL version {{eql_version}} only, like the range domains themselves. + +--! @brief The low bound of a {{prefix}}.query_timestamp_range_ore, as a block ORE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_timestamp_range_ore Range query operand +--! @return {{prefix}}_internal.ore_block_256 The low bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.lo(r {{prefix}}.query_timestamp_range_ore) +RETURNS {{prefix}}_internal.ore_block_256 +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ore_block_256(jsonb_build_object('ob', r::jsonb -> 'lo')) $$; + +--! @brief The high bound of a {{prefix}}.query_timestamp_range_ore, as a block ORE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_timestamp_range_ore Range query operand +--! @return {{prefix}}_internal.ore_block_256 The high bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.hi(r {{prefix}}.query_timestamp_range_ore) +RETURNS {{prefix}}_internal.ore_block_256 +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ore_block_256(jsonb_build_object('ob', r::jsonb -> 'hi')) $$; + +--! @brief The low bound of a {{prefix}}.query_timestamp_range_ope, as a CLLW OPE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_timestamp_range_ope Range query operand +--! @return {{prefix}}_internal.ope_cllw The low bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.lo(r {{prefix}}.query_timestamp_range_ope) +RETURNS {{prefix}}_internal.ope_cllw +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> 'lo')) $$; + +--! @brief The high bound of a {{prefix}}.query_timestamp_range_ope, as a CLLW OPE term. +--! +--! Reads the bound with the term's own constructor, exactly as a single-bound +--! query operand's term is read, so a bound compares like that term would. +--! Internal: only `{{prefix}}.between`'s body calls it, so it is not part of +--! the public `{{prefix}}` surface. +--! +--! @param r {{prefix}}.query_timestamp_range_ope Range query operand +--! @return {{prefix}}_internal.ope_cllw The high bound's term (included in the range), or NULL for a NULL range +--! @note IMMUTABLE and STRICT. It is evaluated once per query when +--! `{{prefix}}.between` is served by an index, since its argument is the +--! query's parameter, not a column. +CREATE FUNCTION {{prefix}}_internal.hi(r {{prefix}}.query_timestamp_range_ope) +RETURNS {{prefix}}_internal.ope_cllw +LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE +AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> 'hi')) $$; + +--! @brief Whether a public.{{prefix}}_timestamp_ord_ore value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_timestamp_range_ore)`. +--! +--! @param a public.{{prefix}}_timestamp_ord_ore Encrypted column value +--! @param r {{prefix}}.query_timestamp_range_ore Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term_ore(a)`, which a btree index on that expression +--! serves as one range scan. For this ORE range that index needs the +--! default btree operator class on {{prefix}}_internal.ore_block_256, which the +--! installer creates only with superuser privileges. Without it (on Supabase, +--! for instance) the installer disables the ORE column domains and this ORE range, +--! so use an OPE column (`public.{{prefix}}_timestamp_ord`, `public.{{prefix}}_timestamp_ord_ope`) +--! and `{{prefix}}.query_timestamp_range_ope`, which index everywhere. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_timestamp_range_ore`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_timestamp_ord_ore, r {{prefix}}.query_timestamp_range_ore) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_timestamp_ord value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_timestamp_range_ope)`. +--! +--! @param a public.{{prefix}}_timestamp_ord Encrypted column value +--! @param r {{prefix}}.query_timestamp_range_ope Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term(a)`, which a btree index on that expression +--! serves as one range scan. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_timestamp_range_ope`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_timestamp_ord, r {{prefix}}.query_timestamp_range_ope) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r) $$; + +--! @brief Whether a public.{{prefix}}_timestamp_ord_ope value lies in a range, both bounds included. +--! +--! True when `{{prefix}}_internal.lo(r) <= {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r)`. +--! The range is one operand, so a statement cannot pair the low bound of one +--! query with the high bound of another (ADR-0009, decision 7): +--! `WHERE {{prefix}}.between(col, $1::{{prefix}}.query_timestamp_range_ope)`. +--! +--! @param a public.{{prefix}}_timestamp_ord_ope Encrypted column value +--! @param r {{prefix}}.query_timestamp_range_ope Range query operand: both bounds of one `BETWEEN` +--! @return boolean True when the value is in the range; NULL when either argument is NULL +--! @note Inlinable on purpose: `LANGUAGE sql`, one expression, IMMUTABLE, no +--! `SET` clause, and not STRICT. PostgreSQL inlines a STRICT SQL function +--! only when its body is strict, and `x AND y` is not, so STRICT would +--! stop inlining. Inlined, the planner sees two comparisons on +--! `{{prefix}}.ord_term(a)`, which a btree index on that expression +--! serves as one range scan. +--! @note `BETWEEN` is an SQL keyword, so call it schema-qualified: +--! `{{prefix}}.between(...)` parses, a bare `between(...)` does not. +--! @note Cast the range to its exact domain, `$1::{{prefix}}.query_timestamp_range_ope`. +--! PostgreSQL resolves a function's domain arguments as their base type, +--! `jsonb`, and every `between` overload takes jsonb domains, so an +--! uncast `$1`, a `jsonb` parameter, or a range of another term or +--! family matches several overloads and the statement fails with 42725 +--! ("function ... is not unique") before it runs. The single-bound +--! operators resolve an untyped `$1`; `between` does not. +CREATE FUNCTION {{prefix}}.between(a public.{{prefix}}_timestamp_ord_ope, r {{prefix}}.query_timestamp_range_ope) +RETURNS boolean +LANGUAGE sql IMMUTABLE PARALLEL SAFE +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) <= {{prefix}}_internal.hi(r) $$; diff --git a/packages/eql/src/v3/scalars/timestamp/query_timestamp_range_types.sql b/packages/eql/src/v3/scalars/timestamp/query_timestamp_range_types.sql new file mode 100644 index 000000000..795b8f267 --- /dev/null +++ b/packages/eql/src/v3/scalars/timestamp/query_timestamp_range_types.sql @@ -0,0 +1,107 @@ +-- AUTOMATICALLY GENERATED FILE. +-- ONLY EQL VERSION: 4 +-- REQUIRE: src/v3/schema.sql +-- REQUIRE: src/v3/scalars/ore_fallback.sql + +--! @file v3/scalars/timestamp/query_timestamp_range_types.sql +--! @brief Range query-operand domains for timestamp: the operand of `{{prefix}}.between`. +--! @note A range holds both bounds of one `BETWEEN` as one value: +--! `{"v": {{eql_version}}, "i": {...}, "lo": , "hi": }`. Each bound is the +--! single-bound query domain's `ob` (ORE) or `op` (OPE) value, in a +--! `{v, i, lo, hi}` envelope. Both bounds are included. There is one +--! range domain per ordering term the family stores (ADR-0009, +--! decisions 7 and 8). +--! @note Cast the range parameter to its exact range domain +--! (`$1::{{prefix}}.query_timestamp_range_ore`). An uncast `$1`, a `jsonb` +--! parameter, or a range of another term or family fails with 42725 +--! ("function ... is not unique"); see `{{prefix}}.between`. +--! @note EQL version {{eql_version}} only: the `-- ONLY EQL VERSION:` line above keeps this +--! file out of every other version's installer. +--! @note Like every query operand, a range lives in `{{prefix}}`, not `public`, +--! and holds no ciphertext `c`. A range whose low bound is above its +--! high bound matches no row, as with SQL `BETWEEN`; the SQL does not +--! reorder the bounds. +--! @note On an install without the ORE operator class (a non-superuser +--! install, on Supabase for instance), the ORE range domain is disabled +--! as the single-bound ORE domains are: a value cast to it raises +--! `feature_not_supported`, naming the OPE range. See +--! `v3/scalars/ore_fallback.sql`. + +DO $$ +BEGIN + --! @brief Range query-operand domain {{prefix}}.query_timestamp_range_ore (two block ORE bounds; no `c`). + IF NOT EXISTS ( + SELECT 1 FROM pg_type + WHERE typname = 'query_timestamp_range_ore' AND typnamespace = '{{prefix}}'::regnamespace + ) THEN + CREATE DOMAIN {{prefix}}.query_timestamp_range_ore AS jsonb + CHECK ( + jsonb_typeof(VALUE) = 'object' + AND VALUE ? 'v' + AND VALUE ? 'i' + AND VALUE ? 'lo' + AND VALUE ? 'hi' + AND NOT (VALUE ? 'c') + AND jsonb_typeof(VALUE -> 'lo') = 'array' + AND jsonb_array_length(VALUE -> 'lo') > 0 + AND jsonb_typeof(VALUE -> 'hi') = 'array' + AND jsonb_array_length(VALUE -> 'hi') > 0 + -- `"v": null` makes the comparison NULL, and a CHECK that is NULL + -- passes, so COALESCE refuses it. A NULL range still passes (no row + -- matches it). The comparison keeps the one form the v4 isolation + -- gate accepts. + AND COALESCE(VALUE->>'v' = '{{eql_version}}', VALUE IS NULL) + ); + END IF; + + COMMENT ON DOMAIN {{prefix}}.query_timestamp_range_ore IS 'EQL timestamp range query operand (block ORE)'; + + --! @brief Range query-operand domain {{prefix}}.query_timestamp_range_ope (two CLLW OPE bounds; no `c`). + IF NOT EXISTS ( + SELECT 1 FROM pg_type + WHERE typname = 'query_timestamp_range_ope' AND typnamespace = '{{prefix}}'::regnamespace + ) THEN + CREATE DOMAIN {{prefix}}.query_timestamp_range_ope AS jsonb + CHECK ( + jsonb_typeof(VALUE) = 'object' + AND VALUE ? 'v' + AND VALUE ? 'i' + AND VALUE ? 'lo' + AND VALUE ? 'hi' + AND NOT (VALUE ? 'c') + AND jsonb_typeof(VALUE -> 'lo') = 'string' + AND jsonb_typeof(VALUE -> 'hi') = 'string' + -- `"v": null` makes the comparison NULL, and a CHECK that is NULL + -- passes, so COALESCE refuses it. A NULL range still passes (no row + -- matches it). The comparison keeps the one form the v4 isolation + -- gate accepts. + AND COALESCE(VALUE->>'v' = '{{eql_version}}', VALUE IS NULL) + ); + END IF; + + COMMENT ON DOMAIN {{prefix}}.query_timestamp_range_ope IS 'EQL timestamp range query operand (CLLW OPE)'; +END +$$; + +-- Without the default btree operator class on {{prefix}}_internal.ore_block_256 +-- (the installer skips it on insufficient_privilege), ore_fallback.sql has +-- created {{prefix}}_internal.ore_domain_unavailable and poisoned the +-- single-bound ORE domains. It cannot reach this ORE range, which exists in +-- EQL v4 only, so the same NOT VALID poison CHECK is added here. +DO $do$ +BEGIN + IF EXISTS ( + SELECT 1 + FROM pg_catalog.pg_opclass c + JOIN pg_catalog.pg_am am ON am.oid = c.opcmethod + WHERE am.amname = 'btree' + AND c.opcdefault + AND c.opcintype = '{{prefix}}_internal.ore_block_256'::pg_catalog.regtype + ) THEN + RETURN; + END IF; + + ALTER DOMAIN {{prefix}}.query_timestamp_range_ore ADD CONSTRAINT eql_ore_unavailable + CHECK ({{prefix}}_internal.ore_domain_unavailable(VALUE, '{{prefix}}.query_timestamp_range_ore', '{{prefix}}.query_timestamp_range_ope (range)')) NOT VALID; +END; +$do$; diff --git a/packages/eql/src/v3/scalars/timestamp/query_timestamp_types.sql b/packages/eql/src/v3/scalars/timestamp/query_timestamp_types.sql index 741e38141..4a9978ee0 100644 --- a/packages/eql/src/v3/scalars/timestamp/query_timestamp_types.sql +++ b/packages/eql/src/v3/scalars/timestamp/query_timestamp_types.sql @@ -3,41 +3,41 @@ --! @file v3/scalars/timestamp/query_timestamp_types.sql --! @brief Query-operand domains for timestamp (index-terms-only, no ciphertext). ---! @note Query-operand domains live in `eql_v3` (not `public`): they are +--! @note Query-operand domains live in `{{prefix}}` (not `public`): they are --! never valid column types, so they don't belong in the column-type --! namespace, and dropping the EQL-owned schema can never drop an --! application column. --! @note Cast a query operand explicitly to its `query_` domain in a predicate ---! (e.g. `WHERE col = $1::eql_v3.query_timestamp_eq`). A bare, +--! (e.g. `WHERE col = $1::{{prefix}}.query_timestamp_eq`). A bare, --! uncast literal RHS is ambiguous between the `query_` and `jsonb` --! operator overloads and will not resolve. DO $$ BEGIN - --! @brief Query-operand domain eql_v3.query_timestamp_eq (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_timestamp_eq (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_timestamp_eq' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_timestamp_eq' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_timestamp_eq AS jsonb + CREATE DOMAIN {{prefix}}.query_timestamp_eq AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'hm' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_timestamp_eq IS 'EQL timestamp query operand (equality)'; + COMMENT ON DOMAIN {{prefix}}.query_timestamp_eq IS 'EQL timestamp query operand (equality)'; - --! @brief Query-operand domain eql_v3.query_timestamp_ord_ore (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_timestamp_ord_ore (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_timestamp_ord_ore' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_timestamp_ord_ore' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_timestamp_ord_ore AS jsonb + CREATE DOMAIN {{prefix}}.query_timestamp_ord_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -46,46 +46,46 @@ BEGIN AND NOT (VALUE ? 'c') AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_timestamp_ord_ore IS 'EQL timestamp query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_timestamp_ord_ore IS 'EQL timestamp query operand (equality, ordering)'; - --! @brief Query-operand domain eql_v3.query_timestamp_ord (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_timestamp_ord (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_timestamp_ord' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_timestamp_ord' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_timestamp_ord AS jsonb + CREATE DOMAIN {{prefix}}.query_timestamp_ord AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'op' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_timestamp_ord IS 'EQL timestamp query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_timestamp_ord IS 'EQL timestamp query operand (equality, ordering)'; - --! @brief Query-operand domain eql_v3.query_timestamp_ord_ope (term-only; no `c`). + --! @brief Query-operand domain {{prefix}}.query_timestamp_ord_ope (term-only; no `c`). IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'query_timestamp_ord_ope' AND typnamespace = 'eql_v3'::regnamespace + WHERE typname = 'query_timestamp_ord_ope' AND typnamespace = '{{prefix}}'::regnamespace ) THEN - CREATE DOMAIN eql_v3.query_timestamp_ord_ope AS jsonb + CREATE DOMAIN {{prefix}}.query_timestamp_ord_ope AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'op' AND NOT (VALUE ? 'c') - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN eql_v3.query_timestamp_ord_ope IS 'EQL timestamp query operand (equality, ordering)'; + COMMENT ON DOMAIN {{prefix}}.query_timestamp_ord_ope IS 'EQL timestamp query operand (equality, ordering)'; END $$; diff --git a/packages/eql/src/v3/scalars/timestamp/timestamp_eq_functions.sql b/packages/eql/src/v3/scalars/timestamp/timestamp_eq_functions.sql index c5551cfc4..9ffb046cd 100644 --- a/packages/eql/src/v3/scalars/timestamp/timestamp_eq_functions.sql +++ b/packages/eql/src/v3/scalars/timestamp/timestamp_eq_functions.sql @@ -5,634 +5,634 @@ -- REQUIRE: src/v3/sem/hmac_256/functions.sql --! @file encrypted_domain/timestamp/timestamp_eq_functions.sql ---! @brief Functions for public.eql_v3_timestamp_eq. +--! @brief Functions for public.{{prefix}}_timestamp_eq. ---! @brief Index extractor for public.eql_v3_timestamp_eq. ---! @param a public.eql_v3_timestamp_eq ---! @return eql_v3_internal.hmac_256 -CREATE FUNCTION eql_v3.eq_term(a public.eql_v3_timestamp_eq) -RETURNS eql_v3_internal.hmac_256 +--! @brief Index extractor for public.{{prefix}}_timestamp_eq. +--! @param a public.{{prefix}}_timestamp_eq +--! @return {{prefix}}_internal.hmac_256 +CREATE FUNCTION {{prefix}}.eq_term(a public.{{prefix}}_timestamp_eq) +RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.hmac_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_eq. ---! @param a public.eql_v3_timestamp_eq ---! @param b public.eql_v3_timestamp_eq +--! @brief Operator wrapper for public.{{prefix}}_timestamp_eq. +--! @param a public.{{prefix}}_timestamp_eq +--! @param b public.{{prefix}}_timestamp_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_timestamp_eq, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_eq, b public.{{prefix}}_timestamp_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_eq. ---! @param a public.eql_v3_timestamp_eq +--! @brief Operator wrapper for public.{{prefix}}_timestamp_eq. +--! @param a public.{{prefix}}_timestamp_eq --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_timestamp_eq, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) = eql_v3.eq_term(b::public.eql_v3_timestamp_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_timestamp_eq) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_eq. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_eq. --! @param a jsonb ---! @param b public.eql_v3_timestamp_eq +--! @param b public.{{prefix}}_timestamp_eq --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_timestamp_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_timestamp_eq) = eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_timestamp_eq) = {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_eq. ---! @param a public.eql_v3_timestamp_eq ---! @param b public.eql_v3_timestamp_eq +--! @brief Operator wrapper for public.{{prefix}}_timestamp_eq. +--! @param a public.{{prefix}}_timestamp_eq +--! @param b public.{{prefix}}_timestamp_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_timestamp_eq, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_eq, b public.{{prefix}}_timestamp_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_eq. ---! @param a public.eql_v3_timestamp_eq +--! @brief Operator wrapper for public.{{prefix}}_timestamp_eq. +--! @param a public.{{prefix}}_timestamp_eq --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_timestamp_eq, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a) <> eql_v3.eq_term(b::public.eql_v3_timestamp_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_timestamp_eq) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_eq. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_eq. --! @param a jsonb ---! @param b public.eql_v3_timestamp_eq +--! @param b public.{{prefix}}_timestamp_eq --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_timestamp_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.eq_term(a::public.eql_v3_timestamp_eq) <> eql_v3.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_timestamp_eq) <> {{prefix}}.eq_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator ---! @param b public.eql_v3_timestamp_eq right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_timestamp_eq, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_timestamp_eq, b public.{{prefix}}_timestamp_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_timestamp_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_timestamp_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_eq right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_timestamp_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator ---! @param b public.eql_v3_timestamp_eq right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_timestamp_eq, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_timestamp_eq, b public.{{prefix}}_timestamp_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_timestamp_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_timestamp_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_eq right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_timestamp_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator ---! @param b public.eql_v3_timestamp_eq right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_timestamp_eq, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_timestamp_eq, b public.{{prefix}}_timestamp_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_timestamp_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_timestamp_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_eq right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_timestamp_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator ---! @param b public.eql_v3_timestamp_eq right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_timestamp_eq, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_timestamp_eq, b public.{{prefix}}_timestamp_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_timestamp_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_timestamp_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_eq right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_timestamp_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator ---! @param b public.eql_v3_timestamp_eq right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_timestamp_eq, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_timestamp_eq, b public.{{prefix}}_timestamp_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_timestamp_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_timestamp_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_eq right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_timestamp_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator ---! @param b public.eql_v3_timestamp_eq right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_timestamp_eq, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_timestamp_eq, b public.{{prefix}}_timestamp_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_timestamp_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_timestamp_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_eq right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_timestamp_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_timestamp_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_timestamp_eq, selector text) -RETURNS public.eql_v3_timestamp_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_timestamp_eq'; END; $$ +--! @return public.{{prefix}}_timestamp_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_timestamp_eq, selector text) +RETURNS public.{{prefix}}_timestamp_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_timestamp_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_timestamp_eq, selector integer) -RETURNS public.eql_v3_timestamp_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_timestamp_eq'; END; $$ +--! @return public.{{prefix}}_timestamp_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_timestamp_eq, selector integer) +RETURNS public.{{prefix}}_timestamp_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_timestamp_eq right operand of the blocked operator ---! @return public.eql_v3_timestamp_eq never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_timestamp_eq) -RETURNS public.eql_v3_timestamp_eq IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_timestamp_eq'; END; $$ +--! @param selector public.{{prefix}}_timestamp_eq right operand of the blocked operator +--! @return public.{{prefix}}_timestamp_eq never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_timestamp_eq) +RETURNS public.{{prefix}}_timestamp_eq IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_timestamp_eq, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_timestamp_eq, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_timestamp_eq, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_timestamp_eq, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_timestamp_eq right operand of the blocked operator +--! @param selector public.{{prefix}}_timestamp_eq right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_timestamp_eq) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_timestamp_eq, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_timestamp_eq, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_timestamp_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_timestamp_eq, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_timestamp_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_timestamp_eq, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_timestamp_eq, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_timestamp_eq, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator ---! @param b public.eql_v3_timestamp_eq right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_timestamp_eq, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_timestamp_eq, b public.{{prefix}}_timestamp_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_timestamp_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_timestamp_eq, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_eq right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_eq right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_timestamp_eq) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_timestamp_eq, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_timestamp_eq, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_timestamp_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_timestamp_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_timestamp_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_timestamp_eq, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_timestamp_eq, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_timestamp_eq, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_timestamp_eq, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_timestamp_eq, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_timestamp_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_timestamp_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_timestamp_eq, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_timestamp_eq, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator ---! @param b public.eql_v3_timestamp_eq right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_eq right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_timestamp_eq, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_timestamp_eq, b public.{{prefix}}_timestamp_eq) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_eq left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_eq left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_timestamp_eq, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_timestamp_eq, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_eq. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_eq and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_eq and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_eq right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_eq right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_timestamp_eq) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_timestamp_eq) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_timestamp_eq'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_timestamp_eq'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/timestamp/timestamp_eq_operators.sql b/packages/eql/src/v3/scalars/timestamp/timestamp_eq_operators.sql index f9c344077..def560a45 100644 --- a/packages/eql/src/v3/scalars/timestamp/timestamp_eq_operators.sql +++ b/packages/eql/src/v3/scalars/timestamp/timestamp_eq_operators.sql @@ -4,245 +4,245 @@ -- REQUIRE: src/v3/scalars/timestamp/timestamp_eq_functions.sql --! @file encrypted_domain/timestamp/timestamp_eq_operators.sql ---! @brief Operators for public.eql_v3_timestamp_eq. +--! @brief Operators for public.{{prefix}}_timestamp_eq. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = public.eql_v3_timestamp_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = public.{{prefix}}_timestamp_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_eq, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = public.eql_v3_timestamp_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = public.{{prefix}}_timestamp_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_eq, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = public.eql_v3_timestamp_eq + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = public.{{prefix}}_timestamp_eq ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_eq + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_eq ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = public.eql_v3_timestamp_eq + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = public.{{prefix}}_timestamp_eq ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_eq + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_eq ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = public.eql_v3_timestamp_eq + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = public.{{prefix}}_timestamp_eq ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_eq + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_eq ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = public.eql_v3_timestamp_eq + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = public.{{prefix}}_timestamp_eq ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_eq + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_eq ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = public.eql_v3_timestamp_eq + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = public.{{prefix}}_timestamp_eq ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_eq + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_eq ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = public.eql_v3_timestamp_eq + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = public.{{prefix}}_timestamp_eq ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_eq + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_eq ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_eq + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_eq ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_eq + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_eq ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = public.eql_v3_timestamp_eq + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = public.{{prefix}}_timestamp_eq ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_eq + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_eq ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = public.eql_v3_timestamp_eq + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = public.{{prefix}}_timestamp_eq ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_timestamp_eq, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_eq + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_eq ); diff --git a/packages/eql/src/v3/scalars/timestamp/timestamp_functions.sql b/packages/eql/src/v3/scalars/timestamp/timestamp_functions.sql index 032d60210..81be42ad0 100644 --- a/packages/eql/src/v3/scalars/timestamp/timestamp_functions.sql +++ b/packages/eql/src/v3/scalars/timestamp/timestamp_functions.sql @@ -4,662 +4,662 @@ -- REQUIRE: src/v3/scalars/functions.sql --! @file encrypted_domain/timestamp/timestamp_functions.sql ---! @brief Functions for public.eql_v3_timestamp. +--! @brief Functions for public.{{prefix}}_timestamp. ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_timestamp, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_timestamp, b public.{{prefix}}_timestamp) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a public.eql_v3_timestamp, b jsonb) +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_timestamp, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.eq(a jsonb, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal.eq(a jsonb, b public.{{prefix}}_timestamp) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '=', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_timestamp, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_timestamp, b public.{{prefix}}_timestamp) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a public.eql_v3_timestamp, b jsonb) +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_timestamp, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.neq(a jsonb, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal.neq(a jsonb, b public.{{prefix}}_timestamp) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<>', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_timestamp, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_timestamp, b public.{{prefix}}_timestamp) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a public.eql_v3_timestamp, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_timestamp, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lt(a jsonb, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal.lt(a jsonb, b public.{{prefix}}_timestamp) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_timestamp, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_timestamp, b public.{{prefix}}_timestamp) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a public.eql_v3_timestamp, b jsonb) +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_timestamp, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.lte(a jsonb, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal.lte(a jsonb, b public.{{prefix}}_timestamp) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<=', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_timestamp, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_timestamp, b public.{{prefix}}_timestamp) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a public.eql_v3_timestamp, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_timestamp, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gt(a jsonb, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal.gt(a jsonb, b public.{{prefix}}_timestamp) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_timestamp, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_timestamp, b public.{{prefix}}_timestamp) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a public.eql_v3_timestamp, b jsonb) +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_timestamp, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.gte(a jsonb, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal.gte(a jsonb, b public.{{prefix}}_timestamp) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '>=', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_timestamp, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_timestamp, b public.{{prefix}}_timestamp) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_timestamp, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_timestamp, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_timestamp) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_timestamp, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_timestamp, b public.{{prefix}}_timestamp) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_timestamp, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_timestamp, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_timestamp) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_timestamp never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_timestamp, selector text) -RETURNS public.eql_v3_timestamp IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_timestamp'; END; $$ +--! @return public.{{prefix}}_timestamp never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_timestamp, selector text) +RETURNS public.{{prefix}}_timestamp IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_timestamp never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_timestamp, selector integer) -RETURNS public.eql_v3_timestamp IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_timestamp'; END; $$ +--! @return public.{{prefix}}_timestamp never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_timestamp, selector integer) +RETURNS public.{{prefix}}_timestamp IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_timestamp right operand of the blocked operator ---! @return public.eql_v3_timestamp never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_timestamp) -RETURNS public.eql_v3_timestamp IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_timestamp'; END; $$ +--! @param selector public.{{prefix}}_timestamp right operand of the blocked operator +--! @return public.{{prefix}}_timestamp never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_timestamp) +RETURNS public.{{prefix}}_timestamp IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_timestamp, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_timestamp, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_timestamp, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_timestamp, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_timestamp right operand of the blocked operator +--! @param selector public.{{prefix}}_timestamp right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_timestamp) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_timestamp, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_timestamp, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_timestamp, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_timestamp, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_timestamp, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_timestamp, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_timestamp, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_timestamp, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_timestamp, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_timestamp, b public.{{prefix}}_timestamp) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_timestamp, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_timestamp, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_timestamp) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_timestamp, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_timestamp, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_timestamp, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_timestamp, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_timestamp, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_timestamp, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_timestamp, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_timestamp, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_timestamp, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_timestamp, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_timestamp, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_timestamp, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_timestamp, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_timestamp, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_timestamp, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_timestamp, b public.{{prefix}}_timestamp) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_timestamp, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_timestamp, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_timestamp) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_timestamp) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_timestamp'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_timestamp'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/timestamp/timestamp_operators.sql b/packages/eql/src/v3/scalars/timestamp/timestamp_operators.sql index c634ecaa9..5d2be2118 100644 --- a/packages/eql/src/v3/scalars/timestamp/timestamp_operators.sql +++ b/packages/eql/src/v3/scalars/timestamp/timestamp_operators.sql @@ -4,239 +4,239 @@ -- REQUIRE: src/v3/scalars/timestamp/timestamp_functions.sql --! @file encrypted_domain/timestamp/timestamp_operators.sql ---! @brief Operators for public.eql_v3_timestamp. +--! @brief Operators for public.{{prefix}}_timestamp. CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_timestamp, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = public.eql_v3_timestamp, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = jsonb ); CREATE OPERATOR = ( - FUNCTION = eql_v3_internal.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_timestamp, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = public.eql_v3_timestamp, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = jsonb ); CREATE OPERATOR <> ( - FUNCTION = eql_v3_internal.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_timestamp, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = public.eql_v3_timestamp, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = jsonb ); CREATE OPERATOR < ( - FUNCTION = eql_v3_internal.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_timestamp, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = public.eql_v3_timestamp, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = jsonb ); CREATE OPERATOR <= ( - FUNCTION = eql_v3_internal.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_timestamp, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = public.eql_v3_timestamp, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = jsonb ); CREATE OPERATOR > ( - FUNCTION = eql_v3_internal.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_timestamp, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = public.eql_v3_timestamp, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = jsonb ); CREATE OPERATOR >= ( - FUNCTION = eql_v3_internal.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_timestamp, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_timestamp, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_timestamp, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_timestamp, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_timestamp, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_timestamp, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_timestamp, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_timestamp, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_timestamp, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_timestamp, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_timestamp, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_timestamp, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_timestamp, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_timestamp, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_timestamp, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_timestamp, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_timestamp, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_timestamp, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_timestamp, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_timestamp, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_timestamp, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_timestamp, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = public.{{prefix}}_timestamp ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_timestamp, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_timestamp, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp ); diff --git a/packages/eql/src/v3/scalars/timestamp/timestamp_ord_aggregates.sql b/packages/eql/src/v3/scalars/timestamp/timestamp_ord_aggregates.sql index 4c35aabf1..18676a280 100644 --- a/packages/eql/src/v3/scalars/timestamp/timestamp_ord_aggregates.sql +++ b/packages/eql/src/v3/scalars/timestamp/timestamp_ord_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/timestamp/timestamp_ord_operators.sql --! @file encrypted_domain/timestamp/timestamp_ord_aggregates.sql ---! @brief Aggregates for public.eql_v3_timestamp_ord. +--! @brief Aggregates for public.{{prefix}}_timestamp_ord. ---! @brief State function for min on public.eql_v3_timestamp_ord. ---! @param state public.eql_v3_timestamp_ord ---! @param value public.eql_v3_timestamp_ord ---! @return public.eql_v3_timestamp_ord -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_timestamp_ord, value public.eql_v3_timestamp_ord) -RETURNS public.eql_v3_timestamp_ord +--! @brief State function for min on public.{{prefix}}_timestamp_ord. +--! @param state public.{{prefix}}_timestamp_ord +--! @param value public.{{prefix}}_timestamp_ord +--! @return public.{{prefix}}_timestamp_ord +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_timestamp_ord, value public.{{prefix}}_timestamp_ord) +RETURNS public.{{prefix}}_timestamp_ord LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_timestamp_ord. ---! @param input public.eql_v3_timestamp_ord ---! @return public.eql_v3_timestamp_ord -CREATE AGGREGATE eql_v3.min(public.eql_v3_timestamp_ord) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_timestamp_ord, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_timestamp_ord. +--! @param input public.{{prefix}}_timestamp_ord +--! @return public.{{prefix}}_timestamp_ord +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_timestamp_ord) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_timestamp_ord, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_timestamp_ord. ---! @param state public.eql_v3_timestamp_ord ---! @param value public.eql_v3_timestamp_ord ---! @return public.eql_v3_timestamp_ord -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_timestamp_ord, value public.eql_v3_timestamp_ord) -RETURNS public.eql_v3_timestamp_ord +--! @brief State function for max on public.{{prefix}}_timestamp_ord. +--! @param state public.{{prefix}}_timestamp_ord +--! @param value public.{{prefix}}_timestamp_ord +--! @return public.{{prefix}}_timestamp_ord +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_timestamp_ord, value public.{{prefix}}_timestamp_ord) +RETURNS public.{{prefix}}_timestamp_ord LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_timestamp_ord. ---! @param input public.eql_v3_timestamp_ord ---! @return public.eql_v3_timestamp_ord -CREATE AGGREGATE eql_v3.max(public.eql_v3_timestamp_ord) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_timestamp_ord, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_timestamp_ord. +--! @param input public.{{prefix}}_timestamp_ord +--! @return public.{{prefix}}_timestamp_ord +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_timestamp_ord) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_timestamp_ord, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/timestamp/timestamp_ord_functions.sql b/packages/eql/src/v3/scalars/timestamp/timestamp_ord_functions.sql index 0835181df..d912cf0b9 100644 --- a/packages/eql/src/v3/scalars/timestamp/timestamp_ord_functions.sql +++ b/packages/eql/src/v3/scalars/timestamp/timestamp_ord_functions.sql @@ -5,562 +5,562 @@ -- REQUIRE: src/v3/sem/ope_cllw/functions.sql --! @file encrypted_domain/timestamp/timestamp_ord_functions.sql ---! @brief Functions for public.eql_v3_timestamp_ord. +--! @brief Functions for public.{{prefix}}_timestamp_ord. ---! @brief Index extractor for public.eql_v3_timestamp_ord. ---! @param a public.eql_v3_timestamp_ord ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a public.eql_v3_timestamp_ord) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for public.{{prefix}}_timestamp_ord. +--! @param a public.{{prefix}}_timestamp_ord +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a public.{{prefix}}_timestamp_ord) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord. ---! @param a public.eql_v3_timestamp_ord ---! @param b public.eql_v3_timestamp_ord +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. +--! @param a public.{{prefix}}_timestamp_ord +--! @param b public.{{prefix}}_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_timestamp_ord, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord. ---! @param a public.eql_v3_timestamp_ord +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. +--! @param a public.{{prefix}}_timestamp_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_timestamp_ord, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b::public.eql_v3_timestamp_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a jsonb ---! @param b public.eql_v3_timestamp_ord +--! @param b public.{{prefix}}_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_timestamp_ord) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord. ---! @param a public.eql_v3_timestamp_ord ---! @param b public.eql_v3_timestamp_ord +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. +--! @param a public.{{prefix}}_timestamp_ord +--! @param b public.{{prefix}}_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_timestamp_ord, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord. ---! @param a public.eql_v3_timestamp_ord +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. +--! @param a public.{{prefix}}_timestamp_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_timestamp_ord, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b::public.eql_v3_timestamp_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a jsonb ---! @param b public.eql_v3_timestamp_ord +--! @param b public.{{prefix}}_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_timestamp_ord) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord. ---! @param a public.eql_v3_timestamp_ord ---! @param b public.eql_v3_timestamp_ord +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. +--! @param a public.{{prefix}}_timestamp_ord +--! @param b public.{{prefix}}_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_timestamp_ord, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord. ---! @param a public.eql_v3_timestamp_ord +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. +--! @param a public.{{prefix}}_timestamp_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_timestamp_ord, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_timestamp_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b::public.eql_v3_timestamp_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a jsonb ---! @param b public.eql_v3_timestamp_ord +--! @param b public.{{prefix}}_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_timestamp_ord) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord. ---! @param a public.eql_v3_timestamp_ord ---! @param b public.eql_v3_timestamp_ord +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. +--! @param a public.{{prefix}}_timestamp_ord +--! @param b public.{{prefix}}_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_timestamp_ord, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord. ---! @param a public.eql_v3_timestamp_ord +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. +--! @param a public.{{prefix}}_timestamp_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_timestamp_ord, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_timestamp_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b::public.eql_v3_timestamp_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a jsonb ---! @param b public.eql_v3_timestamp_ord +--! @param b public.{{prefix}}_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_timestamp_ord) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord. ---! @param a public.eql_v3_timestamp_ord ---! @param b public.eql_v3_timestamp_ord +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. +--! @param a public.{{prefix}}_timestamp_ord +--! @param b public.{{prefix}}_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_timestamp_ord, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord. ---! @param a public.eql_v3_timestamp_ord +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. +--! @param a public.{{prefix}}_timestamp_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_timestamp_ord, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_timestamp_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b::public.eql_v3_timestamp_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a jsonb ---! @param b public.eql_v3_timestamp_ord +--! @param b public.{{prefix}}_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_timestamp_ord) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord. ---! @param a public.eql_v3_timestamp_ord ---! @param b public.eql_v3_timestamp_ord +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. +--! @param a public.{{prefix}}_timestamp_ord +--! @param b public.{{prefix}}_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_timestamp_ord, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord. ---! @param a public.eql_v3_timestamp_ord +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. +--! @param a public.{{prefix}}_timestamp_ord --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_timestamp_ord, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_timestamp_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b::public.eql_v3_timestamp_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a jsonb ---! @param b public.eql_v3_timestamp_ord +--! @param b public.{{prefix}}_timestamp_ord --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_timestamp_ord) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_timestamp_ord, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_timestamp_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_timestamp_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_timestamp_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_timestamp_ord, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_timestamp_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_timestamp_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_timestamp_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_timestamp_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_timestamp_ord, selector text) -RETURNS public.eql_v3_timestamp_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_timestamp_ord'; END; $$ +--! @return public.{{prefix}}_timestamp_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_timestamp_ord, selector text) +RETURNS public.{{prefix}}_timestamp_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_timestamp_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_timestamp_ord, selector integer) -RETURNS public.eql_v3_timestamp_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_timestamp_ord'; END; $$ +--! @return public.{{prefix}}_timestamp_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_timestamp_ord, selector integer) +RETURNS public.{{prefix}}_timestamp_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_timestamp_ord right operand of the blocked operator ---! @return public.eql_v3_timestamp_ord never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_timestamp_ord) -RETURNS public.eql_v3_timestamp_ord IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_timestamp_ord'; END; $$ +--! @param selector public.{{prefix}}_timestamp_ord right operand of the blocked operator +--! @return public.{{prefix}}_timestamp_ord never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_timestamp_ord) +RETURNS public.{{prefix}}_timestamp_ord IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_timestamp_ord, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_timestamp_ord, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_timestamp_ord, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_timestamp_ord, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_timestamp_ord right operand of the blocked operator +--! @param selector public.{{prefix}}_timestamp_ord right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_timestamp_ord) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_timestamp_ord, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_timestamp_ord, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_timestamp_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_timestamp_ord, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_timestamp_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_timestamp_ord, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_timestamp_ord, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_timestamp_ord, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_timestamp_ord, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_timestamp_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_timestamp_ord, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_timestamp_ord) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_timestamp_ord, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_timestamp_ord, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_timestamp_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_timestamp_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_timestamp_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_timestamp_ord, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_timestamp_ord, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_timestamp_ord, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_timestamp_ord, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_timestamp_ord, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_timestamp_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_timestamp_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_timestamp_ord, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_timestamp_ord, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_timestamp_ord, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_timestamp_ord, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_timestamp_ord, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_timestamp_ord) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_timestamp_ord) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_timestamp_ord'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_timestamp_ord'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ope_aggregates.sql b/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ope_aggregates.sql index 3f2e47eba..216e101af 100644 --- a/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ope_aggregates.sql +++ b/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ope_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/timestamp/timestamp_ord_ope_operators.sql --! @file encrypted_domain/timestamp/timestamp_ord_ope_aggregates.sql ---! @brief Aggregates for public.eql_v3_timestamp_ord_ope. +--! @brief Aggregates for public.{{prefix}}_timestamp_ord_ope. ---! @brief State function for min on public.eql_v3_timestamp_ord_ope. ---! @param state public.eql_v3_timestamp_ord_ope ---! @param value public.eql_v3_timestamp_ord_ope ---! @return public.eql_v3_timestamp_ord_ope -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_timestamp_ord_ope, value public.eql_v3_timestamp_ord_ope) -RETURNS public.eql_v3_timestamp_ord_ope +--! @brief State function for min on public.{{prefix}}_timestamp_ord_ope. +--! @param state public.{{prefix}}_timestamp_ord_ope +--! @param value public.{{prefix}}_timestamp_ord_ope +--! @return public.{{prefix}}_timestamp_ord_ope +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_timestamp_ord_ope, value public.{{prefix}}_timestamp_ord_ope) +RETURNS public.{{prefix}}_timestamp_ord_ope LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_timestamp_ord_ope. ---! @param input public.eql_v3_timestamp_ord_ope ---! @return public.eql_v3_timestamp_ord_ope -CREATE AGGREGATE eql_v3.min(public.eql_v3_timestamp_ord_ope) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_timestamp_ord_ope, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_timestamp_ord_ope. +--! @param input public.{{prefix}}_timestamp_ord_ope +--! @return public.{{prefix}}_timestamp_ord_ope +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_timestamp_ord_ope) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_timestamp_ord_ope, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_timestamp_ord_ope. ---! @param state public.eql_v3_timestamp_ord_ope ---! @param value public.eql_v3_timestamp_ord_ope ---! @return public.eql_v3_timestamp_ord_ope -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_timestamp_ord_ope, value public.eql_v3_timestamp_ord_ope) -RETURNS public.eql_v3_timestamp_ord_ope +--! @brief State function for max on public.{{prefix}}_timestamp_ord_ope. +--! @param state public.{{prefix}}_timestamp_ord_ope +--! @param value public.{{prefix}}_timestamp_ord_ope +--! @return public.{{prefix}}_timestamp_ord_ope +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_timestamp_ord_ope, value public.{{prefix}}_timestamp_ord_ope) +RETURNS public.{{prefix}}_timestamp_ord_ope LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_timestamp_ord_ope. ---! @param input public.eql_v3_timestamp_ord_ope ---! @return public.eql_v3_timestamp_ord_ope -CREATE AGGREGATE eql_v3.max(public.eql_v3_timestamp_ord_ope) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_timestamp_ord_ope, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_timestamp_ord_ope. +--! @param input public.{{prefix}}_timestamp_ord_ope +--! @return public.{{prefix}}_timestamp_ord_ope +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_timestamp_ord_ope) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_timestamp_ord_ope, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ope_functions.sql b/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ope_functions.sql index fa9a58797..d62552482 100644 --- a/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ope_functions.sql +++ b/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ope_functions.sql @@ -5,562 +5,562 @@ -- REQUIRE: src/v3/sem/ope_cllw/functions.sql --! @file encrypted_domain/timestamp/timestamp_ord_ope_functions.sql ---! @brief Functions for public.eql_v3_timestamp_ord_ope. +--! @brief Functions for public.{{prefix}}_timestamp_ord_ope. ---! @brief Index extractor for public.eql_v3_timestamp_ord_ope. ---! @param a public.eql_v3_timestamp_ord_ope ---! @return eql_v3_internal.ope_cllw -CREATE FUNCTION eql_v3.ord_term(a public.eql_v3_timestamp_ord_ope) -RETURNS eql_v3_internal.ope_cllw +--! @brief Index extractor for public.{{prefix}}_timestamp_ord_ope. +--! @param a public.{{prefix}}_timestamp_ord_ope +--! @return {{prefix}}_internal.ope_cllw +CREATE FUNCTION {{prefix}}.ord_term(a public.{{prefix}}_timestamp_ord_ope) +RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ope_cllw(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ope. ---! @param a public.eql_v3_timestamp_ord_ope ---! @param b public.eql_v3_timestamp_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. +--! @param a public.{{prefix}}_timestamp_ord_ope +--! @param b public.{{prefix}}_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_timestamp_ord_ope, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ope. ---! @param a public.eql_v3_timestamp_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. +--! @param a public.{{prefix}}_timestamp_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_timestamp_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b::public.eql_v3_timestamp_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_timestamp_ord_ope +--! @param b public.{{prefix}}_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_timestamp_ord_ope) = eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) = {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ope. ---! @param a public.eql_v3_timestamp_ord_ope ---! @param b public.eql_v3_timestamp_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. +--! @param a public.{{prefix}}_timestamp_ord_ope +--! @param b public.{{prefix}}_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_timestamp_ord_ope, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ope. ---! @param a public.eql_v3_timestamp_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. +--! @param a public.{{prefix}}_timestamp_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_timestamp_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <> eql_v3.ord_term(b::public.eql_v3_timestamp_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_timestamp_ord_ope +--! @param b public.{{prefix}}_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_timestamp_ord_ope) <> eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) <> {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ope. ---! @param a public.eql_v3_timestamp_ord_ope ---! @param b public.eql_v3_timestamp_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. +--! @param a public.{{prefix}}_timestamp_ord_ope +--! @param b public.{{prefix}}_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_timestamp_ord_ope, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ope. ---! @param a public.eql_v3_timestamp_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. +--! @param a public.{{prefix}}_timestamp_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_timestamp_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_timestamp_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b::public.eql_v3_timestamp_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_timestamp_ord_ope +--! @param b public.{{prefix}}_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_timestamp_ord_ope) < eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) < {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ope. ---! @param a public.eql_v3_timestamp_ord_ope ---! @param b public.eql_v3_timestamp_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. +--! @param a public.{{prefix}}_timestamp_ord_ope +--! @param b public.{{prefix}}_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_timestamp_ord_ope, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ope. ---! @param a public.eql_v3_timestamp_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. +--! @param a public.{{prefix}}_timestamp_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_timestamp_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_timestamp_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) <= eql_v3.ord_term(b::public.eql_v3_timestamp_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_timestamp_ord_ope +--! @param b public.{{prefix}}_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_timestamp_ord_ope) <= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) <= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ope. ---! @param a public.eql_v3_timestamp_ord_ope ---! @param b public.eql_v3_timestamp_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. +--! @param a public.{{prefix}}_timestamp_ord_ope +--! @param b public.{{prefix}}_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_timestamp_ord_ope, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ope. ---! @param a public.eql_v3_timestamp_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. +--! @param a public.{{prefix}}_timestamp_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_timestamp_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_timestamp_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) > eql_v3.ord_term(b::public.eql_v3_timestamp_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_timestamp_ord_ope +--! @param b public.{{prefix}}_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_timestamp_ord_ope) > eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) > {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ope. ---! @param a public.eql_v3_timestamp_ord_ope ---! @param b public.eql_v3_timestamp_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. +--! @param a public.{{prefix}}_timestamp_ord_ope +--! @param b public.{{prefix}}_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_timestamp_ord_ope, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ope. ---! @param a public.eql_v3_timestamp_ord_ope +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. +--! @param a public.{{prefix}}_timestamp_ord_ope --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_timestamp_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_timestamp_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a) >= eql_v3.ord_term(b::public.eql_v3_timestamp_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord_ope) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ope. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a jsonb ---! @param b public.eql_v3_timestamp_ord_ope +--! @param b public.{{prefix}}_timestamp_ord_ope --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term(a::public.eql_v3_timestamp_ord_ope) >= eql_v3.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) >= {{prefix}}.ord_term(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_timestamp_ord_ope, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_timestamp_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_timestamp_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_timestamp_ord_ope, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_timestamp_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_timestamp_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_timestamp_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_timestamp_ord_ope, selector text) -RETURNS public.eql_v3_timestamp_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_timestamp_ord_ope'; END; $$ +--! @return public.{{prefix}}_timestamp_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_timestamp_ord_ope, selector text) +RETURNS public.{{prefix}}_timestamp_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_timestamp_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_timestamp_ord_ope, selector integer) -RETURNS public.eql_v3_timestamp_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_timestamp_ord_ope'; END; $$ +--! @return public.{{prefix}}_timestamp_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_timestamp_ord_ope, selector integer) +RETURNS public.{{prefix}}_timestamp_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_timestamp_ord_ope right operand of the blocked operator ---! @return public.eql_v3_timestamp_ord_ope never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_timestamp_ord_ope) -RETURNS public.eql_v3_timestamp_ord_ope IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_timestamp_ord_ope'; END; $$ +--! @param selector public.{{prefix}}_timestamp_ord_ope right operand of the blocked operator +--! @return public.{{prefix}}_timestamp_ord_ope never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_timestamp_ord_ope) +RETURNS public.{{prefix}}_timestamp_ord_ope IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_timestamp_ord_ope, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_timestamp_ord_ope, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_timestamp_ord_ope, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_timestamp_ord_ope, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_timestamp_ord_ope right operand of the blocked operator +--! @param selector public.{{prefix}}_timestamp_ord_ope right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_timestamp_ord_ope) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_timestamp_ord_ope, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_timestamp_ord_ope, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_timestamp_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_timestamp_ord_ope, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_timestamp_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_timestamp_ord_ope, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_timestamp_ord_ope, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_timestamp_ord_ope, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_timestamp_ord_ope, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_timestamp_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_timestamp_ord_ope, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord_ope right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_timestamp_ord_ope, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_timestamp_ord_ope, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_timestamp_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_timestamp_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_timestamp_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_timestamp_ord_ope, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_timestamp_ord_ope, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_timestamp_ord_ope, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_timestamp_ord_ope, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_timestamp_ord_ope, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_timestamp_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_timestamp_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_timestamp_ord_ope, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_timestamp_ord_ope, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord_ope right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord_ope right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_timestamp_ord_ope, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ope) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ope left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ope left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_timestamp_ord_ope, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_timestamp_ord_ope, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ope. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ope and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ope and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord_ope right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord_ope right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_timestamp_ord_ope) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_timestamp_ord_ope) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_timestamp_ord_ope'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_timestamp_ord_ope'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ope_operators.sql b/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ope_operators.sql index 476e379c6..615cdbea8 100644 --- a/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ope_operators.sql +++ b/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ope_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/timestamp/timestamp_ord_ope_functions.sql --! @file encrypted_domain/timestamp/timestamp_ord_ope_operators.sql ---! @brief Operators for public.eql_v3_timestamp_ord_ope. +--! @brief Operators for public.{{prefix}}_timestamp_ord_ope. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = public.eql_v3_timestamp_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ope, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ope, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = public.eql_v3_timestamp_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ope, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ope, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = public.eql_v3_timestamp_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ope, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ope, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = public.eql_v3_timestamp_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ope, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ope, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = public.eql_v3_timestamp_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ope, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ope, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = public.eql_v3_timestamp_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ope, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = public.eql_v3_timestamp_ord_ope + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ope ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ope + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ope ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = public.eql_v3_timestamp_ord_ope + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ope ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ope + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ope ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ope + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ope ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ope + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ope ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = public.eql_v3_timestamp_ord_ope + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ope ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ope + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ope ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = public.eql_v3_timestamp_ord_ope + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ope ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_timestamp_ord_ope, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ope + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ope ); diff --git a/packages/eql/src/v3/scalars/timestamp/timestamp_ord_operators.sql b/packages/eql/src/v3/scalars/timestamp/timestamp_ord_operators.sql index 0334ca561..02e9da6df 100644 --- a/packages/eql/src/v3/scalars/timestamp/timestamp_ord_operators.sql +++ b/packages/eql/src/v3/scalars/timestamp/timestamp_ord_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/timestamp/timestamp_ord_functions.sql --! @file encrypted_domain/timestamp/timestamp_ord_operators.sql ---! @brief Operators for public.eql_v3_timestamp_ord. +--! @brief Operators for public.{{prefix}}_timestamp_ord. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = public.eql_v3_timestamp_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = public.eql_v3_timestamp_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = public.eql_v3_timestamp_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = public.eql_v3_timestamp_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = public.eql_v3_timestamp_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = public.eql_v3_timestamp_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = public.eql_v3_timestamp_ord + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = public.eql_v3_timestamp_ord + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = public.eql_v3_timestamp_ord + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = public.eql_v3_timestamp_ord + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_timestamp_ord, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord ); diff --git a/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ore_aggregates.sql b/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ore_aggregates.sql index efdfc06b2..014cf2e02 100644 --- a/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ore_aggregates.sql +++ b/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ore_aggregates.sql @@ -5,14 +5,14 @@ -- REQUIRE: src/v3/scalars/timestamp/timestamp_ord_ore_operators.sql --! @file encrypted_domain/timestamp/timestamp_ord_ore_aggregates.sql ---! @brief Aggregates for public.eql_v3_timestamp_ord_ore. +--! @brief Aggregates for public.{{prefix}}_timestamp_ord_ore. ---! @brief State function for min on public.eql_v3_timestamp_ord_ore. ---! @param state public.eql_v3_timestamp_ord_ore ---! @param value public.eql_v3_timestamp_ord_ore ---! @return public.eql_v3_timestamp_ord_ore -CREATE FUNCTION eql_v3_internal.min_sfunc(state public.eql_v3_timestamp_ord_ore, value public.eql_v3_timestamp_ord_ore) -RETURNS public.eql_v3_timestamp_ord_ore +--! @brief State function for min on public.{{prefix}}_timestamp_ord_ore. +--! @param state public.{{prefix}}_timestamp_ord_ore +--! @param value public.{{prefix}}_timestamp_ord_ore +--! @return public.{{prefix}}_timestamp_ord_ore +CREATE FUNCTION {{prefix}}_internal.min_sfunc(state public.{{prefix}}_timestamp_ord_ore, value public.{{prefix}}_timestamp_ord_ore) +RETURNS public.{{prefix}}_timestamp_ord_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -24,22 +24,22 @@ BEGIN END; $$; ---! @brief min aggregate for public.eql_v3_timestamp_ord_ore. ---! @param input public.eql_v3_timestamp_ord_ore ---! @return public.eql_v3_timestamp_ord_ore -CREATE AGGREGATE eql_v3.min(public.eql_v3_timestamp_ord_ore) ( - sfunc = eql_v3_internal.min_sfunc, - stype = public.eql_v3_timestamp_ord_ore, - combinefunc = eql_v3_internal.min_sfunc, +--! @brief min aggregate for public.{{prefix}}_timestamp_ord_ore. +--! @param input public.{{prefix}}_timestamp_ord_ore +--! @return public.{{prefix}}_timestamp_ord_ore +CREATE AGGREGATE {{prefix}}.min(public.{{prefix}}_timestamp_ord_ore) ( + sfunc = {{prefix}}_internal.min_sfunc, + stype = public.{{prefix}}_timestamp_ord_ore, + combinefunc = {{prefix}}_internal.min_sfunc, parallel = safe ); ---! @brief State function for max on public.eql_v3_timestamp_ord_ore. ---! @param state public.eql_v3_timestamp_ord_ore ---! @param value public.eql_v3_timestamp_ord_ore ---! @return public.eql_v3_timestamp_ord_ore -CREATE FUNCTION eql_v3_internal.max_sfunc(state public.eql_v3_timestamp_ord_ore, value public.eql_v3_timestamp_ord_ore) -RETURNS public.eql_v3_timestamp_ord_ore +--! @brief State function for max on public.{{prefix}}_timestamp_ord_ore. +--! @param state public.{{prefix}}_timestamp_ord_ore +--! @param value public.{{prefix}}_timestamp_ord_ore +--! @return public.{{prefix}}_timestamp_ord_ore +CREATE FUNCTION {{prefix}}_internal.max_sfunc(state public.{{prefix}}_timestamp_ord_ore, value public.{{prefix}}_timestamp_ord_ore) +RETURNS public.{{prefix}}_timestamp_ord_ore LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ @@ -51,12 +51,12 @@ BEGIN END; $$; ---! @brief max aggregate for public.eql_v3_timestamp_ord_ore. ---! @param input public.eql_v3_timestamp_ord_ore ---! @return public.eql_v3_timestamp_ord_ore -CREATE AGGREGATE eql_v3.max(public.eql_v3_timestamp_ord_ore) ( - sfunc = eql_v3_internal.max_sfunc, - stype = public.eql_v3_timestamp_ord_ore, - combinefunc = eql_v3_internal.max_sfunc, +--! @brief max aggregate for public.{{prefix}}_timestamp_ord_ore. +--! @param input public.{{prefix}}_timestamp_ord_ore +--! @return public.{{prefix}}_timestamp_ord_ore +CREATE AGGREGATE {{prefix}}.max(public.{{prefix}}_timestamp_ord_ore) ( + sfunc = {{prefix}}_internal.max_sfunc, + stype = public.{{prefix}}_timestamp_ord_ore, + combinefunc = {{prefix}}_internal.max_sfunc, parallel = safe ); diff --git a/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ore_functions.sql b/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ore_functions.sql index 8eb73a1da..6a83371f2 100644 --- a/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ore_functions.sql +++ b/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ore_functions.sql @@ -6,562 +6,562 @@ -- REQUIRE: src/v3/sem/ore_block_256/operators.sql --! @file encrypted_domain/timestamp/timestamp_ord_ore_functions.sql ---! @brief Functions for public.eql_v3_timestamp_ord_ore. +--! @brief Functions for public.{{prefix}}_timestamp_ord_ore. ---! @brief Index extractor for public.eql_v3_timestamp_ord_ore. ---! @param a public.eql_v3_timestamp_ord_ore ---! @return eql_v3_internal.ore_block_256 -CREATE FUNCTION eql_v3.ord_term_ore(a public.eql_v3_timestamp_ord_ore) -RETURNS eql_v3_internal.ore_block_256 +--! @brief Index extractor for public.{{prefix}}_timestamp_ord_ore. +--! @param a public.{{prefix}}_timestamp_ord_ore +--! @return {{prefix}}_internal.ore_block_256 +CREATE FUNCTION {{prefix}}.ord_term_ore(a public.{{prefix}}_timestamp_ord_ore) +RETURNS {{prefix}}_internal.ore_block_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3_internal.ore_block_256(a::jsonb) $$; +AS $$ SELECT {{prefix}}_internal.ore_block_256(a::jsonb) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ore. ---! @param a public.eql_v3_timestamp_ord_ore ---! @param b public.eql_v3_timestamp_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. +--! @param a public.{{prefix}}_timestamp_ord_ore +--! @param b public.{{prefix}}_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_timestamp_ord_ore, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ore. ---! @param a public.eql_v3_timestamp_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. +--! @param a public.{{prefix}}_timestamp_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.eq(a public.eql_v3_timestamp_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) = eql_v3.ord_term_ore(b::public.eql_v3_timestamp_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{prefix}}_timestamp_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_timestamp_ord_ore +--! @param b public.{{prefix}}_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.eq(a jsonb, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_timestamp_ord_ore) = eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) = {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ore. ---! @param a public.eql_v3_timestamp_ord_ore ---! @param b public.eql_v3_timestamp_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. +--! @param a public.{{prefix}}_timestamp_ord_ore +--! @param b public.{{prefix}}_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_timestamp_ord_ore, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ore. ---! @param a public.eql_v3_timestamp_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. +--! @param a public.{{prefix}}_timestamp_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.neq(a public.eql_v3_timestamp_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <> eql_v3.ord_term_ore(b::public.eql_v3_timestamp_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{prefix}}_timestamp_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_timestamp_ord_ore +--! @param b public.{{prefix}}_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.neq(a jsonb, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_timestamp_ord_ore) <> eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) <> {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ore. ---! @param a public.eql_v3_timestamp_ord_ore ---! @param b public.eql_v3_timestamp_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. +--! @param a public.{{prefix}}_timestamp_ord_ore +--! @param b public.{{prefix}}_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_timestamp_ord_ore, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ore. ---! @param a public.eql_v3_timestamp_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. +--! @param a public.{{prefix}}_timestamp_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lt(a public.eql_v3_timestamp_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_timestamp_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) < eql_v3.ord_term_ore(b::public.eql_v3_timestamp_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_timestamp_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_timestamp_ord_ore +--! @param b public.{{prefix}}_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lt(a jsonb, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_timestamp_ord_ore) < eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) < {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ore. ---! @param a public.eql_v3_timestamp_ord_ore ---! @param b public.eql_v3_timestamp_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. +--! @param a public.{{prefix}}_timestamp_ord_ore +--! @param b public.{{prefix}}_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_timestamp_ord_ore, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ore. ---! @param a public.eql_v3_timestamp_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. +--! @param a public.{{prefix}}_timestamp_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.lte(a public.eql_v3_timestamp_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_timestamp_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) <= eql_v3.ord_term_ore(b::public.eql_v3_timestamp_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_timestamp_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_timestamp_ord_ore +--! @param b public.{{prefix}}_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.lte(a jsonb, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_timestamp_ord_ore) <= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) <= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ore. ---! @param a public.eql_v3_timestamp_ord_ore ---! @param b public.eql_v3_timestamp_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. +--! @param a public.{{prefix}}_timestamp_ord_ore +--! @param b public.{{prefix}}_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_timestamp_ord_ore, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ore. ---! @param a public.eql_v3_timestamp_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. +--! @param a public.{{prefix}}_timestamp_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gt(a public.eql_v3_timestamp_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_timestamp_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) > eql_v3.ord_term_ore(b::public.eql_v3_timestamp_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_timestamp_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_timestamp_ord_ore +--! @param b public.{{prefix}}_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gt(a jsonb, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_timestamp_ord_ore) > eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) > {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ore. ---! @param a public.eql_v3_timestamp_ord_ore ---! @param b public.eql_v3_timestamp_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. +--! @param a public.{{prefix}}_timestamp_ord_ore +--! @param b public.{{prefix}}_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_timestamp_ord_ore, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ore. ---! @param a public.eql_v3_timestamp_ord_ore +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. +--! @param a public.{{prefix}}_timestamp_ord_ore --! @param b jsonb --! @return boolean -CREATE FUNCTION eql_v3.gte(a public.eql_v3_timestamp_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_timestamp_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a) >= eql_v3.ord_term_ore(b::public.eql_v3_timestamp_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_timestamp_ord_ore) $$; ---! @brief Operator wrapper for public.eql_v3_timestamp_ord_ore. +--! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a jsonb ---! @param b public.eql_v3_timestamp_ord_ore +--! @param b public.{{prefix}}_timestamp_ord_ore --! @return boolean -CREATE FUNCTION eql_v3.gte(a jsonb, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT eql_v3.ord_term_ore(a::public.eql_v3_timestamp_ord_ore) >= eql_v3.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) >= {{prefix}}.ord_term_ore(b) $$; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_timestamp_ord_ore, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a public.eql_v3_timestamp_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contains(a public.{{prefix}}_timestamp_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contains(a jsonb, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contains(a jsonb, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@>', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_timestamp_ord_ore, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a public.eql_v3_timestamp_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal.contained_by(a public.{{prefix}}_timestamp_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal.contained_by(a jsonb, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}_internal.contained_by(a jsonb, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '<@', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator ---! @return public.eql_v3_timestamp_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_timestamp_ord_ore, selector text) -RETURNS public.eql_v3_timestamp_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_timestamp_ord_ore'; END; $$ +--! @return public.{{prefix}}_timestamp_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_timestamp_ord_ore, selector text) +RETURNS public.{{prefix}}_timestamp_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator ---! @return public.eql_v3_timestamp_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a public.eql_v3_timestamp_ord_ore, selector integer) -RETURNS public.eql_v3_timestamp_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_timestamp_ord_ore'; END; $$ +--! @return public.{{prefix}}_timestamp_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a public.{{prefix}}_timestamp_ord_ore, selector integer) +RETURNS public.{{prefix}}_timestamp_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_timestamp_ord_ore right operand of the blocked operator ---! @return public.eql_v3_timestamp_ord_ore never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->"(a jsonb, selector public.eql_v3_timestamp_ord_ore) -RETURNS public.eql_v3_timestamp_ord_ore IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.eql_v3_timestamp_ord_ore'; END; $$ +--! @param selector public.{{prefix}}_timestamp_ord_ore right operand of the blocked operator +--! @return public.{{prefix}}_timestamp_ord_ore never returned — the function always raises "operator not supported" +CREATE FUNCTION {{prefix}}_internal."->"(a jsonb, selector public.{{prefix}}_timestamp_ord_ore) +RETURNS public.{{prefix}}_timestamp_ord_ore IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator --! @param selector text right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_timestamp_ord_ore, selector text) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_timestamp_ord_ore, selector text) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator --! @param selector integer right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a public.eql_v3_timestamp_ord_ore, selector integer) +CREATE FUNCTION {{prefix}}_internal."->>"(a public.{{prefix}}_timestamp_ord_ore, selector integer) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param selector public.eql_v3_timestamp_ord_ore right operand of the blocked operator +--! @param selector public.{{prefix}}_timestamp_ord_ore right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."->>"(a jsonb, selector public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}_internal."->>"(a jsonb, selector public.{{prefix}}_timestamp_ord_ore) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '->>', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?"(a public.eql_v3_timestamp_ord_ore, b text) +CREATE FUNCTION {{prefix}}_internal."?"(a public.{{prefix}}_timestamp_ord_ore, b text) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?|"(a public.eql_v3_timestamp_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?|"(a public.{{prefix}}_timestamp_ord_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?|', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."?&"(a public.eql_v3_timestamp_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."?&"(a public.{{prefix}}_timestamp_ord_ore, b text[]) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '?&', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@?"(a public.eql_v3_timestamp_ord_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@?"(a public.{{prefix}}_timestamp_ord_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@?', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_timestamp_ord_ore, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_timestamp_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_timestamp_ord_ore, b jsonb) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord_ore right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a jsonb, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}_internal."@@"(a jsonb, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator --! @param b jsonpath right operand of the blocked operator --! @return boolean never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."@@"(a public.eql_v3_timestamp_ord_ore, b jsonpath) +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_timestamp_ord_ore, b jsonpath) RETURNS boolean IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '@@', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>"(a public.eql_v3_timestamp_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>"(a public.{{prefix}}_timestamp_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return text never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#>>"(a public.eql_v3_timestamp_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#>>"(a public.{{prefix}}_timestamp_ord_ore, b text[]) RETURNS text IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#>>', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator --! @param b text right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_timestamp_ord_ore, b text) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_timestamp_ord_ore, b text) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator --! @param b integer right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_timestamp_ord_ore, b integer) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_timestamp_ord_ore, b integer) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."-"(a public.eql_v3_timestamp_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."-"(a public.{{prefix}}_timestamp_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '-', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator --! @param b text[] right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."#-"(a public.eql_v3_timestamp_ord_ore, b text[]) +CREATE FUNCTION {{prefix}}_internal."#-"(a public.{{prefix}}_timestamp_ord_ore, b text[]) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '#-', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord_ore right operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_timestamp_ord_ore, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! ---! @param a public.eql_v3_timestamp_ord_ore left operand of the blocked operator +--! @param a public.{{prefix}}_timestamp_ord_ore left operand of the blocked operator --! @param b jsonb right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a public.eql_v3_timestamp_ord_ore, b jsonb) +CREATE FUNCTION {{prefix}}_internal."||"(a public.{{prefix}}_timestamp_ord_ore, b jsonb) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; ---! @brief Unsupported operator blocker for public.eql_v3_timestamp_ord_ore. +--! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! ---! Intercepts an operator that is not supported on public.eql_v3_timestamp_ord_ore and always raises; +--! Intercepts an operator that is not supported on public.{{prefix}}_timestamp_ord_ore and always raises; --! it never returns a value. The declared signature exists only so the operator --! resolves to this blocker instead of a base-type fallback. --! --! @param a jsonb left operand of the blocked operator ---! @param b public.eql_v3_timestamp_ord_ore right operand of the blocked operator +--! @param b public.{{prefix}}_timestamp_ord_ore right operand of the blocked operator --! @return jsonb never returned — the function always raises "operator not supported" -CREATE FUNCTION eql_v3_internal."||"(a jsonb, b public.eql_v3_timestamp_ord_ore) +CREATE FUNCTION {{prefix}}_internal."||"(a jsonb, b public.{{prefix}}_timestamp_ord_ore) RETURNS jsonb IMMUTABLE PARALLEL SAFE -AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.eql_v3_timestamp_ord_ore'; END; $$ +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '||', 'public.{{prefix}}_timestamp_ord_ore'; END; $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ore_operators.sql b/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ore_operators.sql index b12b343af..cbf75399f 100644 --- a/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ore_operators.sql +++ b/packages/eql/src/v3/scalars/timestamp/timestamp_ord_ore_operators.sql @@ -4,257 +4,257 @@ -- REQUIRE: src/v3/scalars/timestamp/timestamp_ord_ore_functions.sql --! @file encrypted_domain/timestamp/timestamp_ord_ore_operators.sql ---! @brief Operators for public.eql_v3_timestamp_ord_ore. +--! @brief Operators for public.{{prefix}}_timestamp_ord_ore. CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = public.eql_v3_timestamp_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.eq, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = jsonb, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR = ( - FUNCTION = eql_v3.eq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ore, + FUNCTION = {{prefix}}.eq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ore, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = public.eql_v3_timestamp_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.neq, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR <> ( - FUNCTION = eql_v3.neq, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ore, + FUNCTION = {{prefix}}.neq, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ore, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = public.eql_v3_timestamp_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lt, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = jsonb, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR < ( - FUNCTION = eql_v3.lt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ore, + FUNCTION = {{prefix}}.lt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ore, COMMUTATOR = >, NEGATOR = >=, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = public.eql_v3_timestamp_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.lte, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = jsonb, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR <= ( - FUNCTION = eql_v3.lte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ore, + FUNCTION = {{prefix}}.lte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ore, COMMUTATOR = >=, NEGATOR = >, RESTRICT = scalarlesel, JOIN = scalarlejoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = public.eql_v3_timestamp_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gt, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR > ( - FUNCTION = eql_v3.gt, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ore, + FUNCTION = {{prefix}}.gt, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ore, COMMUTATOR = <, NEGATOR = <=, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = public.eql_v3_timestamp_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = jsonb, + FUNCTION = {{prefix}}.gte, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = jsonb, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR >= ( - FUNCTION = eql_v3.gte, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ore, + FUNCTION = {{prefix}}.gte, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = public.eql_v3_timestamp_ord_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ore ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR @> ( - FUNCTION = eql_v3_internal.contains, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ore + FUNCTION = {{prefix}}_internal.contains, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = public.eql_v3_timestamp_ord_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ore ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR <@ ( - FUNCTION = eql_v3_internal.contained_by, - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ore + FUNCTION = {{prefix}}_internal.contained_by, + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ore ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = text ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->", + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = integer ); CREATE OPERATOR -> ( - FUNCTION = eql_v3_internal."->", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ore + FUNCTION = {{prefix}}_internal."->", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ore ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = text ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = integer ); CREATE OPERATOR ->> ( - FUNCTION = eql_v3_internal."->>", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ore + FUNCTION = {{prefix}}_internal."->>", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ore ); CREATE OPERATOR ? ( - FUNCTION = eql_v3_internal."?", - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."?", + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = text ); CREATE OPERATOR ?| ( - FUNCTION = eql_v3_internal."?|", - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?|", + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR ?& ( - FUNCTION = eql_v3_internal."?&", - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."?&", + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR @? ( - FUNCTION = eql_v3_internal."@?", - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@?", + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = jsonpath ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = public.eql_v3_timestamp_ord_ore + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ore ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ore + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ore ); CREATE OPERATOR @@ ( - FUNCTION = eql_v3_internal."@@", - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = jsonpath + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = jsonpath ); CREATE OPERATOR #> ( - FUNCTION = eql_v3_internal."#>", - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>", + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR #>> ( - FUNCTION = eql_v3_internal."#>>", - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#>>", + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = text + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = text ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = integer + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = integer ); CREATE OPERATOR - ( - FUNCTION = eql_v3_internal."-", - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."-", + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR #- ( - FUNCTION = eql_v3_internal."#-", - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = text[] + FUNCTION = {{prefix}}_internal."#-", + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = text[] ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = public.eql_v3_timestamp_ord_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ore ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = public.eql_v3_timestamp_ord_ore, RIGHTARG = jsonb + FUNCTION = {{prefix}}_internal."||", + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = jsonb ); CREATE OPERATOR || ( - FUNCTION = eql_v3_internal."||", - LEFTARG = jsonb, RIGHTARG = public.eql_v3_timestamp_ord_ore + FUNCTION = {{prefix}}_internal."||", + LEFTARG = jsonb, RIGHTARG = public.{{prefix}}_timestamp_ord_ore ); diff --git a/packages/eql/src/v3/scalars/timestamp/timestamp_types.sql b/packages/eql/src/v3/scalars/timestamp/timestamp_types.sql index e20c626fe..c0d903b1b 100644 --- a/packages/eql/src/v3/scalars/timestamp/timestamp_types.sql +++ b/packages/eql/src/v3/scalars/timestamp/timestamp_types.sql @@ -6,47 +6,47 @@ DO $$ BEGIN - --! @brief Encrypted domain public.eql_v3_timestamp. + --! @brief Encrypted domain public.{{prefix}}_timestamp. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_timestamp' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_timestamp' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_timestamp AS jsonb + CREATE DOMAIN public.{{prefix}}_timestamp AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_timestamp IS 'EQL encrypted timestamp (storage only)'; + COMMENT ON DOMAIN public.{{prefix}}_timestamp IS 'EQL encrypted timestamp (storage only)'; - --! @brief Encrypted domain public.eql_v3_timestamp_eq. + --! @brief Encrypted domain public.{{prefix}}_timestamp_eq. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_timestamp_eq' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_timestamp_eq' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_timestamp_eq AS jsonb + CREATE DOMAIN public.{{prefix}}_timestamp_eq AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'hm' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_timestamp_eq IS 'EQL encrypted timestamp (equality)'; + COMMENT ON DOMAIN public.{{prefix}}_timestamp_eq IS 'EQL encrypted timestamp (equality)'; - --! @brief Encrypted domain public.eql_v3_timestamp_ord_ore. + --! @brief Encrypted domain public.{{prefix}}_timestamp_ord_ore. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_timestamp_ord_ore' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_timestamp_ord_ore' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_timestamp_ord_ore AS jsonb + CREATE DOMAIN public.{{prefix}}_timestamp_ord_ore AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' @@ -55,46 +55,46 @@ BEGIN AND VALUE ? 'ob' AND jsonb_typeof(VALUE -> 'ob') = 'array' AND jsonb_array_length(VALUE -> 'ob') > 0 - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_timestamp_ord_ore IS 'EQL encrypted timestamp (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_timestamp_ord_ore IS 'EQL encrypted timestamp (equality, ordering)'; - --! @brief Encrypted domain public.eql_v3_timestamp_ord. + --! @brief Encrypted domain public.{{prefix}}_timestamp_ord. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_timestamp_ord' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_timestamp_ord' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_timestamp_ord AS jsonb + CREATE DOMAIN public.{{prefix}}_timestamp_ord AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'op' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_timestamp_ord IS 'EQL encrypted timestamp (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_timestamp_ord IS 'EQL encrypted timestamp (equality, ordering)'; - --! @brief Encrypted domain public.eql_v3_timestamp_ord_ope. + --! @brief Encrypted domain public.{{prefix}}_timestamp_ord_ope. IF NOT EXISTS ( SELECT 1 FROM pg_type - WHERE typname = 'eql_v3_timestamp_ord_ope' AND typnamespace = 'public'::regnamespace + WHERE typname = '{{prefix}}_timestamp_ord_ope' AND typnamespace = 'public'::regnamespace ) THEN - CREATE DOMAIN public.eql_v3_timestamp_ord_ope AS jsonb + CREATE DOMAIN public.{{prefix}}_timestamp_ord_ope AS jsonb CHECK ( jsonb_typeof(VALUE) = 'object' AND VALUE ? 'v' AND VALUE ? 'i' AND VALUE ? 'c' AND VALUE ? 'op' - AND VALUE->>'v' = '3' + AND VALUE->>'v' = '{{eql_version}}' ); END IF; - COMMENT ON DOMAIN public.eql_v3_timestamp_ord_ope IS 'EQL encrypted timestamp (equality, ordering)'; + COMMENT ON DOMAIN public.{{prefix}}_timestamp_ord_ope IS 'EQL encrypted timestamp (equality, ordering)'; END $$; diff --git a/packages/eql/src/v3/schema.sql b/packages/eql/src/v3/schema.sql index 4411f8e9b..d82dad656 100644 --- a/packages/eql/src/v3/schema.sql +++ b/packages/eql/src/v3/schema.sql @@ -1,18 +1,18 @@ --! @file v3/schema.sql ---! @brief EQL v3 schema creation +--! @brief EQL v{{eql_version}} schema creation --! ---! Creates the eql_v3 and eql_v3_internal schemas. User-column encrypted ---! domains (public.eql_v3_integer, public.eql_v3_bigint, and future scalar domains) live in ---! public so application tables survive EQL schema uninstall. eql_v3 is the +--! Creates the {{prefix}} and {{prefix}}_internal schemas. User-column encrypted +--! domains (public.{{prefix}}_integer, public.{{prefix}}_bigint, and future scalar domains) live in +--! public so application tables survive EQL schema uninstall. {{prefix}} is the --! public API for index-term extractors, aggregates, AND the operator-backing --! comparison wrappers --! (eq/neq/lt/lte/gt/gte/contains/contained_by, plus the jsonb containment --! helpers). The wrappers are public because they are the function-form --! equivalent of every supported operator: platforms without operator support --! (Supabase/PostgREST calls functions, not operators) invoke them by name. ---! eql_v3_internal houses INTERNAL implementation objects only: the +--! {{prefix}}_internal houses INTERNAL implementation objects only: the --! searchable-encrypted-metadata (SEM) index-term types ---! (eql_v3_internal.hmac_256, eql_v3_internal.ore_block_256) and their support +--! ({{prefix}}_internal.hmac_256, {{prefix}}_internal.ore_block_256) and their support --! functions, the unsupported-operator blockers (which only raise), and the --! aggregate state functions. Together the two schemas are self-contained — --! they own every type they need and have no runtime dependency on another EQL @@ -21,58 +21,58 @@ --! Drops existing schema if present to support clean reinstallation. --! --! @warning DROP SCHEMA CASCADE will remove all objects in the schema ---! @note eql_v3 is a new, additional schema for the encrypted-domain families. +--! @note {{prefix}} is a new, additional schema for the encrypted-domain families. --! --! @note DESIGN DECISION — EQL never grants permissions automatically. This ---! installer issues no GRANT (or REVOKE) on eql_v3 or eql_v3_internal: +--! installer issues no GRANT (or REVOKE) on {{prefix}} or {{prefix}}_internal: --! access is strictly opt-in. A deployment that exposes EQL to --! non-owner roles (e.g. Supabase `authenticated`/`anon` via PostgREST) ---! must explicitly `GRANT USAGE ON SCHEMA eql_v3` and `GRANT EXECUTE` on +--! must explicitly `GRANT USAGE ON SCHEMA {{prefix}}` and `GRANT EXECUTE` on --! the functions it needs. This is intentional least-privilege, not an ---! oversight — see docs/reference/permissions.md. eql_v3_internal is not +--! oversight — see docs/reference/permissions.md. {{prefix}}_internal is not --! part of the public API and normally needs no grant; where a caller --! reaches an internal object indirectly (a public operator/aggregate --! whose backing state-fn/blocker lives there), grant it deliberately. ---! @brief Drop existing EQL v3 schema +--! @brief Drop existing EQL v{{eql_version}} schema --! @warning CASCADE will drop all dependent objects -DROP SCHEMA IF EXISTS eql_v3 CASCADE; +DROP SCHEMA IF EXISTS {{prefix}} CASCADE; ---! @brief Create EQL v3 schema +--! @brief Create EQL v{{eql_version}} schema --! @note Houses the encrypted-domain type families -CREATE SCHEMA eql_v3; +CREATE SCHEMA {{prefix}}; ---! @brief Drop existing EQL v3 internal schema +--! @brief Drop existing EQL v{{eql_version}} internal schema --! @warning CASCADE will drop all dependent objects -DROP SCHEMA IF EXISTS eql_v3_internal CASCADE; +DROP SCHEMA IF EXISTS {{prefix}}_internal CASCADE; ---! @brief Create EQL v3 internal implementation schema ---! @note Houses INTERNAL eql_v3 objects only: SEM index-term TYPES + their +--! @brief Create EQL v{{eql_version}} internal implementation schema +--! @note Houses INTERNAL {{prefix}} objects only: SEM index-term TYPES + their --! support/constructor/comparator functions, the unsupported-operator --! blockers (which only raise), the aggregate state functions, and the ---! SteVec CHECK validators. Kept out of the public `eql_v3` surface so +--! SteVec CHECK validators. Kept out of the public `{{prefix}}` surface so --! internal index-term TYPES do not clutter the Supabase Table Builder --! type picker. NOTE: the operator-backing comparison *wrappers* are NOT ---! here — they are public in `eql_v3` so every operator has a callable +--! here — they are public in `{{prefix}}` so every operator has a callable --! function equivalent for platforms without operator support. -CREATE SCHEMA eql_v3_internal; -COMMENT ON SCHEMA eql_v3_internal IS +CREATE SCHEMA {{prefix}}_internal; +COMMENT ON SCHEMA {{prefix}}_internal IS 'EQL internal implementation detail; not a public API surface.'; ---! @brief Schemas owned by the eql_v3 surface +--! @brief Schemas owned by the {{prefix}} surface --! --! Single source of truth for tooling that must enumerate every schema this ---! installer owns (`eql_v3.lints()`, `tasks/pin_search_path_v3.sql`), so a ---! future third eql_v3-family schema is one array literal to edit instead of +--! installer owns (`{{prefix}}.lints()`, `tasks/pin_search_path_v3.sql`), so a +--! future third {{prefix}}-family schema is one array literal to edit instead of --! a hardcoded schema-name predicate repeated at every call site. Keep in --! sync with the `SCHEMA` / `INTERNAL_SCHEMA` constants in --! `crates/eql-codegen/src/consts.rs` — those drive what codegen emits into --! each schema; this drives what tooling scans across both. --! ---! @return name[] The schema names eql_v3 owns (public + internal). -CREATE FUNCTION eql_v3_internal.owned_schemas() +--! @return name[] The schema names {{prefix}} owns (public + internal). +CREATE FUNCTION {{prefix}}_internal.owned_schemas() RETURNS name[] LANGUAGE sql IMMUTABLE PARALLEL SAFE AS $$ - SELECT ARRAY['eql_v3', 'eql_v3_internal']::name[] + SELECT ARRAY['{{prefix}}', '{{prefix}}_internal']::name[] $$; diff --git a/packages/eql/src/v3/sem/bloom_filter/functions.sql b/packages/eql/src/v3/sem/bloom_filter/functions.sql index bcee55da4..db4db5202 100644 --- a/packages/eql/src/v3/sem/bloom_filter/functions.sql +++ b/packages/eql/src/v3/sem/bloom_filter/functions.sql @@ -2,10 +2,10 @@ -- REQUIRE: src/v3/sem/bloom_filter/types.sql --! @file v3/sem/bloom_filter/functions.sql ---! @brief Extractor for the eql_v3 Bloom-filter SEM index term. +--! @brief Extractor for the {{prefix}} Bloom-filter SEM index term. --! --! jsonb-only subset of src/bloom_filter/functions.sql. The encrypted-column ---! overloads are intentionally omitted — the eql_v3 scalar domains extract from +--! overloads are intentionally omitted — the {{prefix}} scalar domains extract from --! the jsonb payload directly via a cast to the domain. (Doc comments --! deliberately avoid naming eql_v2 symbols so the self-containment grep stays --! clean.) @@ -15,12 +15,12 @@ --! @param val jsonb The encrypted payload. --! @return boolean True when the `bf` key is present and non-null. --! ---! @internal Defined for parity with the eql_v3 SEM index-term predicates +--! @internal Defined for parity with the {{prefix}} SEM index-term predicates --! (`has_hmac_256` / `has_ore_block_256`); it is not currently called by --! the extractor below, which gates on value-shape inline, nor by the generated --! domain CHECK, which tests `bf` presence via the envelope-key skeleton. Kept --! as the canonical presence test for callers that need one. -CREATE FUNCTION eql_v3_internal.has_bloom_filter(val jsonb) +CREATE FUNCTION {{prefix}}_internal.has_bloom_filter(val jsonb) RETURNS boolean IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public @@ -33,8 +33,8 @@ $$ LANGUAGE plpgsql; --! @brief Extract the Bloom-filter index term from a jsonb payload. --! --! Inlinable single-statement SQL — the planner can fold this into the calling ---! query so the functional GIN index built on `eql_v3_internal.match_term(col)` (which ---! calls this) engages structurally. Mirrors `eql_v3_internal.hmac_256(jsonb)`: no RAISE +--! query so the functional GIN index built on `{{prefix}}_internal.match_term(col)` (which +--! calls this) engages structurally. Mirrors `{{prefix}}_internal.hmac_256(jsonb)`: no RAISE --! and no pinned `search_path`. Returns NULL when `bf` is absent or present but --! not a json array, rather than raising. The `text_match` domain CHECK --! guarantees the `bf` *key* is present but not that it is an array, so a @@ -46,14 +46,14 @@ $$ LANGUAGE plpgsql; --! everything), matching set-containment semantics. --! --! @param val jsonb The encrypted payload. ---! @return eql_v3_internal.bloom_filter The `bf` array as a smallint[] domain value, or +--! @return {{prefix}}_internal.bloom_filter The `bf` array as a smallint[] domain value, or --! NULL when `bf` is absent or not a json array. -CREATE FUNCTION eql_v3_internal.bloom_filter(val jsonb) - RETURNS eql_v3_internal.bloom_filter +CREATE FUNCTION {{prefix}}_internal.bloom_filter(val jsonb) + RETURNS {{prefix}}_internal.bloom_filter LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ SELECT CASE WHEN jsonb_typeof(val -> 'bf') = 'array' - THEN ARRAY(SELECT jsonb_array_elements(val -> 'bf'))::eql_v3_internal.bloom_filter + THEN ARRAY(SELECT jsonb_array_elements(val -> 'bf'))::{{prefix}}_internal.bloom_filter END $$; diff --git a/packages/eql/src/v3/sem/bloom_filter/types.sql b/packages/eql/src/v3/sem/bloom_filter/types.sql index 618181e74..3c89db075 100644 --- a/packages/eql/src/v3/sem/bloom_filter/types.sql +++ b/packages/eql/src/v3/sem/bloom_filter/types.sql @@ -1,15 +1,15 @@ -- REQUIRE: src/v3/schema.sql --! @file v3/sem/bloom_filter/types.sql ---! @brief Self-contained eql_v3 Bloom-filter SEM index-term type. +--! @brief Self-contained {{prefix}} Bloom-filter SEM index-term type. --! @brief Bloom-filter index term: a bit array stored as smallint[]. --! --! Backs the `matches` fuzzy-match capability (the public `@@` operator / ---! `eql_v3.matches`) on the text match/search domains. The filter is read from +--! `{{prefix}}.matches`) on the text match/search domains. The filter is read from --! the `bf` field of an encrypted jsonb payload. The match wrapper body reduces --! to native `smallint[]` array-containment (`@>`) on this domain — inherited ---! through the base type — so a functional GIN index on `eql_v3.match_term(col)` +--! through the base type — so a functional GIN index on `{{prefix}}.match_term(col)` --! engages; this type itself needs no custom operators. --! --! @note The public operator is `@@` (fuzzy bloom-token matching), NOT the @@ -18,4 +18,4 @@ --! domains now raise. Internally the `@@` wrapper still reduces to the base --! type's `@>` for GIN indexability. --! @note Self-contained: references no eql_v2 symbol. -CREATE DOMAIN eql_v3_internal.bloom_filter AS smallint[]; +CREATE DOMAIN {{prefix}}_internal.bloom_filter AS smallint[]; diff --git a/packages/eql/src/v3/sem/hmac_256/functions.sql b/packages/eql/src/v3/sem/hmac_256/functions.sql index 1efb786bb..6724fd532 100644 --- a/packages/eql/src/v3/sem/hmac_256/functions.sql +++ b/packages/eql/src/v3/sem/hmac_256/functions.sql @@ -2,10 +2,10 @@ -- REQUIRE: src/v3/sem/hmac_256/types.sql --! @file v3/sem/hmac_256/functions.sql ---! @brief HMAC-SHA256 index-term extraction from a jsonb payload (eql_v3 SEM). +--! @brief HMAC-SHA256 index-term extraction from a jsonb payload ({{prefix}} SEM). --! --! jsonb-only subset of src/hmac_256/functions.sql. The encrypted-column and ---! ste_vec-entry overloads are intentionally omitted — the eql_v3 scalar +--! ste_vec-entry overloads are intentionally omitted — the {{prefix}} scalar --! domains extract from the jsonb payload directly via a cast to the domain. --! (Doc comments deliberately avoid naming eql_v2 symbols so the --! self-containment grep stays clean.) @@ -13,17 +13,17 @@ --! @brief Extract HMAC-SHA256 index term from JSONB payload --! --! Inlinable single-statement SQL — the planner can fold this into the calling ---! query so functional hash/btree indexes built on `eql_v3_internal.eq_term(col)` +--! query so functional hash/btree indexes built on `{{prefix}}_internal.eq_term(col)` --! (which calls this) engage structurally. --! --! @param val jsonb containing encrypted EQL payload ---! @return eql_v3_internal.hmac_256 HMAC-SHA256 hash value, or NULL when `hm` is absent -CREATE FUNCTION eql_v3_internal.hmac_256(val jsonb) - RETURNS eql_v3_internal.hmac_256 +--! @return {{prefix}}_internal.hmac_256 HMAC-SHA256 hash value, or NULL when `hm` is absent +CREATE FUNCTION {{prefix}}_internal.hmac_256(val jsonb) + RETURNS {{prefix}}_internal.hmac_256 LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT (val ->> 'hm')::eql_v3_internal.hmac_256 + SELECT (val ->> 'hm')::{{prefix}}_internal.hmac_256 $$; @@ -31,7 +31,7 @@ $$; --! --! @param val jsonb containing encrypted EQL payload --! @return boolean True if 'hm' field is present and non-null -CREATE FUNCTION eql_v3_internal.has_hmac_256(val jsonb) +CREATE FUNCTION {{prefix}}_internal.has_hmac_256(val jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE diff --git a/packages/eql/src/v3/sem/hmac_256/types.sql b/packages/eql/src/v3/sem/hmac_256/types.sql index eace5c2ed..49aea94fd 100644 --- a/packages/eql/src/v3/sem/hmac_256/types.sql +++ b/packages/eql/src/v3/sem/hmac_256/types.sql @@ -1,12 +1,12 @@ -- REQUIRE: src/v3/schema.sql --! @file v3/sem/hmac_256/types.sql ---! @brief HMAC-SHA256 index term type (eql_v3 SEM) +--! @brief HMAC-SHA256 index term type ({{prefix}} SEM) --! --! Domain type representing HMAC-SHA256 hash values. Used for exact-match --! encrypted searches. The hash is stored in the 'hm' field of encrypted data ---! payloads. Self-contained eql_v3 copy (design D1/D3); the eql_v2 original is +--! payloads. Self-contained {{prefix}} copy (design D1/D3); the eql_v2 original is --! unchanged. --! --! @note Transient type used only during query execution. -CREATE DOMAIN eql_v3_internal.hmac_256 AS text; +CREATE DOMAIN {{prefix}}_internal.hmac_256 AS text; diff --git a/packages/eql/src/v3/sem/ope_cllw/functions.sql b/packages/eql/src/v3/sem/ope_cllw/functions.sql index 05509e761..9d038a2f5 100644 --- a/packages/eql/src/v3/sem/ope_cllw/functions.sql +++ b/packages/eql/src/v3/sem/ope_cllw/functions.sql @@ -2,17 +2,17 @@ -- REQUIRE: src/v3/sem/ope_cllw/types.sql --! @file v3/sem/ope_cllw/functions.sql ---! @brief CLLW OPE index-term extraction from a jsonb payload (eql_v3 SEM). +--! @brief CLLW OPE index-term extraction from a jsonb payload ({{prefix}} SEM). --! @brief Extract CLLW OPE index term from JSONB payload --! --! Returns the CLLW OPE ciphertext from the `op` field of an encrypted scalar ---! payload, hex-decoded to the bytea-backed eql_v3_internal.ope_cllw domain. +--! payload, hex-decoded to the bytea-backed {{prefix}}_internal.ope_cllw domain. --! --! Inlinable single-statement SQL — the body is a strict expression of the --! argument (`->>` and `decode` are both STRICT), so the planner folds this --! into the calling query and functional btree indexes built on ---! `eql_v3.ord_term(col)` (which calls this) engage structurally, the +--! `{{prefix}}.ord_term(col)` (which calls this) engage structurally, the --! same way the hmac_256 equality chain does. --! --! **Missing-`op` semantics**: `val ->> 'op'` is NULL when `op` is absent and @@ -20,14 +20,14 @@ --! btree's NULL handling filters those rows from range queries. --! --! @param val jsonb containing encrypted EQL payload ---! @return eql_v3_internal.ope_cllw Hex-decoded CLLW OPE term, or NULL when `op` is +--! @return {{prefix}}_internal.ope_cllw Hex-decoded CLLW OPE term, or NULL when `op` is --! absent -CREATE FUNCTION eql_v3_internal.ope_cllw(val jsonb) - RETURNS eql_v3_internal.ope_cllw +CREATE FUNCTION {{prefix}}_internal.ope_cllw(val jsonb) + RETURNS {{prefix}}_internal.ope_cllw LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT decode(val ->> 'op', 'hex')::eql_v3_internal.ope_cllw + SELECT decode(val ->> 'op', 'hex')::{{prefix}}_internal.ope_cllw $$; -COMMENT ON FUNCTION eql_v3_internal.ope_cllw(jsonb) IS +COMMENT ON FUNCTION {{prefix}}_internal.ope_cllw(jsonb) IS 'eql-inline-critical: raw-jsonb CLLW OPE extractor; must stay inlinable (unpinned search_path)'; diff --git a/packages/eql/src/v3/sem/ope_cllw/types.sql b/packages/eql/src/v3/sem/ope_cllw/types.sql index 6321969fb..b27c193da 100644 --- a/packages/eql/src/v3/sem/ope_cllw/types.sql +++ b/packages/eql/src/v3/sem/ope_cllw/types.sql @@ -1,7 +1,7 @@ -- REQUIRE: src/v3/schema.sql --! @file v3/sem/ope_cllw/types.sql ---! @brief CLLW OPE index term type for scalar range queries (eql_v3 SEM) +--! @brief CLLW OPE index term type for scalar range queries ({{prefix}} SEM) --! --! Domain type representing a CLLW (Copyless Logarithmic Width) --! Order-Preserving Encryption term. The ciphertext is stored hex-encoded in @@ -12,13 +12,13 @@ --! order-preserving under plain byte comparison, so the domain inherits --! bytea's native comparison operators and DEFAULT btree operator class --! outright — no hand-written operators, comparator, or operator class (the ---! same pattern as eql_v3_internal.hmac_256 over text). That keeps the whole +--! same pattern as {{prefix}}_internal.hmac_256 over text). That keeps the whole --! comparison chain inlinable, so a functional btree index on ---! `eql_v3.ord_term(col)` engages structurally for the `_ord` / `_ord_ope` ---! domains' comparison operators. Contrast eql_v3_internal.ore_block_256 (`ob`), +--! `{{prefix}}.ord_term(col)` engages structurally for the `_ord` / `_ord_ope` +--! domains' comparison operators. Contrast {{prefix}}_internal.ore_block_256 (`ob`), --! the block-ORE term behind the `_ord_ore` escape hatch, compared by a custom --! N-block protocol. --! --! @note Transient type used only during query execution. ---! @see eql_v3_internal.ore_block_256 -CREATE DOMAIN eql_v3_internal.ope_cllw AS bytea; +--! @see {{prefix}}_internal.ore_block_256 +CREATE DOMAIN {{prefix}}_internal.ope_cllw AS bytea; diff --git a/packages/eql/src/v3/sem/ore_block_256/functions.sql b/packages/eql/src/v3/sem/ore_block_256/functions.sql index 45f31fdce..1d6108e18 100644 --- a/packages/eql/src/v3/sem/ore_block_256/functions.sql +++ b/packages/eql/src/v3/sem/ore_block_256/functions.sql @@ -4,7 +4,7 @@ -- REQUIRE: src/v3/sem/ore_block_256/types.sql --! @file v3/sem/ore_block_256/functions.sql ---! @brief ORE block construction, extraction, and comparison (eql_v3 SEM). +--! @brief ORE block construction, extraction, and comparison ({{prefix}} SEM). --! --! jsonb-only subset of src/ore_block_u64_8_256/functions.sql. The --! encrypted-column overloads are omitted; the helper jsonb_array_to_bytea_array @@ -16,7 +16,7 @@ --! @brief Convert JSONB array to ORE block composite type --! @internal --! @param val jsonb Array of hex-encoded ORE block terms ---! @return eql_v3_internal.ore_block_256 ORE block composite, or NULL if input is null +--! @return {{prefix}}_internal.ore_block_256 ORE block composite, or NULL if input is null --! @note plpgsql, not `LANGUAGE sql` (issue #353). The sole caller --! (`ore_block_256`) is itself plpgsql, so this function is NEVER reached --! from an inlinable context — as `LANGUAGE sql` it paid the per-call @@ -33,25 +33,25 @@ --! drops out of ordered queries). An empty array instead engages the --! comparator's `cardinality = 0` guard, which sorts empty BEFORE every --! non-empty term. See issue #262 (pinned by T7). -CREATE FUNCTION eql_v3_internal.jsonb_array_to_ore_block_256(val jsonb) -RETURNS eql_v3_internal.ore_block_256 +CREATE FUNCTION {{prefix}}_internal.jsonb_array_to_ore_block_256(val jsonb) +RETURNS {{prefix}}_internal.ore_block_256 IMMUTABLE AS $$ DECLARE - terms eql_v3_internal.ore_block_256_term[]; + terms {{prefix}}_internal.ore_block_256_term[]; BEGIN IF val IS NULL OR jsonb_typeof(val) != 'array' THEN RETURN NULL; END IF; - SELECT array_agg(ROW(b)::eql_v3_internal.ore_block_256_term) + SELECT array_agg(ROW(b)::{{prefix}}_internal.ore_block_256_term) INTO terms - FROM unnest(eql_v3_internal.jsonb_array_to_bytea_array(val)) AS b; + FROM unnest({{prefix}}_internal.jsonb_array_to_bytea_array(val)) AS b; -- plpgsql pitfall: `SELECT INTO ` assigns the -- select-list columns FIELD-WISE into the variable — return the row -- constructor directly instead. The COALESCE stays load-bearing for the -- empty-`ob` case (issue #262): array_agg over zero rows yields NULL, and -- the comparator needs an EMPTY terms array, not NULL terms. - RETURN ROW(COALESCE(terms, ARRAY[]::eql_v3_internal.ore_block_256_term[]))::eql_v3_internal.ore_block_256; + RETURN ROW(COALESCE(terms, ARRAY[]::{{prefix}}_internal.ore_block_256_term[]))::{{prefix}}_internal.ore_block_256; END; $$ LANGUAGE plpgsql; @@ -62,24 +62,24 @@ $$ LANGUAGE plpgsql; --! It takes a bare `jsonb` arg (not a jsonb-backed encrypted DOMAIN), so the --! structural skip in tasks/pin_search_path_v3.sql does not recognise it; --! this marker is the documented manual opt-in. -COMMENT ON FUNCTION eql_v3_internal.jsonb_array_to_ore_block_256(jsonb) IS +COMMENT ON FUNCTION {{prefix}}_internal.jsonb_array_to_ore_block_256(jsonb) IS 'eql-inline-critical: per-encrypted-value ORE opclass-path helper; must stay unpinned (SET search_path adds per-call overhead)'; --! @brief Extract ORE block index term from JSONB payload --! @param val jsonb containing encrypted EQL payload ---! @return eql_v3_internal.ore_block_256 ORE block index term +--! @return {{prefix}}_internal.ore_block_256 ORE block index term --! @throws Exception if 'ob' field is missing -CREATE FUNCTION eql_v3_internal.ore_block_256(val jsonb) - RETURNS eql_v3_internal.ore_block_256 +CREATE FUNCTION {{prefix}}_internal.ore_block_256(val jsonb) + RETURNS {{prefix}}_internal.ore_block_256 IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public AS $$ BEGIN -- Declared STRICT: PostgreSQL returns NULL for a NULL argument without -- entering the body, so no explicit `val IS NULL` guard is needed. - IF eql_v3_internal.has_ore_block_256(val) THEN - RETURN eql_v3_internal.jsonb_array_to_ore_block_256(val->'ob'); + IF {{prefix}}_internal.has_ore_block_256(val) THEN + RETURN {{prefix}}_internal.jsonb_array_to_ore_block_256(val->'ob'); END IF; RAISE 'Expected an ore index (ob) value in json: %', val; END; @@ -97,7 +97,7 @@ $$ LANGUAGE plpgsql; --! previous `val ->> 'ob' IS NOT NULL` form stringified scalars/objects and so --! reported them as present. `{}` (absent `ob`) and `{"ob": null}` (JSON null) --! both remain `false`. -CREATE FUNCTION eql_v3_internal.has_ore_block_256(val jsonb) +CREATE FUNCTION {{prefix}}_internal.has_ore_block_256(val jsonb) RETURNS boolean IMMUTABLE STRICT PARALLEL SAFE SET search_path = pg_catalog, extensions, public @@ -110,8 +110,8 @@ $$ LANGUAGE plpgsql; --! @brief Compare two ORE block terms using cryptographic comparison --! @internal ---! @param a eql_v3_internal.ore_block_256_term First ORE term ---! @param b eql_v3_internal.ore_block_256_term Second ORE term +--! @param a {{prefix}}_internal.ore_block_256_term First ORE term +--! @param b {{prefix}}_internal.ore_block_256_term Second ORE term --! @return integer -1 if a < b, 0 if a = b, 1 if a > b --! @throws Exception if ciphertexts are different lengths --! @note Marked `IMMUTABLE` (the three `compare_ore_block_256_term(s)` @@ -121,7 +121,7 @@ $$ LANGUAGE plpgsql; --! is itself `IMMUTABLE STRICT PARALLEL SAFE` — so `IMMUTABLE` lets the --! planner fold/cache these in ordering and index contexts. NOT `STRICT`: --! the NULL-handling branches below are load-bearing for the array overload. -CREATE FUNCTION eql_v3_internal.compare_ore_block_256_term(a eql_v3_internal.ore_block_256_term, b eql_v3_internal.ore_block_256_term) +CREATE FUNCTION {{prefix}}_internal.compare_ore_block_256_term(a {{prefix}}_internal.ore_block_256_term, b {{prefix}}_internal.ore_block_256_term) RETURNS integer IMMUTABLE SET search_path = pg_catalog, extensions, public @@ -221,10 +221,10 @@ $$ LANGUAGE plpgsql; --! @brief Compare arrays of ORE block terms recursively --! @internal ---! @param a eql_v3_internal.ore_block_256_term[] First array ---! @param b eql_v3_internal.ore_block_256_term[] Second array +--! @param a {{prefix}}_internal.ore_block_256_term[] First array +--! @param b {{prefix}}_internal.ore_block_256_term[] Second array --! @return integer -1/0/1, or NULL if either array is NULL -CREATE FUNCTION eql_v3_internal.compare_ore_block_256_terms(a eql_v3_internal.ore_block_256_term[], b eql_v3_internal.ore_block_256_term[]) +CREATE FUNCTION {{prefix}}_internal.compare_ore_block_256_terms(a {{prefix}}_internal.ore_block_256_term[], b {{prefix}}_internal.ore_block_256_term[]) RETURNS integer IMMUTABLE SET search_path = pg_catalog, extensions, public @@ -248,10 +248,10 @@ AS $$ RETURN 1; END IF; - cmp_result := eql_v3_internal.compare_ore_block_256_term(a[1], b[1]); + cmp_result := {{prefix}}_internal.compare_ore_block_256_term(a[1], b[1]); IF cmp_result = 0 THEN - RETURN eql_v3_internal.compare_ore_block_256_terms(a[2:array_length(a,1)], b[2:array_length(b,1)]); + RETURN {{prefix}}_internal.compare_ore_block_256_terms(a[2:array_length(a,1)], b[2:array_length(b,1)]); END IF; RETURN cmp_result; @@ -261,15 +261,15 @@ $$ LANGUAGE plpgsql; --! @brief Compare ORE block composite types --! @internal ---! @param a eql_v3_internal.ore_block_256 First ORE block ---! @param b eql_v3_internal.ore_block_256 Second ORE block +--! @param a {{prefix}}_internal.ore_block_256 First ORE block +--! @param b {{prefix}}_internal.ore_block_256 Second ORE block --! @return integer -1/0/1 -CREATE FUNCTION eql_v3_internal.compare_ore_block_256_terms(a eql_v3_internal.ore_block_256, b eql_v3_internal.ore_block_256) +CREATE FUNCTION {{prefix}}_internal.compare_ore_block_256_terms(a {{prefix}}_internal.ore_block_256, b {{prefix}}_internal.ore_block_256) RETURNS integer IMMUTABLE SET search_path = pg_catalog, extensions, public AS $$ BEGIN - RETURN eql_v3_internal.compare_ore_block_256_terms(a.terms, b.terms); + RETURN {{prefix}}_internal.compare_ore_block_256_terms(a.terms, b.terms); END $$ LANGUAGE plpgsql; diff --git a/packages/eql/src/v3/sem/ore_block_256/operator_class.sql b/packages/eql/src/v3/sem/ore_block_256/operator_class.sql index 7e56ad383..b889c5cd9 100644 --- a/packages/eql/src/v3/sem/ore_block_256/operator_class.sql +++ b/packages/eql/src/v3/sem/ore_block_256/operator_class.sql @@ -4,10 +4,10 @@ -- REQUIRE: src/v3/sem/ore_block_256/operators.sql --! @file v3/sem/ore_block_256/operator_class.sql ---! @brief B-tree operator family + default class on eql_v3_internal.ore_block_256. +--! @brief B-tree operator family + default class on {{prefix}}_internal.ore_block_256. --! --! Gives the composite type its DEFAULT btree opclass so the recommended ---! functional index `CREATE INDEX ON t (eql_v3.ord_term_ore(col))` engages without +--! functional index `CREATE INDEX ON t ({{prefix}}.ord_term_ore(col))` engages without --! an explicit opclass annotation (design D4). --! --! @note Creating an operator family/class requires superuser: Postgres forbids @@ -16,32 +16,32 @@ --! the installer as a non-superuser role, so the DO block below ATTEMPTS --! the creation and skips it on insufficient_privilege (SQLSTATE 42501), --! letting the single installer run everywhere. When the class is absent, ---! ORE ordered scans over eql_v3_internal.ore_block_256 are unavailable, +--! ORE ordered scans over {{prefix}}_internal.ore_block_256 are unavailable, --! but the order-preserving (OPE) ordering domains — whose extractor --! return types carry a native btree opclass — still index without it. On --! superuser installs (self-managed Postgres, the SQLx test matrix) the --! class is created normally. Any non-privilege error still propagates. ---! @see eql_v3_internal.compare_ore_block_256_terms +--! @see {{prefix}}_internal.compare_ore_block_256_terms DO $do$ BEGIN - EXECUTE 'CREATE OPERATOR FAMILY eql_v3_internal.ore_block_256_operator_family USING btree'; + EXECUTE 'CREATE OPERATOR FAMILY {{prefix}}_internal.ore_block_256_operator_family USING btree'; EXECUTE $ddl$ - CREATE OPERATOR CLASS eql_v3_internal.ore_block_256_operator_class - DEFAULT FOR TYPE eql_v3_internal.ore_block_256 - USING btree FAMILY eql_v3_internal.ore_block_256_operator_family AS + CREATE OPERATOR CLASS {{prefix}}_internal.ore_block_256_operator_class + DEFAULT FOR TYPE {{prefix}}_internal.ore_block_256 + USING btree FAMILY {{prefix}}_internal.ore_block_256_operator_family AS OPERATOR 1 public.<, OPERATOR 2 public.<=, OPERATOR 3 public.=, OPERATOR 4 public.>=, OPERATOR 5 public.>, - FUNCTION 1 eql_v3_internal.compare_ore_block_256_terms(a eql_v3_internal.ore_block_256, b eql_v3_internal.ore_block_256) + FUNCTION 1 {{prefix}}_internal.compare_ore_block_256_terms(a {{prefix}}_internal.ore_block_256, b {{prefix}}_internal.ore_block_256) $ddl$; - RAISE NOTICE 'EQL: created btree operator class eql_v3_internal.ore_block_256_operator_class'; + RAISE NOTICE 'EQL: created btree operator class {{prefix}}_internal.ore_block_256_operator_class'; EXCEPTION WHEN insufficient_privilege THEN - RAISE NOTICE 'EQL: skipped operator class eql_v3_internal.ore_block_256_operator_class (requires superuser); ORE ordered indexes on ore_block_256 unavailable, OPE ordering domains unaffected'; + RAISE NOTICE 'EQL: skipped operator class {{prefix}}_internal.ore_block_256_operator_class (requires superuser); ORE ordered indexes on ore_block_256 unavailable, OPE ordering domains unaffected'; END; $do$; diff --git a/packages/eql/src/v3/sem/ore_block_256/operators.sql b/packages/eql/src/v3/sem/ore_block_256/operators.sql index 7b8b2caac..cdd4c9df3 100644 --- a/packages/eql/src/v3/sem/ore_block_256/operators.sql +++ b/packages/eql/src/v3/sem/ore_block_256/operators.sql @@ -3,105 +3,105 @@ -- REQUIRE: src/v3/sem/ore_block_256/functions.sql --! @file v3/sem/ore_block_256/operators.sql ---! @brief Comparison operators on eql_v3_internal.ore_block_256. +--! @brief Comparison operators on {{prefix}}_internal.ore_block_256. --! --! The six backing functions are inlinable single-statement SQL so the planner ---! can fold the eql_v3 comparison wrappers through to functional-index matching. +--! can fold the {{prefix}} comparison wrappers through to functional-index matching. --! @brief Equality backing function for ORE block types --! @internal --! ---! @param a eql_v3_internal.ore_block_256 Left operand ---! @param b eql_v3_internal.ore_block_256 Right operand +--! @param a {{prefix}}_internal.ore_block_256 Left operand +--! @param b {{prefix}}_internal.ore_block_256 Right operand --! @return boolean True if the ORE blocks are equal --! ---! @see eql_v3_internal.compare_ore_block_256_terms -CREATE FUNCTION eql_v3_internal.ore_block_256_eq(a eql_v3_internal.ore_block_256, b eql_v3_internal.ore_block_256) +--! @see {{prefix}}_internal.compare_ore_block_256_terms +CREATE FUNCTION {{prefix}}_internal.ore_block_256_eq(a {{prefix}}_internal.ore_block_256, b {{prefix}}_internal.ore_block_256) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3_internal.compare_ore_block_256_terms(a, b) = 0 + SELECT {{prefix}}_internal.compare_ore_block_256_terms(a, b) = 0 $$; --! @brief Not-equal backing function for ORE block types --! @internal --! ---! @param a eql_v3_internal.ore_block_256 Left operand ---! @param b eql_v3_internal.ore_block_256 Right operand +--! @param a {{prefix}}_internal.ore_block_256 Left operand +--! @param b {{prefix}}_internal.ore_block_256 Right operand --! @return boolean True if the ORE blocks are not equal --! ---! @see eql_v3_internal.compare_ore_block_256_terms -CREATE FUNCTION eql_v3_internal.ore_block_256_neq(a eql_v3_internal.ore_block_256, b eql_v3_internal.ore_block_256) +--! @see {{prefix}}_internal.compare_ore_block_256_terms +CREATE FUNCTION {{prefix}}_internal.ore_block_256_neq(a {{prefix}}_internal.ore_block_256, b {{prefix}}_internal.ore_block_256) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3_internal.compare_ore_block_256_terms(a, b) <> 0 + SELECT {{prefix}}_internal.compare_ore_block_256_terms(a, b) <> 0 $$; --! @brief Less-than backing function for ORE block types --! @internal --! ---! @param a eql_v3_internal.ore_block_256 Left operand ---! @param b eql_v3_internal.ore_block_256 Right operand +--! @param a {{prefix}}_internal.ore_block_256 Left operand +--! @param b {{prefix}}_internal.ore_block_256 Right operand --! @return boolean True if the left operand is less than the right operand --! ---! @see eql_v3_internal.compare_ore_block_256_terms -CREATE FUNCTION eql_v3_internal.ore_block_256_lt(a eql_v3_internal.ore_block_256, b eql_v3_internal.ore_block_256) +--! @see {{prefix}}_internal.compare_ore_block_256_terms +CREATE FUNCTION {{prefix}}_internal.ore_block_256_lt(a {{prefix}}_internal.ore_block_256, b {{prefix}}_internal.ore_block_256) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3_internal.compare_ore_block_256_terms(a, b) = -1 + SELECT {{prefix}}_internal.compare_ore_block_256_terms(a, b) = -1 $$; --! @brief Less-than-or-equal backing function for ORE block types --! @internal --! ---! @param a eql_v3_internal.ore_block_256 Left operand ---! @param b eql_v3_internal.ore_block_256 Right operand +--! @param a {{prefix}}_internal.ore_block_256 Left operand +--! @param b {{prefix}}_internal.ore_block_256 Right operand --! @return boolean True if the left operand is less than or equal to the right operand --! ---! @see eql_v3_internal.compare_ore_block_256_terms -CREATE FUNCTION eql_v3_internal.ore_block_256_lte(a eql_v3_internal.ore_block_256, b eql_v3_internal.ore_block_256) +--! @see {{prefix}}_internal.compare_ore_block_256_terms +CREATE FUNCTION {{prefix}}_internal.ore_block_256_lte(a {{prefix}}_internal.ore_block_256, b {{prefix}}_internal.ore_block_256) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3_internal.compare_ore_block_256_terms(a, b) != 1 + SELECT {{prefix}}_internal.compare_ore_block_256_terms(a, b) != 1 $$; --! @brief Greater-than backing function for ORE block types --! @internal --! ---! @param a eql_v3_internal.ore_block_256 Left operand ---! @param b eql_v3_internal.ore_block_256 Right operand +--! @param a {{prefix}}_internal.ore_block_256 Left operand +--! @param b {{prefix}}_internal.ore_block_256 Right operand --! @return boolean True if the left operand is greater than the right operand --! ---! @see eql_v3_internal.compare_ore_block_256_terms -CREATE FUNCTION eql_v3_internal.ore_block_256_gt(a eql_v3_internal.ore_block_256, b eql_v3_internal.ore_block_256) +--! @see {{prefix}}_internal.compare_ore_block_256_terms +CREATE FUNCTION {{prefix}}_internal.ore_block_256_gt(a {{prefix}}_internal.ore_block_256, b {{prefix}}_internal.ore_block_256) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3_internal.compare_ore_block_256_terms(a, b) = 1 + SELECT {{prefix}}_internal.compare_ore_block_256_terms(a, b) = 1 $$; --! @brief Greater-than-or-equal backing function for ORE block types --! @internal --! ---! @param a eql_v3_internal.ore_block_256 Left operand ---! @param b eql_v3_internal.ore_block_256 Right operand +--! @param a {{prefix}}_internal.ore_block_256 Left operand +--! @param b {{prefix}}_internal.ore_block_256 Right operand --! @return boolean True if the left operand is greater than or equal to the right operand --! ---! @see eql_v3_internal.compare_ore_block_256_terms -CREATE FUNCTION eql_v3_internal.ore_block_256_gte(a eql_v3_internal.ore_block_256, b eql_v3_internal.ore_block_256) +--! @see {{prefix}}_internal.compare_ore_block_256_terms +CREATE FUNCTION {{prefix}}_internal.ore_block_256_gte(a {{prefix}}_internal.ore_block_256, b {{prefix}}_internal.ore_block_256) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT eql_v3_internal.compare_ore_block_256_terms(a, b) != -1 + SELECT {{prefix}}_internal.compare_ore_block_256_terms(a, b) != -1 $$; @@ -110,11 +110,11 @@ $$; --! COMMUTATOR is the operator itself: equality is symmetric. Required for the --! MERGES flag — without it the planner raises "could not find commutator" the --! first time an ore_block equality is used as a join qual (e.g. via the inlined ---! eql_v3_internal._ord_ore equality wrappers). +--! {{prefix}}_internal._ord_ore equality wrappers). CREATE OPERATOR public.= ( - FUNCTION=eql_v3_internal.ore_block_256_eq, - LEFTARG=eql_v3_internal.ore_block_256, - RIGHTARG=eql_v3_internal.ore_block_256, + FUNCTION={{prefix}}_internal.ore_block_256_eq, + LEFTARG={{prefix}}_internal.ore_block_256, + RIGHTARG={{prefix}}_internal.ore_block_256, COMMUTATOR = OPERATOR(public.=), NEGATOR = OPERATOR(public.<>), RESTRICT = eqsel, @@ -125,9 +125,9 @@ CREATE OPERATOR public.= ( --! @brief <> operator for ORE block types CREATE OPERATOR public.<> ( - FUNCTION=eql_v3_internal.ore_block_256_neq, - LEFTARG=eql_v3_internal.ore_block_256, - RIGHTARG=eql_v3_internal.ore_block_256, + FUNCTION={{prefix}}_internal.ore_block_256_neq, + LEFTARG={{prefix}}_internal.ore_block_256, + RIGHTARG={{prefix}}_internal.ore_block_256, COMMUTATOR = OPERATOR(public.<>), NEGATOR = OPERATOR(public.=), RESTRICT = neqsel, @@ -137,9 +137,9 @@ CREATE OPERATOR public.<> ( --! @brief > operator for ORE block types CREATE OPERATOR public.> ( - FUNCTION=eql_v3_internal.ore_block_256_gt, - LEFTARG=eql_v3_internal.ore_block_256, - RIGHTARG=eql_v3_internal.ore_block_256, + FUNCTION={{prefix}}_internal.ore_block_256_gt, + LEFTARG={{prefix}}_internal.ore_block_256, + RIGHTARG={{prefix}}_internal.ore_block_256, COMMUTATOR = OPERATOR(public.<), NEGATOR = OPERATOR(public.<=), RESTRICT = scalargtsel, @@ -148,9 +148,9 @@ CREATE OPERATOR public.> ( --! @brief < operator for ORE block types CREATE OPERATOR public.< ( - FUNCTION=eql_v3_internal.ore_block_256_lt, - LEFTARG=eql_v3_internal.ore_block_256, - RIGHTARG=eql_v3_internal.ore_block_256, + FUNCTION={{prefix}}_internal.ore_block_256_lt, + LEFTARG={{prefix}}_internal.ore_block_256, + RIGHTARG={{prefix}}_internal.ore_block_256, COMMUTATOR = OPERATOR(public.>), NEGATOR = OPERATOR(public.>=), RESTRICT = scalarltsel, @@ -159,9 +159,9 @@ CREATE OPERATOR public.< ( --! @brief <= operator for ORE block types CREATE OPERATOR public.<= ( - FUNCTION=eql_v3_internal.ore_block_256_lte, - LEFTARG=eql_v3_internal.ore_block_256, - RIGHTARG=eql_v3_internal.ore_block_256, + FUNCTION={{prefix}}_internal.ore_block_256_lte, + LEFTARG={{prefix}}_internal.ore_block_256, + RIGHTARG={{prefix}}_internal.ore_block_256, COMMUTATOR = OPERATOR(public.>=), NEGATOR = OPERATOR(public.>), RESTRICT = scalarlesel, @@ -170,9 +170,9 @@ CREATE OPERATOR public.<= ( --! @brief >= operator for ORE block types CREATE OPERATOR public.>= ( - FUNCTION=eql_v3_internal.ore_block_256_gte, - LEFTARG=eql_v3_internal.ore_block_256, - RIGHTARG=eql_v3_internal.ore_block_256, + FUNCTION={{prefix}}_internal.ore_block_256_gte, + LEFTARG={{prefix}}_internal.ore_block_256, + RIGHTARG={{prefix}}_internal.ore_block_256, COMMUTATOR = OPERATOR(public.<=), NEGATOR = OPERATOR(public.<), RESTRICT = scalargesel, diff --git a/packages/eql/src/v3/sem/ore_block_256/types.sql b/packages/eql/src/v3/sem/ore_block_256/types.sql index 608610238..b697ddaf6 100644 --- a/packages/eql/src/v3/sem/ore_block_256/types.sql +++ b/packages/eql/src/v3/sem/ore_block_256/types.sql @@ -1,16 +1,16 @@ -- REQUIRE: src/v3/schema.sql --! @file v3/sem/ore_block_256/types.sql ---! @brief ORE block index-term types (eql_v3 SEM). +--! @brief ORE block index-term types ({{prefix}} SEM). --! ---! Self-contained eql_v3 copies of the Order-Revealing Encryption block types +--! Self-contained {{prefix}} copies of the Order-Revealing Encryption block types --! (design D1/D3). The eql_v2 originals are unchanged. --! @brief ORE block term type for Order-Revealing Encryption --! --! Composite type representing a single ORE block term. Stores encrypted data --! as bytea that enables range comparisons without decryption. -CREATE TYPE eql_v3_internal.ore_block_256_term AS ( +CREATE TYPE {{prefix}}_internal.ore_block_256_term AS ( bytes bytea ); @@ -21,6 +21,6 @@ CREATE TYPE eql_v3_internal.ore_block_256_term AS ( --! in the 'ob' field of encrypted data payloads. --! --! @note Transient type used only during query execution. -CREATE TYPE eql_v3_internal.ore_block_256 AS ( - terms eql_v3_internal.ore_block_256_term[] +CREATE TYPE {{prefix}}_internal.ore_block_256 AS ( + terms {{prefix}}_internal.ore_block_256_term[] ); diff --git a/packages/eql/src/v3/version.template b/packages/eql/src/v3/version.template index 828635352..bc546f8a9 100644 --- a/packages/eql/src/v3/version.template +++ b/packages/eql/src/v3/version.template @@ -2,10 +2,10 @@ -- Source is src/v3/version.template -- REQUIRE: src/v3/schema.sql -DROP FUNCTION IF EXISTS eql_v3.version(); +DROP FUNCTION IF EXISTS {{prefix}}.version(); --! @file v3/version.sql ---! @brief EQL version reporting (self-contained eql_v3 surface) +--! @brief EQL version reporting (self-contained {{prefix}} surface) --! --! This file is auto-generated from src/v3/version.template during build. --! The $RELEASE_VERSION placeholder is replaced with the actual release @@ -21,9 +21,9 @@ DROP FUNCTION IF EXISTS eql_v3.version(); --! --! @note Auto-generated during build from src/v3/version.template --! ---! Example: `SELECT eql_v3.version()` returns the installed version string, +--! Example: `SELECT {{prefix}}.version()` returns the installed version string, --! e.g. `'3.0.0'` (or `'DEV'` for development builds). -CREATE FUNCTION eql_v3.version() +CREATE FUNCTION {{prefix}}.version() RETURNS text IMMUTABLE STRICT PARALLEL SAFE AS $$ @@ -32,6 +32,6 @@ $$ LANGUAGE SQL; --! @brief Schema-level version marker for obj_description() discoverability --! ---! Mirrors eql_v3.version() as a comment on the schema so the installed ---! version can also be read via obj_description('eql_v3'::regnamespace). -COMMENT ON SCHEMA eql_v3 IS '$RELEASE_VERSION'; +--! Mirrors {{prefix}}.version() as a comment on the schema so the installed +--! version can also be read via obj_description('{{prefix}}'::regnamespace). +COMMENT ON SCHEMA {{prefix}} IS '$RELEASE_VERSION'; diff --git a/packages/eql/tasks/build.sh b/packages/eql/tasks/build.sh index cf8cd28d1..de6edb8a8 100755 --- a/packages/eql/tasks/build.sh +++ b/packages/eql/tasks/build.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash #MISE description="Build SQL into single release file" #MISE alias="b" -#MISE sources=["src/v3/**/*.sql", "src/v3/version.template", "tasks/pin_search_path_v3.sql", "tasks/uninstall-v3.sql", "crates/eql-domains/src/**/*.rs", "crates/eql-codegen/src/**/*.rs", "Cargo.toml", "Cargo.lock", "crates/eql-codegen/Cargo.toml", "crates/eql-domains/Cargo.toml", "tasks/build/ordering.sh", "tasks/test/verify_symbol_order_v3.sh", "tasks/test/verify_installer_complete.sh", "tasks/test/symbol_order_allowlist.txt"] -#MISE outputs=["release/cipherstash-encrypt.sql","release/cipherstash-encrypt-uninstall.sql","src/deps-ordered-v3.txt"] +#MISE sources=["src/v3/**/*.sql", "src/v3/version.template", "tasks/pin_search_path_v3.sql", "tasks/uninstall-v3.sql", "crates/eql-domains/src/**/*.rs", "crates/eql-codegen/src/**/*.rs", "crates/eql-codegen/templates/**", "Cargo.toml", "Cargo.lock", "crates/eql-codegen/Cargo.toml", "crates/eql-domains/Cargo.toml", "tasks/build/ordering.sh", "tasks/test/verify_symbol_order_v3.sh", "tasks/test/verify_installer_complete.sh", "tasks/test/verify_no_v3_in_v4.sh", "tasks/test/symbol_order_allowlist.txt"] +#MISE outputs=["release/cipherstash-encrypt.sql","release/cipherstash-encrypt-uninstall.sql","release/cipherstash-encrypt-v4.sql","release/cipherstash-encrypt-v4-uninstall.sql","src/deps-ordered-v3.txt","build/render/eql_v3/deps-ordered.txt","build/render/eql_v4/deps-ordered.txt"] #USAGE flag "--version " help="Specify release version of EQL" default="DEV" #!/bin/bash @@ -47,6 +47,8 @@ mkdir -p release rm -f release/cipherstash-encrypt.sql rm -f release/cipherstash-encrypt-uninstall.sql +rm -f release/cipherstash-encrypt-v4.sql +rm -f release/cipherstash-encrypt-v4-uninstall.sql rm -f src/deps-ordered-v3.txt src/deps-ordered-v3.txt.tmp rm -f src/v3/version.sql @@ -80,31 +82,90 @@ sed "s/\$RELEASE_VERSION/$RELEASE_VERSION/g" src/v3/version.template > src/v3/ve cargo run -q -p eql-codegen -- order > src/deps-ordered-v3.txt.tmp mv src/deps-ordered-v3.txt.tmp src/deps-ordered-v3.txt -bash tasks/test/verify_symbol_order_v3.sh src/deps-ordered-v3.txt - -: > release/cipherstash-encrypt.sql -while IFS= read -r f; do - strip_require_lines "$f" >> release/cipherstash-encrypt.sql -done < src/deps-ordered-v3.txt -cat tasks/pin_search_path_v3.sql >> release/cipherstash-encrypt.sql - -# `eql-codegen order` guarantees the ORDER contains every file on disk. This gate -# closes the layer below — that the concat loop above actually emitted each ordered -# file's body. 93 of the ~244 v3 files are leaves (required by nothing, defining -# nothing another file references), so dropping one yields an installer that applies -# cleanly and passes the symbol checker while silently shipping less than it should. -bash tasks/test/verify_installer_complete.sh src/deps-ordered-v3.txt release/cipherstash-encrypt.sql - -cat tasks/uninstall-v3.sql >> release/cipherstash-encrypt-uninstall.sql - +# The source names its schemas and payload version by placeholder +# ({{prefix}}, {{eql_version}}; ADR-0002), so it is not installable SQL until it +# is rendered. Render the ordered files, the pin script and the uninstaller once +# per EQL version into build/render/eql_v/ (same relative paths), then run +# the gates and assemble that version's installer from the rendered tree. `eql-codegen render` fails +# on an unknown placeholder and on a literal eql_v3/eql_v4 in the source, and +# writes nothing unless every file renders. +# +# Not every file belongs to every version. A file with a `-- ONLY EQL VERSION: N` +# line belongs to version N alone: today the generated range query domains and +# `between` (query__range_*.sql, ADR-0009 decision 7) are EQL v4 only. +# `eql-codegen select` drops the files that belong to the other version from the +# install order, keeping the order of the rest, and `render` refuses to render a +# file as a version it does not belong to, so nothing confined to v4 can reach +# the v3 installer even if this filter is bypassed. +assemble() { + local version=$1 installer=$2 uninstaller=$3 + local root="build/render/eql_v${version}" + local ordered="$root/deps-ordered.txt" + local selected + + # shellcheck disable=SC2046 # one path per line, none with spaces + selected=$(cargo run -q -p eql-codegen -- select "$version" $(cat src/deps-ordered-v3.txt)) + rm -rf "$root" + # shellcheck disable=SC2086 # one path per line, none with spaces + cargo run -q -p eql-codegen -- render "$version" "$root" \ + $selected tasks/pin_search_path_v3.sql tasks/uninstall-v3.sql + printf '%s\n' "$selected" | sed "s|^|$root/|" > "$ordered" + + # The symbol-order checker parses eql_v3 names. For v3 it reads the rendered + # tree. For v4 it reads a copy of the rendered v4 tree with the names mapped + # back to eql_v3: the renderer guarantees the source names no schema + # literally, so the mapping is exact. Version 4 needs its own run because its + # order holds files version 3's does not (the range surface), and those must + # define before use too. + if [[ "$version" == 3 ]]; then + bash tasks/test/verify_symbol_order_v3.sh "$ordered" + else + # Under build/ (gitignored), so a failed check leaves nothing elsewhere. + local mapped="build/render/symbols-v${version}" + rm -rf "$mapped" + while IFS= read -r f; do + mkdir -p "$mapped/$(dirname "$f")" + sed 's/eql_v4/eql_v3/g' "$f" > "$mapped/$f" + done < "$ordered" + sed "s|^|$mapped/|" "$ordered" > "$mapped/deps-ordered.txt" + bash tasks/test/verify_symbol_order_v3.sh "$mapped/deps-ordered.txt" + rm -rf "$mapped" + fi + + : > "$installer" + while IFS= read -r f; do + strip_require_lines "$f" >> "$installer" + done < "$ordered" + cat "$root/tasks/pin_search_path_v3.sql" >> "$installer" + + # `eql-codegen order` guarantees the ORDER contains every file on disk. This + # gate closes the layer below — that the concat loop above actually emitted + # each ordered file's body. 93 of the ~244 v3 files are leaves (required by + # nothing, defining nothing another file references), so dropping one yields + # an installer that applies cleanly and passes the symbol checker while + # silently shipping less than it should. + bash tasks/test/verify_installer_complete.sh "$ordered" "$installer" "$root" + + cat "$root/tasks/uninstall-v3.sql" > "$uninstaller" +} + +assemble 3 release/cipherstash-encrypt.sql release/cipherstash-encrypt-uninstall.sql +assemble 4 release/cipherstash-encrypt-v4.sql release/cipherstash-encrypt-v4-uninstall.sql + +# Nothing in the v4 bundle may name v3: a stray eql_v3 reference would install +# cleanly and then compare v4 data with v3 terms. The renderer already rejects +# literal names in the source; this checks the artefact itself. +bash tasks/test/verify_no_v3_in_v4.sh release/cipherstash-encrypt-v4.sql release/cipherstash-encrypt-v4-uninstall.sql echo echo '###############################################' echo "# ✅Build succeeded" echo '###############################################' echo -echo 'Installer:' -echo ' release/cipherstash-encrypt.sql' +echo 'Installers:' +echo ' release/cipherstash-encrypt.sql (eql_v3)' +echo ' release/cipherstash-encrypt-v4.sql (eql_v4)' echo -echo 'Uninstaller:' +echo 'Uninstallers:' echo ' release/cipherstash-encrypt-uninstall.sql' +echo ' release/cipherstash-encrypt-v4-uninstall.sql' diff --git a/packages/eql/tasks/docs/doxygen-filter.sh b/packages/eql/tasks/docs/doxygen-filter.sh index fe00c19ab..7ccfdf735 100755 --- a/packages/eql/tasks/docs/doxygen-filter.sh +++ b/packages/eql/tasks/docs/doxygen-filter.sh @@ -10,8 +10,18 @@ if [ "$#" -ne 1 ]; then exit 2 fi -# Prepares SQL for Doxygen's C++ parser. Four transforms: +# Prepares SQL for Doxygen's C++ parser. Five transforms: # +# 0. Read the RENDERED source. The SQL source names its schemas by +# placeholder ({{prefix}}, {{eql_version}}; ADR-0002), and `mise run build` +# renders it as EQL v3 into build/render/eql_v3/ with `eql-codegen render`, +# keeping relative paths. A file under src/ or tasks/ is read from there +# (or, for a file confined to one version, from that version's tree), +# so the reference names `eql_v3.eq_term`, and the renderer stays the one +# place placeholders are substituted. `docs:generate` and this filter's +# other callers depend on `build`; a missing rendered copy is an error, not +# a fallback. Any other file (a test fixture) is read as given, and any +# `{{` in what is read is refused. # 1. Omit blocks marked `@cond deprecated_compatibility`. These functions # remain callable for backwards compatibility but must not appear in the # generated function reference or source browser. @@ -41,7 +51,34 @@ fi # # Reducing each to a single `CREATE AGGREGATE name(argtype);` declaration # recovers the name in both cases and leaves a clean argument list. -awk ' + +EQL_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" +# Doxygen passes absolute paths, docs_v3_grep.sh a relative one. Resolving the +# directory also fails the filter (set -e) on a path that does not exist, and +# docs_v3_grep.sh relies on that status. +abs="$(cd "$(dirname "$1")" && pwd)/$(basename "$1")" +rel="${abs#"$EQL_ROOT/"}" +input="$1" +case "$rel" in + src/* | tasks/*) + # A file confined to one EQL version (`-- ONLY EQL VERSION: N`, e.g. the + # v4-only range surface) is rendered for that version alone, so read that + # version's copy; it documents names that exist (eql_v4.between), not v3 + # names that do not. + only=$(sed -n 's/^-- ONLY EQL VERSION: \([0-9][0-9]*\)[[:space:]]*$/\1/p' "$abs" | head -n 1) + input="$EQL_ROOT/build/render/eql_v${only:-3}/$rel" + if [[ ! -f "$input" ]]; then + echo "$1: no rendered copy at $input; run 'mise run build' first" >&2 + exit 1 + fi + ;; +esac + +awk -v src="$1" ' + index($0, "{{") { + printf "%s:%d: unrendered placeholder (expected {{prefix}} or {{eql_version}})\n", src, NR > "/dev/stderr" + exit 1 + } /^--![[:space:]]+@cond[[:space:]]+deprecated_compatibility[[:space:]]*$/ { inhidden = 1 print "" @@ -102,4 +139,4 @@ awk ' gsub(/--/, "//", out) print out } -' "$1" +' "$input" diff --git a/packages/eql/tasks/docs/validate/documented-sql.sh b/packages/eql/tasks/docs/validate/documented-sql.sh index 9ce3fb348..59db73422 100755 --- a/packages/eql/tasks/docs/validate/documented-sql.sh +++ b/packages/eql/tasks/docs/validate/documented-sql.sh @@ -10,7 +10,24 @@ PGPORT=${PGPORT:-7432} PGUSER=${PGUSER:-cipherstash} PGPASSWORD=${PGPASSWORD:-password} PGDATABASE=${PGDATABASE:-postgres} -source_directory="src" +# The rendered eql_v3 tree, not src/: the source writes its schemas and payload +# version as {{prefix}} / {{eql_version}} placeholders (ADR-0002), which psql +# cannot parse. `mise run build` renders it. +source_directory="build/render/eql_v3/src" +# Files confined to EQL v4 (`-- ONLY EQL VERSION: 4`: the range query domains +# and eql_v4.between) are rendered only into the eql_v4 tree, so they are read +# from there: every file of the v4 tree with no counterpart in the v3 tree. The +# other v4 files are the v3 ones under another name, already validated above. +# +# They are not run in isolation like the v3 files. Every statement in them +# needs the eql_v4 schema and the domains they range over, so in isolation +# their first statement fails with "does not exist", which the loop below +# counts as a dependency error, and nothing after it is ever parsed. Instead +# the whole v4 install order runs in one transaction that is rolled back, +# so each confined file runs after what it requires and every statement in +# it is executed, and any error fails the task. +v4_directory="build/render/eql_v4/src" +v4_order="build/render/eql_v4/deps-ordered.txt" echo "Validating SQL syntax for all documented files..." echo "" @@ -25,8 +42,21 @@ echo "" errors=0 validated=0 -if [ ! -d $source_directory ]; then - echo "error: source directory does not exist: ${source_directory}" +for dir in "$source_directory" "$v4_directory"; do + if [ ! -d "$dir" ]; then + echo "error: source directory does not exist: ${dir}" + exit 2 + fi +done + +v4_only=() +while IFS= read -r file; do + if [ ! -f "$source_directory/${file#"$v4_directory"/}" ]; then + v4_only+=("$file") + fi +done < <(find "$v4_directory" -name "*.sql" -not -name "*_test.sql" | sort) +if [ ${#v4_only[@]} -eq 0 ]; then + echo "error: found no file confined to EQL v4 under ${v4_directory}; expected the range surface" exit 2 fi @@ -57,6 +87,38 @@ for file in $(find $source_directory -name "*.sql" -not -name "*_test.sql" | sor exit_code=0 done +echo "" +echo "Validating the ${#v4_only[@]} files confined to EQL v4, in the v4 install order..." +if [ ! -f "$v4_order" ]; then + echo "error: the v4 install order does not exist: ${v4_order}" + exit 2 +fi +for file in "${v4_only[@]}"; do + if ! grep -qxF "$file" "$v4_order"; then + echo "error: ${file} is not in the v4 install order ${v4_order}" + exit 2 + fi +done +v4_script=$(mktemp) +trap 'rm -f "$v4_script"' EXIT +{ + echo 'BEGIN;' + while IFS= read -r f; do + printf '\\i %s\n' "$f" + done < "$v4_order" + echo 'ROLLBACK;' +} > "$v4_script" +if v4_output=$(PGPASSWORD="$PGPASSWORD" psql -h "$PGHOST" -p "$PGPORT" -U "$PGUSER" -d "$PGDATABASE" \ + -f "$v4_script" --set ON_ERROR_STOP=1 -q 2>&1); then + echo "✓ the v4 install order, rolled back" + validated=$((validated + ${#v4_only[@]})) +else + echo "✗ the v4 install order failed" + echo "$v4_output" | grep -v '^NOTICE' | tail -10 | sed 's/^/ /' + echo "" + errors=$((errors + ${#v4_only[@]})) +fi + echo "" echo "Validation complete:" echo " Validated: $validated" diff --git a/packages/eql/tasks/githooks/pre-commit b/packages/eql/tasks/githooks/pre-commit index 871925e5d..15c4171f4 100755 --- a/packages/eql/tasks/githooks/pre-commit +++ b/packages/eql/tasks/githooks/pre-commit @@ -13,9 +13,26 @@ # Unrelated commits skip the gate entirely, so this is a no-op for most commits. set -euo pipefail -staged=$(git diff --cached --name-only --diff-filter=ACMRD) +# Git runs a hook from the root of the working tree. In cipherstash/stack that +# is the monorepo root, not this package, so the staged paths carry a +# `packages/eql/` prefix the patterns below would never match, and `mise run` +# would not find this package's tasks. List only the staged paths under this +# package, relative to it, then work from the package root. +# +# The prefix is worked out from paths, not with `cd` and `git diff --relative`: +# git exports GIT_DIR to a hook, and with GIT_DIR set and no GIT_WORK_TREE, git +# takes the current directory as the top of the working tree, so after a `cd` +# `--relative` strips nothing. +package=$(cd "$(dirname "$0")/../.." && pwd -P) +top=$(cd "$(git rev-parse --show-toplevel)" && pwd -P) +relative=() +if [ "$package" != "$top" ]; then + relative=("--relative=${package#"$top"/}/") +fi +staged=$(git diff --cached --name-only "${relative[@]}" --diff-filter=ACMRD) +cd "$package" -if echo "$staged" | grep -Eq '^(crates/eql-domains/|crates/eql-codegen/|src/v3/scalars/|crates/eql-bindings/src/v3/|crates/eql-bindings/bindings/|crates/eql-bindings/schema/)'; then +if echo "$staged" | grep -Eq '^(crates/eql-domains/|crates/eql-codegen/|src/v3/scalars/|crates/eql-bindings/src/v3/|crates/eql-bindings/src/v4/|crates/eql-bindings/bindings/|crates/eql-bindings/schema/)'; then echo "pre-commit: catalog/generator/generated surface touched — verifying freshness…" mise run codegen:parity mise run types:check diff --git a/packages/eql/tasks/pin_search_path_v3.sql b/packages/eql/tasks/pin_search_path_v3.sql index 9718b161b..8b5576617 100644 --- a/packages/eql/tasks/pin_search_path_v3.sql +++ b/packages/eql/tasks/pin_search_path_v3.sql @@ -1,11 +1,13 @@ --! @file pin_search_path_v3.sql ---! @brief Post-install: pin search_path on every eql_v3.* function. +--! @brief Post-install: pin search_path on every {{prefix}}.* function. --! ---! Appended verbatim by `tasks/build.sh` to the end of the v3-only release ---! artifact, AFTER all src/v3/**/*.sql files have been concatenated. It lives ---! outside src/ so it stays out of the dependency graph. +--! Rendered by `tasks/build.sh` like the src/ files, so it uses the +--! placeholders and may not name a schema literally, then appended to the end +--! of the v{{eql_version}}-only release artifact, AFTER all src/v3/**/*.sql +--! files have been concatenated. It lives outside src/ so it stays out of the +--! dependency graph. --! ---! Iterates over functions in the `eql_v3` and `eql_v3_internal` schemas and +--! Iterates over functions in the `{{prefix}}` and `{{prefix}}_internal` schemas and --! applies a fixed `search_path` via `ALTER FUNCTION ... SET search_path = ...`, --! satisfying Supabase splinter's `function_search_path_mutable` lint. --! @@ -32,19 +34,19 @@ BEGIN RAISE EXCEPTION 'pin_search_path_v3: type pg_catalog.jsonb not found'; END IF; - -- eql_v3 SEM index-term functions that must stay inlinable for - -- functional-index matching (no SET, IMMUTABLE). Mirrors the eql_v3 clause + -- {{prefix}} SEM index-term functions that must stay inlinable for + -- functional-index matching (no SET, IMMUTABLE). Mirrors the {{prefix}} clause -- in the legacy combined pin_search_path.sql. SELECT pg_catalog.array_agg(p.oid) INTO inline_critical_oids FROM pg_catalog.pg_proc p JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace - WHERE n.nspname = ANY(eql_v3_internal.owned_schemas()) + WHERE n.nspname = ANY({{prefix}}_internal.owned_schemas()) AND ( (p.pronargs = 2 AND p.proname IN ('ore_block_256_eq', 'ore_block_256_neq', 'ore_block_256_lt', 'ore_block_256_lte', 'ore_block_256_gt', 'ore_block_256_gte')) - -- The CLLW-OPE surface is the extractor alone: eql_v3_internal.ope_cllw is a + -- The CLLW-OPE surface is the extractor alone: {{prefix}}_internal.ope_cllw is a -- domain over bytea (native comparison operators and btree opclass), -- so there are no ope-specific comparison functions to keep inlinable. OR (p.pronargs = 1 @@ -62,7 +64,7 @@ BEGIN SELECT p.oid FROM pg_catalog.pg_proc p JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace - WHERE n.nspname = ANY(eql_v3_internal.owned_schemas()) + WHERE n.nspname = ANY({{prefix}}_internal.owned_schemas()) AND p.prokind IN ('f', 'w') AND NOT EXISTS ( SELECT 1 FROM pg_catalog.unnest(coalesce(p.proconfig, '{}'::text[])) c @@ -86,7 +88,7 @@ BEGIN AND dt.typbasetype = jsonb_oid AND ( dn.nspname = 'public' - OR dn.nspname = ANY(eql_v3_internal.owned_schemas()) + OR dn.nspname = ANY({{prefix}}_internal.owned_schemas()) ) ) ) diff --git a/packages/eql/tasks/schemas-parity.sh b/packages/eql/tasks/schemas-parity.sh index d55691908..ea2c4d5e2 100755 --- a/packages/eql/tasks/schemas-parity.sh +++ b/packages/eql/tasks/schemas-parity.sh @@ -14,26 +14,31 @@ cd "$REPO_ROOT" # scans across. # This gate is DB-free: it compares the two source-of-truth declarations # directly, so a hand-edit to one side without the other fails CI before any -# Postgres install. The installed-DB copy is separately pinned by +# Postgres install. Both are placeholder source ({{prefix}}), so both sides are +# rendered as EQL v3 with the build's own renderer and compared by real name. The installed-DB copy is separately pinned by # `owned_schemas_returns_exactly_the_two_v3_schemas` in tests/sqlx. -SCHEMA_SQL="src/v3/schema.sql" +SCHEMA_SRC="src/v3/schema.sql" +work=$(mktemp -d) +trap 'rm -rf "$work"' EXIT +cargo run -q -p eql-codegen -- render 3 "$work" "$SCHEMA_SRC" +SCHEMA_SQL="$work/$SCHEMA_SRC" # Pull the ARRAY['eql_v3', 'eql_v3_internal']::name[] literal from the # owned_schemas() body and extract its single-quoted tokens, in order. array_literal=$(grep -oE "ARRAY\[[^]]*\]::name\[\]" "$SCHEMA_SQL" | head -1 || true) if [ -z "$array_literal" ]; then - echo "ERROR: could not find the ARRAY[...]::name[] literal in $SCHEMA_SQL" >&2 + echo "ERROR: could not find the ARRAY[...]::name[] literal in $SCHEMA_SRC" >&2 echo " (eql_v3_internal.owned_schemas() body changed shape?)" >&2 exit 1 fi sql_schemas=$(printf '%s\n' "$array_literal" | grep -oE "'[^']*'" | tr -d "'") -rust_schemas=$(cargo run -q -p eql-codegen -- list-schemas) +rust_schemas=$(cargo run -q -p eql-codegen -- list-schemas 3) if [ "$sql_schemas" != "$rust_schemas" ]; then echo "SCHEMA DRIFT: SQL owned_schemas() and Rust codegen consts disagree." >&2 - echo " SQL ($SCHEMA_SQL, eql_v3_internal.owned_schemas()):" >&2 + echo " SQL ($SCHEMA_SRC rendered as v3, eql_v3_internal.owned_schemas()):" >&2 printf ' %s\n' $sql_schemas >&2 echo " Rust (eql-codegen list-schemas / consts.rs SCHEMA,INTERNAL_SCHEMA):" >&2 printf ' %s\n' $rust_schemas >&2 diff --git a/packages/eql/tasks/test/docs_v3_grep.sh b/packages/eql/tasks/test/docs_v3_grep.sh index 14cc27c67..f73fdd44a 100755 --- a/packages/eql/tasks/test/docs_v3_grep.sh +++ b/packages/eql/tasks/test/docs_v3_grep.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash #MISE description="Fail if any user-facing doc still references the removed eql_v2 surface" +# The Doxygen half reads the rendered SQL (build/render/eql_v3/), so build first. +#MISE depends=["build"] set -euo pipefail @@ -64,9 +66,16 @@ done # Deprecated SQL compatibility aliases remain installed, but the explicitly # hidden block must never reach Doxygen — including its generated source browser. -ste_vec_alias_count=$(grep -c '^CREATE FUNCTION eql_v3\.ste_vec_contains' src/v3/json/functions.sql || true) +# Count them in the RENDERED file, the one the Doxygen filter reads, so the +# count does not depend on how the source spells its placeholders. +rendered_functions=build/render/eql_v3/src/v3/json/functions.sql +if [ ! -f "$rendered_functions" ]; then + echo "ERROR: $rendered_functions missing; run 'mise run build' first" >&2 + exit 2 +fi +ste_vec_alias_count=$(grep -c '^CREATE FUNCTION eql_v3\.ste_vec_contains' "$rendered_functions" || true) if [ "$ste_vec_alias_count" -ne 2 ]; then - echo "FAIL: expected both deprecated ste_vec_contains overloads in src/v3/json/functions.sql" >&2 + echo "FAIL: expected both deprecated ste_vec_contains overloads in $rendered_functions" >&2 status=1 else # CAPTURE, THEN MATCH — never `doxygen-filter.sh ... | grep -q ...`. `grep -q` diff --git a/packages/eql/tasks/test/v4_isolation_selftest.sh b/packages/eql/tasks/test/v4_isolation_selftest.sh new file mode 100755 index 000000000..74e7025ff --- /dev/null +++ b/packages/eql/tasks/test/v4_isolation_selftest.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash +#MISE description="DB-free self-test for the v4 isolation gate (clean passes, small and wholesale leaks fail)" +set -euo pipefail +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" +cd "$REPO_ROOT" +tmp="$(mktemp -d)"; trap 'rm -rf "$tmp"' EXIT + +# Run the gate on one case and require an exact exit status. The gate exits 1 +# on a leak and 2 on bad input or a fault, so "non-zero" would let a crashed +# gate pass every rejection case. +expect() { + local want=$1 what=$2 file=$3 rc=0 + bash tasks/test/verify_no_v3_in_v4.sh "$file" >/dev/null 2>&1 || rc=$? + if [[ $rc -ne $want ]]; then + echo "FAIL: $what: gate exited $rc, expected $want" + exit 1 + fi + echo "ok: $what (exit $rc)" +} + +# CLEAN: names eql_v4, checks version 4, names nothing from v3. +printf "CREATE SCHEMA eql_v4;\nCHECK (VALUE->>'v' = '4');\nSELECT jsonb_build_object('v', val->'v');\n" > "$tmp/clean.sql" +expect 0 "clean v4 bundle accepted" "$tmp/clean.sql" + +# ONE stray reference. +printf "CREATE SCHEMA eql_v4;\nSELECT eql_v3.eq_term(x);\n" > "$tmp/one.sql" +expect 1 "one eql_v3 reference rejected" "$tmp/one.sql" + +# WHOLESALE leak: far more matching lines than a pipe buffer holds. A +# `grep | head` check under pipefail read this as no leak (SIGPIPE). +{ + echo "CREATE SCHEMA eql_v4;" + for i in $(seq 1 20000); do echo "SELECT eql_v3_internal.f$i(eql_v4.g());"; done +} > "$tmp/wholesale.sql" +expect 1 "wholesale eql_v3 leak rejected" "$tmp/wholesale.sql" + +# The version check, wholesale too. +{ + echo "CREATE SCHEMA eql_v4;" + for i in $(seq 1 20000); do echo "CHECK (VALUE->>'v' = '3');"; done +} > "$tmp/version.sql" +expect 1 "wholesale version-3 checks rejected" "$tmp/version.sql" + +# Other spellings of a version check that is not v4's. The gate accepts only +# `->> 'v' = '4'`, so each of these is refused without being listed there. +n=0 +for check in \ + "VALUE->>'v' IN ('3')" \ + "'3' = VALUE->>'v'" \ + "(VALUE->>'v')::int = 3" \ + "VALUE->>'v' = '40'" \ + "(VALUE->'v') = '3'::jsonb" \ + "'3'::jsonb = VALUE->'v'"; do + n=$((n + 1)) + printf "CREATE SCHEMA eql_v4;\nCHECK (%s);\n" "$check" > "$tmp/spelling$n.sql" + expect 1 "version check rejected: $check" "$tmp/spelling$n.sql" +done + +# NON-VACUITY: a file that never names eql_v4 is not a v4 render. +printf "SELECT 1;\n" > "$tmp/none.sql" +expect 1 "non-v4 render rejected" "$tmp/none.sql" + +# BAD INPUT is a fault, not a leak. +expect 2 "missing file is bad input" "$tmp/does-not-exist.sql" +: > "$tmp/empty.sql" +expect 2 "empty file is bad input" "$tmp/empty.sql" diff --git a/packages/eql/tasks/test/verify_installer_complete.sh b/packages/eql/tasks/test/verify_installer_complete.sh index 7f0263ef8..65cf6cfa6 100755 --- a/packages/eql/tasks/test/verify_installer_complete.sh +++ b/packages/eql/tasks/test/verify_installer_complete.sh @@ -24,9 +24,23 @@ set -euo pipefail REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" cd "$REPO_ROOT" -ORDERED="${1:-src/deps-ordered-v3.txt}" +ORDERED="${1:-build/render/eql_v3/deps-ordered.txt}" INSTALLER="${2:-release/cipherstash-encrypt.sql}" -PIN="tasks/pin_search_path_v3.sql" +# The rendered tree the ordered paths point into (build.sh renders the +# placeholder source into build/render/eql_v/, keeping relative paths, and +# writes deps-ordered.txt at its root). Defaults to the order file's directory, +# so overriding only $1 cannot pair one tree's order with another's files. +ROOT="${3:-$(dirname "$ORDERED")}" +PIN="$ROOT/tasks/pin_search_path_v3.sql" +# The EQL version the installer is for: the N of the rendered tree's +# build/render/eql_v name. A file confined to another version by a +# `-- ONLY EQL VERSION: M` line is not part of this installer. +if [[ "$(basename "$ROOT")" =~ ^eql_v([0-9]+)$ ]]; then + VERSION="${BASH_REMATCH[1]}" +else + echo "ERROR: cannot tell the EQL version from the rendered tree $ROOT (expected .../eql_v)" >&2 + exit 2 +fi for f in "$ORDERED" "$INSTALLER" "$PIN"; do if [[ ! -f "$f" ]]; then @@ -73,7 +87,22 @@ fail=0 echo "==> Non-vacuity gate: the order names every src/v3 SQL file" work="$(mktemp -d)" trap 'rm -rf "$work"' EXIT -find src/v3 -type f -name '*.sql' ! -name '*_test.sql' | LC_ALL=C sort > "$work/disk" +# The disk side reads the SOURCE tree, not the rendered one: build.sh renders +# exactly the files the order names, so the rendered tree always agrees with the +# order and a comparison against it could never fail. Map the source paths into +# the rendered namespace the order uses. +# +# A file confined to another version (`-- ONLY EQL VERSION: M`, M != $VERSION) +# belongs to that version's installer, not this one. The test is a grep here, +# not `eql-codegen select`, which build.sh filtered the order with: the two must +# agree independently for this gate to mean anything. +find src/v3 -type f -name '*.sql' ! -name '*_test.sql' | LC_ALL=C sort > "$work/all" +while IFS= read -r f; do + only=$(sed -n 's/^-- ONLY EQL VERSION: \([0-9][0-9]*\)[[:space:]]*$/\1/p' "$f") + if [[ -z "$only" || "$only" == "$VERSION" ]]; then + printf '%s/%s\n' "$ROOT" "$f" + fi +done < "$work/all" > "$work/disk" grep -v '^[[:space:]]*$' "$ORDERED" | LC_ALL=C sort > "$work/order" || true n_disk=$(count_lines "$work/disk") diff --git a/packages/eql/tasks/test/verify_no_v3_in_v4.sh b/packages/eql/tasks/test/verify_no_v3_in_v4.sh new file mode 100755 index 000000000..a9f255218 --- /dev/null +++ b/packages/eql/tasks/test/verify_no_v3_in_v4.sh @@ -0,0 +1,88 @@ +#!/usr/bin/env bash +#MISE description="Assert the eql_v4 installer and uninstaller name nothing from eql_v3 (DB-free)" +# +# ADR-0002 installs one SQL source under two names, so a column's domain says +# which engine produced its terms. That holds only while the v4 bundle is v3's +# SQL with EVERY name and version changed, plus the files confined to v4 by +# `-- ONLY EQL VERSION: 4`, which name only v4. A stray eql_v3 reference installs +# cleanly and then quietly compares v4 data with v3 terms, or casts a v4 payload +# to a v3 domain. +# +# `eql-codegen render` already refuses a literal eql_v3 in the source. This +# checks the built artefact, so it also catches a build step that splices text +# in around the renderer. +# +# Usage: verify_no_v3_in_v4.sh [file...] (exit 1 on a leak, 2 on bad input) +# With no arguments it checks the v4 installer and uninstaller in release/. + +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" +cd "$REPO_ROOT" + +if [[ $# -eq 0 ]]; then + set -- release/cipherstash-encrypt-v4.sql release/cipherstash-encrypt-v4-uninstall.sql +fi + +# Capture matches before printing them. `grep | head -5` under pipefail is +# false whenever grep has more output than the pipe holds: head exits, grep +# dies of SIGPIPE, and a wholesale leak read as no leak at all. +report() { + local f=$1 what=$2 hits=$3 + sed -n "1,5s|^|$f:|p" <<<"$hits" + echo "ERROR: $f $what (first 5 shown)" >&2 + fail=1 +} + +# grep into $hits, telling "no match" (1) from a fault (2 or more). A fault is +# bad input, not a clean file, so it ends the gate with 2. +find_lines() { + local rc=0 + hits=$(grep "$@") || rc=$? + if [[ $rc -gt 1 ]]; then + echo "ERROR: grep exited $rc on ${*: -1}" >&2 + exit 2 + fi + return "$rc" +} + +# A v4 payload-version check, and the only form one may take: the text read +# compared with '4'. Anything else that reads 'v' as text (another version, +# IN (...), a cast, the operands swapped) is refused, so the gate does not +# depend on guessing every way a v3 check could be spelt. +V4_CHECK="->>[[:space:]]*'v'[[:space:]]*=[[:space:]]*'4'([^0-9]|$)" +TEXT_READ="->>[[:space:]]*'v'" +# A jsonb read of 'v' (`->`, not `->>`) on a line that compares something. +JSONB_COMPARE="->[[:space:]]*'v'.*(=|<>|[[:space:]][Ii][Nn][[:space:]]*\\()|(=|<>).*->[[:space:]]*'v'" + +fail=0 +for f in "$@"; do + if [[ ! -s "$f" ]]; then + echo "ERROR: $f missing or empty — run 'mise run build' first" >&2 + exit 2 + fi + # Non-vacuity: a v4 bundle that never names eql_v4 was not rendered as v4. + if ! find_lines -n 'eql_v4' "$f"; then + echo "ERROR: $f never names eql_v4 — not a v4 render" >&2 + fail=1 + fi + if find_lines -n 'eql_v3' "$f"; then + report "$f" "names eql_v3" "$hits" + fi + # The domain CHECKs compare the payload version. Any check that is not + # `->> 'v' = '4'` could admit v3 payloads into v4 columns. + if find_lines -nE -e "$TEXT_READ" "$f"; then + if bad=$(grep -vE -e "$V4_CHECK" <<<"$hits"); then + report "$f" "reads the payload version other than as ->> 'v' = '4'" "$bad" + fi + fi + if find_lines -nE -e "$JSONB_COMPARE" "$f"; then + report "$f" "compares the payload version as jsonb" "$hits" + fi +done + +if [[ $fail -ne 0 ]]; then + echo "v4 isolation gate FAILED" >&2 + exit 1 +fi +echo "v4 isolation gate OK ($# files)" diff --git a/packages/eql/tasks/test/verify_symbol_order_v3.sh b/packages/eql/tasks/test/verify_symbol_order_v3.sh index 1d859d527..58bfff08f 100755 --- a/packages/eql/tasks/test/verify_symbol_order_v3.sh +++ b/packages/eql/tasks/test/verify_symbol_order_v3.sh @@ -56,7 +56,7 @@ set -euo pipefail REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" cd "$REPO_ROOT" -ORDERED="${1:-src/deps-ordered-v3.txt}" +ORDERED="${1:-build/render/eql_v3/deps-ordered.txt}" # Overridable so the self-test can exercise the missing-allowlist path without # disturbing the committed one. ALLOW="${SYMBOL_ORDER_ALLOWLIST:-tasks/test/symbol_order_allowlist.txt}" diff --git a/packages/eql/tasks/uninstall-v3.sql b/packages/eql/tasks/uninstall-v3.sql index 7c9dd57f1..d1cfb7248 100644 --- a/packages/eql/tasks/uninstall-v3.sql +++ b/packages/eql/tasks/uninstall-v3.sql @@ -1,8 +1,8 @@ --- Uninstall the standalone eql_v3 surface. CASCADE removes the domains, SEM --- types, operators, opclass, and any columns typed with the eql_v3 domains. -DROP SCHEMA IF EXISTS eql_v3 CASCADE; +-- Uninstall the standalone {{prefix}} surface. CASCADE removes the domains, SEM +-- types, operators, opclass, and any columns typed with the {{prefix}} domains. +DROP SCHEMA IF EXISTS {{prefix}} CASCADE; --- Drop the internal implementation schema after eql_v3 (eql_v3's extractors and --- operators depend on eql_v3_internal types; dropping eql_v3 first with CASCADE --- removes those dependents, then eql_v3_internal drops cleanly). -DROP SCHEMA IF EXISTS eql_v3_internal CASCADE; +-- Drop the internal implementation schema after {{prefix}} ({{prefix}}'s extractors and +-- operators depend on {{prefix}}_internal types; dropping {{prefix}} first with CASCADE +-- removes those dependents, then {{prefix}}_internal drops cleanly). +DROP SCHEMA IF EXISTS {{prefix}}_internal CASCADE; diff --git a/packages/eql/tests/encryption/Cargo.toml b/packages/eql/tests/encryption/Cargo.toml index c3591362f..7030eead1 100644 --- a/packages/eql/tests/encryption/Cargo.toml +++ b/packages/eql/tests/encryption/Cargo.toml @@ -13,14 +13,21 @@ harness = false # Keep crypto/Postgres test dependencies out of eql-bindings' default test build. [dev-dependencies] -eql-bindings = { path = "../../crates/eql-bindings", features = ["stack-encrypt"] } +# `chrono` and `rust_decimal`: the date, timestamp and decimal plaintexts +# convert from those crates' values, which build the test values here. +eql-bindings = { path = "../../crates/eql-bindings", features = ["targets", "chrono", "rust_decimal"] } # The parity oracle for the generated target table (tests/targets.rs): the # table must name every stored catalog domain, in catalog order. eql-domains = { path = "../../crates/eql-domains" } -stack-encrypt = { path = "../../../stack-encrypt", default-features = false } -# `FfiValue`: the runtime plaintext the target dispatch takes. The same line -# eql-bindings names. -vitaminc-aead-value = "0.5.1" +# `dynamic`: `ValueFrame`, the runtime plaintext the target dispatch takes, +# as eql-bindings names it. +stack-encrypt = { path = "../../../stack-encrypt", default-features = false, features = ["dynamic"] } +# `plaintext::Sink`, for a plaintext type with its own `Encrypt` impl; and +# chrono's and rust_decimal's own sources, which seal the leaf a date, +# timestamp or decimal from any other producer seals. +vitaminc-aead = { version = "0.6.0", features = ["chrono", "rust_decimal"] } +chrono = { version = "0.4.44", default-features = false, features = ["std"] } +rust_decimal = { version = "1", default-features = false, features = ["std"] } stack-kms = { path = "../../../stack-kms", default-features = false, features = ["test-support"] } serde = "1" serde_json = "1" @@ -39,6 +46,11 @@ postgres = "0.19" # (and tests/sqlx's) with it, and the pin then covers the versions of those two # crates protect-ffi ships. Primitive dependencies such as blake3 are not # compared. +# +# The EQL v4 range tests (tests/v4_range.rs) use it too: EQL compares +# block-ORE and CLLW-OPE terms, which Stack Encrypt does not derive for EQL +# yet, so cipherstash-client's `OreIndexer` / `OpeIndexer` write the order +# terms of their rows and ranges, offline over the same index key. cipherstash-client = "=0.42.3" # The tampering test decodes a stored body, changes one byte and re-encodes # it. The same line eql-bindings uses, so the lockfile gains no second copy. diff --git a/packages/eql/tests/encryption/fixtures/README.md b/packages/eql/tests/encryption/fixtures/README.md new file mode 100644 index 000000000..7e1f183b6 --- /dev/null +++ b/packages/eql/tests/encryption/fixtures/README.md @@ -0,0 +1,47 @@ +# EQL encryption fixtures + +| File | Written by | Regenerated? | +| --- | --- | --- | +| `v4_rows.json` | the Go SDK's `TestV4RowsMatchTheCommittedFixture` | yes, with `EQL_UPDATE_FIXTURES=1` | +| `v4_queries.json` | the by-name dispatch in `tests/v4_types.rs` | yes, with `EQL_UPDATE_FIXTURES=1` | +| `v4_ordered_queries.json` | the by-name dispatch in `tests/v4_order.rs` | yes, with `EQL_UPDATE_FIXTURES=1` | +| `v4_ordered_rows.json` | the Go SDK's `TestV4OrderedRowsMatchTheCommittedFixture` | yes, with `EQL_UPDATE_FIXTURES=1` | +| `v4_ledger_queries.json` | the by-name dispatch in `tests/v4_date_time_numeric.rs` | yes, with `EQL_UPDATE_FIXTURES=1` | +| `v4_ledger_rows.json` | the Go SDK's `TestV4LedgerRowsMatchTheCommittedFixture` | yes, with `EQL_UPDATE_FIXTURES=1` | +| `text_eq_query.json`, `ste_vec_selectors.json` | `tests/text_eq.rs`, `tests/ste_vec_selectors.rs` | yes, see each test | +| `v4_smallint_rows.json` | the Go SDK's `TestV4SmallintRowsMatchTheCommittedFixture` | yes, with `EQL_UPDATE_FIXTURES=1` | +| `stored_v4_rows_v1.json` | copied from `v4_rows.json` at the next build | **never: frozen** | + +`v4_ordered_queries.json` and `v4_ordered_rows.json` are not frozen: their +`op` bytes are the order terms Stack Encrypt writes today, so a change that moves +those bytes regenerates both together (Go writes the rows, Rust writes the +queries, each with `EQL_UPDATE_FIXTURES=1`). No frozen +`stored_v4_ordered_rows_*` file exists yet; one is cut once the order-term +bytes are final. + +## `stored_v4_rows_v1.json` (FROZEN) + +`Profile` rows the Go SDK's generated code stored with the `next` build, one +value of every EQL v4 type that build produced. Types made producible since +are sealed into their own regenerable row fixtures (see the table above), +the date, timestamp and numeric types by their own Go model (`Ledger`) into +`v4_ledger_rows.json`; a later frozen file covers them once it is cut. +`v4_rows.json` proves +the Go SDK and Rust agree *today* and is regenerated when the encoding moves. +This file is the opposite: it is never regenerated or edited, so a change +that breaks rows already stored fails instead of being regenerated away. + +- `tests/v4_types.rs` (`frozen_rows_the_go_sdk_stored_still_open`) parses + every stored value as its v4 type and opens it to the row's plaintext. +- `languages/golang/encrypt/eql_v4_test.go` (`TestFrozenV4RowsStillOpen`) + seals the rows' plaintexts again and requires the same envelopes and + terms (everything but each `c`), and opens every committed `c`. + +Nothing writes this file and no environment variable redirects either test +to another file. **If either test fails, the change broke stored data.** Do +not regenerate the file. Fix the change, or, for a deliberate change to the +stored format, add `stored_v4_rows_v2.json` beside this one, keep v1, and +say in the CHANGELOG how v1 rows migrate. + +The data-plan records Stack Encrypt stores outside EQL are frozen the same +way in `packages/stack-encrypt/tests/fixtures/stored_rows_v1.json`. diff --git a/packages/eql/tests/encryption/fixtures/stored_v4_rows_v1.json b/packages/eql/tests/encryption/fixtures/stored_v4_rows_v1.json new file mode 100644 index 000000000..657f262fd --- /dev/null +++ b/packages/eql/tests/encryption/fixtures/stored_v4_rows_v1.json @@ -0,0 +1,309 @@ +{ + "_comment": "FROZEN. Profile rows the Go SDK's generated code stored with the next build, over the deterministic EQL guest with the seed below. Every later build must open them (Rust: tests/v4_types.rs; Go: TestFrozenV4RowsStillOpen), and sealing their plaintexts must give the same envelopes and terms. Never regenerate or edit this file: a change to the stored format adds stored_v4_rows_v2.json beside it.", + "seed": "encrypt round-trip tests seed v1", + "table": "profiles", + "rows": [ + { + "id": 1, + "plaintext": { + "visits": 3, + "balance": 1234567890123, + "active": true, + "ratio": 0.5, + "score": 2.25, + "note": "a private note", + "name": "alice", + "age": 42, + "rank": 7, + "weight": 1.5, + "price": 9.75, + "email": "alice@example.com" + }, + "stored": { + "active": { + "v": 4, + "i": { + "t": "profiles", + "c": "active" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAA7z71FqWkCCWSkyPiBK7IQIAD0ug/nDu5R6UBEM9vJjtvDMBTuommRH359HgY7qUe5cAI8R/WLB3CY9crMLnjlRMj7ZX/QIZNLi5MW5kToWQ==" + }, + "age": { + "v": 4, + "i": { + "t": "profiles", + "c": "age" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACaqBouRs68ubIb5N1OQbmcIABm7QQMIr1TNGIweTMmGzZsXGuC+7f6J8hofUigXNGM5QIXIEdBIW5IurSiSx5HzqZvnrotMr1+3KjlzthAMHIvvIE=", + "hm": "ed60c97cff62963a142f9b7762de2e2b98e3d486a178b07f6e930318770fbecb" + }, + "balance": { + "v": 4, + "i": { + "t": "profiles", + "c": "balance" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAZJDEBcfVqv/o1B2CASJrAIAA9a/qD4wfv0t6fGVxDhKQOlQDIuYj5si13wnlmGENABAIe6fH9Sb5gE4xrlHbxz6s1zOCiH1sSBzwa5uH2y93Ys1a+6Jpy" + }, + "email": { + "v": 4, + "i": { + "t": "profiles", + "c": "email" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAABpGgQnFhUnk9qcPUWhvKEIAC6CJ3RRUPLWAn161DEhtppbrtiLrrTXmduDnF5M09OKQJa2RVzDu2NNyqt5/l1u9kG5X7sxu4fjTMW5WYjPqg5ANGdb9NQiwUT4zWCa1q9", + "hm": "be863e717d95eecca3f32f53c3c4d397e3e2aefbc4e7e9d2a7a8a21ed539f4eb" + }, + "name": { + "v": 4, + "i": { + "t": "profiles", + "c": "name" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAASxNA10KeHfMqSIglat8/GIADzC2+uswJkz9HL6DqUBBNDtGODBX5yNHLKryZ0Lgc24AKwBM3hLCQrq3TQdiRQ2Vet7Y4KpMASMdaDTbVj/IxxoBk9", + "bf": [ + 80, + 125, + 212, + 221, + 348, + 638, + 664, + 776, + 1141, + 1322, + 1400, + 1418, + 1532, + 1704, + 1762, + 1843, + 1865, + 1970 + ] + }, + "note": { + "v": 4, + "i": { + "t": "profiles", + "c": "note" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACaWtPMkbUZL3WUSHDD8aD7IADB6CfVElii+gglc1gys6JmpNlLoIFn47AvStPnpJb63wLqSJq3CPPfEcuk4FAAYNjdOI3c+WboMGXS9mtnvXU6oo6Z5ilrmcXXKVz5" + }, + "price": { + "v": 4, + "i": { + "t": "profiles", + "c": "price" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABCExNfO+rr+B8wqj1M0aD4IADBdFcMOac9Yl8IAruRLW/XvOYbrEvf8/b/qUk9C02FfwKQEVkiG/fD1XcE07FZw5DhX2d7FGd70dl4RRIpEpxawKrrbi5O", + "hm": "1b9f59331489691ca4eee0252b98b0863db3b8fbed9f0a0ba8df58f2bc7564ab" + }, + "rank": { + "v": 4, + "i": { + "t": "profiles", + "c": "rank" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABlWVkNzeHCBmpVMce0NgD6IAA4mPP/Krsok6Rmw3q0qARIDYCQpqM4GDID/zkILOkeKAITtr8Lvd32fXPL77WP4xwszhQ7Y3XUWPZi1Zrc/4y/uuc0GoIj", + "hm": "54e9bd5b5c8620be147b65fe754240f64562d4ce62394b3e4390867f2ef483cc" + }, + "ratio": { + "v": 4, + "i": { + "t": "profiles", + "c": "ratio" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAuHszuxtkGGxdJ+yeeEgrtIACJ8iRTZnq+2wD3LmxdAqmDDHzDzzH5th5lG8EQq4qujQIlWupvOk/JChjexCHZN84aas3l1ebC/xnJtnFakBf3xBs=" + }, + "score": { + "v": 4, + "i": { + "t": "profiles", + "c": "score" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAbQulFdQ7itXP4biDOHDhxIAA4jkCscZEzyZymEuOdqFk34IZ2lMPnDiYFZgGjl+Qh0gJpENZYDfXk2R+Ds8rrAf0lOc3wPoybrGliwYFSEPMCfUNxdpiT" + }, + "visits": { + "v": 4, + "i": { + "t": "profiles", + "c": "visits" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAFDIc6s4iXDM+dzEA4ntTLIACXLoQBRqkNqM7yC8syykzCq7A4M32xA4/pWvh7C8atkgJG/d9aHc0z9F0VWZXEEbdWQ81PgsCPBye7lT658p/FMbk=" + }, + "weight": { + "v": 4, + "i": { + "t": "profiles", + "c": "weight" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACKITYga2qq0YHkFjTZcJ+4IACohdycH28XrjPCTXO5ZxudPnwg9RQaee1GS8RdT/bMKwJD1lBYSPOBxwDcKYNLicjsOtuwGCIVGt5Iv1ljx7zLqBE=", + "hm": "96cc94054dd2785dd2592355d2478ca4470d29e09b47637a99f7a91066c93f8b" + } + } + }, + { + "id": 2, + "plaintext": { + "visits": 0, + "balance": -1, + "active": false, + "ratio": -1.5, + "score": 0, + "note": "", + "name": "bob smith", + "age": 42, + "rank": -7, + "weight": -1.5, + "price": 0, + "email": "bob@example.com" + }, + "stored": { + "active": { + "v": 4, + "i": { + "t": "profiles", + "c": "active" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAA7Bs/CwXfgNRto39Lx9+NRIABHtJq376CB/hOqvpsVBNMKQvZK+u8DZctSAfHYIGDJ5gKb0mM55orsh7Q91crIPnxhUuOtNNGCH/zKXBTB1w==" + }, + "age": { + "v": 4, + "i": { + "t": "profiles", + "c": "age" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACh4+loJGS/M8JmW2ApKV6nIADAGfla7KUqXluRKpP9grmSFsBXfT0fWr7EfDhM7U5yiwJB6rb+0tlqRWerM712Kw+GyRJvLTJwSh+K9OdiTRoJvS0=", + "hm": "ed60c97cff62963a142f9b7762de2e2b98e3d486a178b07f6e930318770fbecb" + }, + "balance": { + "v": 4, + "i": { + "t": "profiles", + "c": "balance" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABWRmeNqOZai+bzvH+RNm9vIAAXCtBDbAYEI0ZdSyTjqqxJFXDKcFcIPiKZBPhgJ0mPxQI+5Rahc0VQybsI4bj2TQ5awyRsldcn15j+73MrCujohwvff1id" + }, + "email": { + "v": 4, + "i": { + "t": "profiles", + "c": "email" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAQe7vNxSjEj8rjdP3gTsd0IABnormRqRK1U85ELaGOtxQcQ3104HBJRtsaR65nqh6nowIHdnYHzzrl/tifE3ItwSUJzpQDDcLNIR9uIQ0wegQvKQXeEANIN58cgypA3A==", + "hm": "aa75e5aec88e0ccaf381ccb43c0ae6b66d0d9b8a45fca4a69c9efd86ea54a1c0" + }, + "name": { + "v": 4, + "i": { + "t": "profiles", + "c": "name" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAwZi24blzEV0AaJGmb/J0qIACVuh0/kQa3DPQHliIZ/b8zwI984wmgU+Mt32WwdguPVQKTERddkynzo3iV0nTJ8S+xf9t8+w+eRCosiDjqR/YeVyJJ8I03zA==", + "bf": [ + 59, + 178, + 215, + 219, + 333, + 410, + 429, + 431, + 584, + 596, + 623, + 633, + 653, + 801, + 812, + 866, + 897, + 1140, + 1143, + 1217, + 1221, + 1222, + 1240, + 1284, + 1314, + 1329, + 1371, + 1497, + 1563, + 1586, + 1595, + 1680, + 1712, + 1735, + 1808, + 1837, + 1884, + 1933, + 1955, + 2036 + ] + }, + "note": { + "v": 4, + "i": { + "t": "profiles", + "c": "note" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACuX29oOy6CpQMDSRIGRRoBIAADpDaKPNDz33wT17X2TRr+o3CeIaf4IMCF5Bw2OlvxaQIEepseVeWQWt3sJl7boi6Sumw5y3Fuyh7dJZtYhg==" + }, + "price": { + "v": 4, + "i": { + "t": "profiles", + "c": "price" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAADToqGE1AlegXhlNE5k35dfIABV5S7PuJofUEoLo7O+I1gArQImBsFj7dEqGh5HAACRbAJOLvz0UwQSPhVK5gP6bsDnfTn3aVsZIsVQgiNlXpESFYq0Mn5q", + "hm": "b0b544178e92859e68e6435482637ae76bfd6603e503c4ded4881a89aaeb61d1" + }, + "rank": { + "v": 4, + "i": { + "t": "profiles", + "c": "rank" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAABN3Sq3cLE6lQeig3ZdclZIAAFAf0aegehK3EzNh26ugJ9SXl97H0DKaux6GLrZZTAZAK5EbnFV7feLytT5bAn3kVZ0MpikL4m46U/sG7Uw2CytICNGGrD", + "hm": "7b1dbcfc1a19eec19cbda0117985973da7f24dc77c7e97f88f63a948f904d49d" + }, + "ratio": { + "v": 4, + "i": { + "t": "profiles", + "c": "ratio" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABmRooB0kko8FAtEyMCWf7iIAAvxPzawHCl2UsixGJ0tT/wGIG88SOJfrus7QGNUEt6rALy2tEm4gW9/9bXWVkQ7G/SZmoiUEztVxT50eDD8VqLxxA=" + }, + "score": { + "v": 4, + "i": { + "t": "profiles", + "c": "score" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAADFAnZOcaaWD0Ds6Wua3ZztIABA88NJKfXIXC5zas/z1IOhmAyc8XchqZ+EDtNJ2/AWUwLAmK2961C6sZWuDZfliURb+pAi1VT8fwzDVCUibSHqhAim9aaZ" + }, + "visits": { + "v": 4, + "i": { + "t": "profiles", + "c": "visits" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAyLznie0nVoP3WyyvaA5RwIACy7ziBzTMFYlWykYyWE56nBiBsI4ypAZ5btWKCjM3L9ALmtY+UlDNDLH2SppZVLuHdjQaGiMY1c0vYeb3rnXnF/28=" + }, + "weight": { + "v": 4, + "i": { + "t": "profiles", + "c": "weight" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAB9T5NWlQ6PpoRzz8qJSTWIAClBTm3e2VqrMS4xE6nyR3WjUGxsmdDo+fP14OS1pU0PgLvWwdJV5ojAykg+gxmhmduwOuGFFyDFTKmQCtPPLAoNvU=", + "hm": "e2a35073033a519f51db4adc9ee92fd470cfd6eefc5f4d4c72c9ecc0a9e4e6b9" + } + } + } + ] +} diff --git a/packages/eql/tests/encryption/fixtures/text_eq_query.json b/packages/eql/tests/encryption/fixtures/text_eq_query.json index ed65759f2..150a9d1e6 100644 --- a/packages/eql/tests/encryption/fixtures/text_eq_query.json +++ b/packages/eql/tests/encryption/fixtures/text_eq_query.json @@ -2,6 +2,6 @@ "_comment": "The TextEqQuery eql-bindings derives for the plaintext under FakeDataKeySource's index key (keyset nil), read by the Go SDK's hermetic test; regenerate with EQL_UPDATE_FIXTURES=1, do not edit.", "column": "email", "plaintext": "bob@example.com", - "query": "{\"v\":3,\"i\":{\"t\":\"users\",\"c\":\"email\"},\"hm\":\"ec534cfbf2336785378c3761ff88623c46361b2ba7c5fa83930ebacae49cf646\"}", + "query": "{\"v\":4,\"i\":{\"t\":\"users\",\"c\":\"email\"},\"hm\":\"0cf708c07acaaa169e84e4adf7081f0433d87760bd7e9c63bd7a58c000b8d33b\"}", "table": "users" } diff --git a/packages/eql/tests/encryption/fixtures/v4_ledger_queries.json b/packages/eql/tests/encryption/fixtures/v4_ledger_queries.json new file mode 100644 index 000000000..cf59509ae --- /dev/null +++ b/packages/eql/tests/encryption/fixtures/v4_ledger_queries.json @@ -0,0 +1,16 @@ +{ + "_comment": "The DateEq, TimestampEq and NumericEq query operands eql-bindings derives for each plaintext under FakeDataKeySource's index key (keyset nil), read by the Go SDK's hermetic test; regenerate with EQL_UPDATE_FIXTURES=1, do not edit.", + "amount": { + "plaintext": "1.50", + "query": "{\"v\":4,\"i\":{\"t\":\"profiles\",\"c\":\"amount\"},\"hm\":\"ff787d4a33e41d24d30fb95098c57bdffeef072fb9e0907a2dd7fa621a5eda03\"}" + }, + "due": { + "plaintext": "2024-02-29", + "query": "{\"v\":4,\"i\":{\"t\":\"profiles\",\"c\":\"due\"},\"hm\":\"decc03613957c47004860bc9bc70770aed4c6ba3f0da2aaea3da9fe7367af6a9\"}" + }, + "posted": { + "plaintext": "2024-02-29T12:34:56.123456Z", + "query": "{\"v\":4,\"i\":{\"t\":\"profiles\",\"c\":\"posted\"},\"hm\":\"b3a2b5c8d5ea562f472a55eb57f3b49aec3d6cc3731dad16c4f8999394a95c55\"}" + }, + "table": "profiles" +} diff --git a/packages/eql/tests/encryption/fixtures/v4_ledger_rows.json b/packages/eql/tests/encryption/fixtures/v4_ledger_rows.json new file mode 100644 index 000000000..63777e6f4 --- /dev/null +++ b/packages/eql/tests/encryption/fixtures/v4_ledger_rows.json @@ -0,0 +1,199 @@ +{ + "_comment": "Ledger rows sealed by the Go SDK's generated code over the deterministic EQL guest with the seed below; the Rust suite opens and queries them. Regenerate with EQL_UPDATE_FIXTURES=1 go test ./encrypt -run TestV4LedgerRows, do not edit.", + "seed": "encrypt round-trip tests seed v1", + "table": "profiles", + "rows": [ + { + "id": 1, + "plaintext": { + "opened": "-262143-01-01", + "due": "2024-02-29", + "created": "1969-12-31T23:59:59.999999999Z", + "posted": "2024-02-29T12:34:56.123456Z", + "total": "-79228162514264337593543950335", + "amount": "1.50" + }, + "stored": { + "amount": { + "v": 4, + "i": { + "t": "profiles", + "c": "amount" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABkTJd2+gSGUCXq5Bog0ODUIACQ+t9l6f3shvibRWnk1Ihw7dEY6c0vRmYYIIFt9OMzRAIL8M8TSHbtBLpRD8evgfwfWeQncgvb4wFTmJ2Dl2n60SGuhBcL2PnYmDbY/GM=", + "hm": "ff787d4a33e41d24d30fb95098c57bdffeef072fb9e0907a2dd7fa621a5eda03" + }, + "created": { + "v": 4, + "i": { + "t": "profiles", + "c": "created" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABGuTbf5RPT5TP4jkMDscaIIADvvVQ1X3uY1KcA+8e4xNhSomXJsaXQbJQFq2COXq6V/gKCU8qm+3AzsbJ2iZdccv/Iaxb+WgqDN6aoF4MRVZU74p5qKfXg12dXAA==" + }, + "due": { + "v": 4, + "i": { + "t": "profiles", + "c": "due" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABxVAjbrawodyK39W6/wh82IABYPU+0mX8CHFvfIfoChRygxSp/EY9wA5Tt3u09Pc3bgwIDcMmFSrX/0VrXRIQ4VO1CORi2fLaZvUHGHKyQ51NO9OU=", + "hm": "decc03613957c47004860bc9bc70770aed4c6ba3f0da2aaea3da9fe7367af6a9" + }, + "opened": { + "v": 4, + "i": { + "t": "profiles", + "c": "opened" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABac+LBy0VG2VPg3ZA53wR5IADij0/N3siwDhSUWwCHNy3M63fuNYPaRFubg/d7h/snCAL03BHwsPgXawwBQRFdQWpQKS5jg02BxED9R4DALnq5jis=" + }, + "posted": { + "v": 4, + "i": { + "t": "profiles", + "c": "posted" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAr9Mw7BH8KdqEzSM13/Zi7IADyLjNo7TciDvsKQU+xOu/8uQlNYMYFE1U+bVt29bUpOQIHRhk22OLKCoM9GSa2moqwpXD2u/VhhJfzC9Yt+Nj6OJMZhFCoU4Fuhg==", + "hm": "b3a2b5c8d5ea562f472a55eb57f3b49aec3d6cc3731dad16c4f8999394a95c55" + }, + "total": { + "v": 4, + "i": { + "t": "profiles", + "c": "total" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAATyRC14+m8N7oH7Js7ZVqRIAAMq9Za2+D51qL5ba1r6/Rtqzc3kwtt8DctI1tVVhdvgQKko9YUgjcDJdcUOhpOnbxcyAs53dUr8W3bkDuQJ2+tOMjWzVbZi3+3UY9THL8=" + } + } + }, + { + "id": 2, + "plaintext": { + "opened": "+262142-12-31", + "due": "2024-03-01", + "created": "2024-02-29T12:34:56.123456789Z", + "posted": "2024-02-29T12:34:56.123456999Z", + "total": "0.0000000000000000000000000001", + "amount": "1.5" + }, + "stored": { + "amount": { + "v": 4, + "i": { + "t": "profiles", + "c": "amount" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAKybDqXBsszdixWIGR8SZBIAD/drxmP5dzmNDKUjYtiDgZvFcHhOZOJzrc6eex0q0MCgJ/PdJDq9vGicUmekPKAKWfOpPYO9BZKtoa1mnfIssxqlPAj08l1SM/ZUkyzdg=", + "hm": "ff787d4a33e41d24d30fb95098c57bdffeef072fb9e0907a2dd7fa621a5eda03" + }, + "created": { + "v": 4, + "i": { + "t": "profiles", + "c": "created" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACseL3lfg99+b/uhGmba7LRIADKXzDfsoVOBKIKwpw6XN/IWltOxnK8Q1qzZ0YkAqK0WwI+rlmCIdTAihn74kvROTOrdSmPQRCT1v1M110EAPHAat3QVBGT+2H9AA==" + }, + "due": { + "v": 4, + "i": { + "t": "profiles", + "c": "due" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAXndapLjoyx2wsK2yToOIfIACwJln1DyojCIuwH8XHvJodMunCGS0dfEYintuFQrNXLALNoZ3nax4abrlBe0je4lvugniEDqDjJ/5+nrsWCL19o84=", + "hm": "086ccfab604ccf449a731ad7e01161bfd80c12f25ba5832e92b709f42b2b7aa4" + }, + "opened": { + "v": 4, + "i": { + "t": "profiles", + "c": "opened" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAADhmok01VlvzDZ54Ve4NYs+IAA9SQIB8WxjSZDilDh2n9Ym6YccQQWBJ7ef2clbtu4SgQLl1OmZPlTj2ZHK0QyC215t27avkXEaIiiXstXCtLjsXhQ=" + }, + "posted": { + "v": 4, + "i": { + "t": "profiles", + "c": "posted" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABaXm2d096n8ZEEJiaB3NxKIACL8OhWrR2p4fZZazuJKKgRsv+lJPaamyXwxGVq9vT2EAK7AmoJ7W7R19iCPgf9Vgr+k6s4qT1n8cIt4USX0NfAI+pE7FlsCyeD7A==", + "hm": "b3a2b5c8d5ea562f472a55eb57f3b49aec3d6cc3731dad16c4f8999394a95c55" + }, + "total": { + "v": 4, + "i": { + "t": "profiles", + "c": "total" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABLXWj8ZGmyU14mfULzczbUIADg6xfObeAiOuQQcg49dZ3rMkOc2WqCL0NPepGJDhhslgLyLRD8HyuEqddrbsIzlXzyWBYWvk46vlaHtQK02b+Task10kxCuTxm7gJtg0s=" + } + } + }, + { + "id": 3, + "plaintext": { + "opened": "1970-01-01", + "due": "2024-02-29", + "created": "1970-01-01T00:00:00Z", + "posted": "2024-02-29T12:34:56.123457Z", + "total": "1234.5600", + "amount": "1.51" + }, + "stored": { + "amount": { + "v": 4, + "i": { + "t": "profiles", + "c": "amount" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABnPkyUpuwK99phMHDnRbhCIABCbSCYPvkH92/UTxfFMiL/7X01xvH3mgh3pxeV+v59vwJJQAnSyyjouUFH1r1Y5SrLasHKlU9oED93T3O5LqvtTWwiArdsKBHHpx71T4Y=", + "hm": "7fbed23fa93b6d89ecf0883cddd191d4260d1cc8af68ec9c60d997365dbf4d5f" + }, + "created": { + "v": 4, + "i": { + "t": "profiles", + "c": "created" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAADb10mF0XME/G6O/c19GNdtIAC6NkocrbY4y7PuHSJX/nEKsSq6uC8EKGhUL69Xkgz4MQJh2UUJ/xMpXG6j+ij6GOMZn9R/bakY9mtlssoB5upT/pIJA+hV4N478g==" + }, + "due": { + "v": 4, + "i": { + "t": "profiles", + "c": "due" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAMtFomHN3dgKH8FZNzXqxbIAAX/CwMjLj4HTN/Mo0hRbmUt+V5v4bI366uKHRN55IcpQKhu13tqJuXm3Uw6yrB8GapAq7TEKzLqcOkNT2vSyNPLvk=", + "hm": "decc03613957c47004860bc9bc70770aed4c6ba3f0da2aaea3da9fe7367af6a9" + }, + "opened": { + "v": 4, + "i": { + "t": "profiles", + "c": "opened" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAUfff4RXAt9HIL0ezwFl5oIABloL38OjJ3H7ZOBpgYefpdza2nKMMccXMcD8sSAdaR9AIG69Y8fG9aO6AFuMG4AkH92lz4Plj5TuGR3crB+83JuHc=" + }, + "posted": { + "v": 4, + "i": { + "t": "profiles", + "c": "posted" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABTyd02/xTIqENG5WzqeH+kIACTeY3JPRFisVuLrMf6rcKnordc0e9lrrATavl1B/cL4wJ2f82ziXPF0/JepP3C5XPnAxP/UVQemoyzemJeRGdkqegUvASIHcRrgQ==", + "hm": "b75c44fffb471158dd836f858f88d04658cd8985d0f52ccf582af259eeda030f" + }, + "total": { + "v": 4, + "i": { + "t": "profiles", + "c": "total" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACT3tVNTBXZ5pFHbNGibsVoIADBAZSy1MjXUm3HtQF3xbv35hpGRWHsK4FDx5KsARB6cgLDY8S5OvL6ob8+2pUnCBw7Eq1x5kSeBw1lpoRqjUmzugxrQ9NTSGwi1ObgAuk=" + } + } + } + ] +} diff --git a/packages/eql/tests/encryption/fixtures/v4_ordered_queries.json b/packages/eql/tests/encryption/fixtures/v4_ordered_queries.json new file mode 100644 index 000000000..a494c0791 --- /dev/null +++ b/packages/eql/tests/encryption/fixtures/v4_ordered_queries.json @@ -0,0 +1,44 @@ +{ + "_comment": "The v4 query operands eql-bindings derives for one plaintext of each OPE-ordered type under FakeDataKeySource's index key (keyset nil), read by the Go SDK's hermetic test; regenerate with EQL_UPDATE_FIXTURES=1, do not edit.", + "floor": { + "plaintext": -3, + "query": "{\"v\":4,\"i\":{\"t\":\"rankings\",\"c\":\"floor\"},\"op\":\"0068773fbf20d83c18c9e2c158d14a9601d12eab933e59d10e163110e4f030377b\"}" + }, + "handle": { + "plaintext": "carol", + "query": "{\"v\":4,\"i\":{\"t\":\"rankings\",\"c\":\"handle\"},\"hm\":\"30fca14a65e5695fc96bd9fc7e3747afe79c7ff2993d532e3ad97f8e8b95ffac\",\"op\":\"00e169c8297d7be0a24e597d20e140b6a098c488dda2a5fab8b1a7071ff703df7f0880519d1ea23890b5c6a01066f62633\"}" + }, + "level": { + "plaintext": 10, + "query": "{\"v\":4,\"i\":{\"t\":\"rankings\",\"c\":\"level\"},\"op\":\"0159d19c111791f639ba0638692ca6f6c53ecac713e356a7e8bf95fc2d839691f4\"}" + }, + "mean": { + "plaintext": 0.0, + "query": "{\"v\":4,\"i\":{\"t\":\"rankings\",\"c\":\"mean\"},\"op\":\"017bc9729378e320ff0c1504dc995074a7db7b05d24bed8a923f6944899e4517d213bba21ee639bb01063902e92cad61b3f3b0755b0dacc66fa5188b434c455360\"}" + }, + "pace": { + "plaintext": -0.5, + "query": "{\"v\":4,\"i\":{\"t\":\"rankings\",\"c\":\"pace\"},\"op\":\"00028af974e429d69504e291c6615487c98d3abbaf6a36a012b22bd60ddb569ba83f09243bb5f22d9df419926a7b9e31c7c4411c822471fd427c7a74ac57df0482\"}" + }, + "points": { + "plaintext": 5000000000, + "query": "{\"v\":4,\"i\":{\"t\":\"rankings\",\"c\":\"points\"},\"op\":\"0124da6c76e6a9d3572f27a08b17b843e6581a23213f34fea500706db6d0edf539fee6624d544ab352bbfcd0987056c61e7e2b808fcb36eef07e673ec3639e4235\"}" + }, + "score": { + "plaintext": 9.75, + "query": "{\"v\":4,\"i\":{\"t\":\"rankings\",\"c\":\"score\"},\"op\":\"00cf2820721cd8c187f434f8986fd01c7eb126c713b0619086b0ca6d0b2120f8d322bbc60d5e40ac640ec49f271c0894a6965ab22b7da190f2e2af8f157a7b503f\"}" + }, + "speed": { + "plaintext": 2.5, + "query": "{\"v\":4,\"i\":{\"t\":\"rankings\",\"c\":\"speed\"},\"op\":\"00bbc2ac417a8cb6a4b5b69c9f81223f9016f7ffc9e250417dd5afa5cfd4844dac6f9f72bf972a4aba57ae0f7e64bc7ce315095aab620f1f0f7a567d525837af8c\"}" + }, + "table": "rankings", + "title": { + "plaintext": "Mango", + "query": "{\"v\":4,\"i\":{\"t\":\"rankings\",\"c\":\"title\"},\"hm\":\"5d14d6d4a7e93c15cf6b7a0e92dc102adbfcbfb7c0492ad09d6b1938bafb748b\",\"op\":\"00344fe120b7abb89fdad4d2ace56e65d225dc12e1f08841a86ad18728afb74d36c3bdd298ed9a2e94e98a2e9328a2fa76\"}" + }, + "total": { + "plaintext": -1, + "query": "{\"v\":4,\"i\":{\"t\":\"rankings\",\"c\":\"total\"},\"op\":\"007152e605e2cc13823bd1379c7733939403474f5dfe1a65fa73eb63ea134f4a0505668fc80076fb24aaefd4763b1d1a2be9bf875178cf8f4abdbdce276f071ed9\"}" + } +} diff --git a/packages/eql/tests/encryption/fixtures/v4_ordered_rows.json b/packages/eql/tests/encryption/fixtures/v4_ordered_rows.json new file mode 100644 index 000000000..4fa6224dc --- /dev/null +++ b/packages/eql/tests/encryption/fixtures/v4_ordered_rows.json @@ -0,0 +1,334 @@ +{ + "_comment": "Ranking rows sealed by the Go SDK's generated code over the deterministic EQL guest with the seed below; the Rust suite opens and compares them. Regenerate with EQL_UPDATE_FIXTURES=1 go test ./encrypt -run TestV4OrderedRows, do not edit.", + "seed": "encrypt round-trip tests seed v1", + "table": "rankings", + "rows": [ + { + "id": 1, + "plaintext": { + "level": -20, + "floor": -30, + "points": -5, + "total": -9, + "speed": -1.25, + "pace": -3.5, + "score": -2.5, + "mean": -0.25, + "title": "apple", + "handle": "Alice" + }, + "stored": { + "floor": { + "v": 4, + "i": { + "t": "rankings", + "c": "floor" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABn4yMF67G89OFjQZZuk7z/IAAPy1eGXRyPxy1IfAwzQCPlOMdditoc/8fNRNI2Iw3VQwJX+YR4eii1fcxB+KJtUD2cDQHwylkneQqa8OgbYJYiWTc=", + "op": "0068773fbf20d83c18c9e2c158d14a9601d12eab933e59d10e16311064f92eac47" + }, + "handle": { + "v": 4, + "i": { + "t": "rankings", + "c": "handle" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACao1GJ/o4L0iCBtDrzF6P4IADDycFng7kuIpwyCSaqaE7ZJDE3q+nAEKaMK9GelLdntgK3RJEIWuJIwJoaqe10CfLP0ObM8l+bgj/harYScfipBL4g", + "hm": "fd9e4ef66848b4dada73e4262e85c9994af16aff271638ef9ec695d460e55076", + "op": "00e169c8297d7be0a24e597d20e14036df866a797b2cf54c44b7ae8b5540f7055f407ed6f91137efd272331b242fbe1ba1" + }, + "level": { + "v": 4, + "i": { + "t": "rankings", + "c": "level" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAADOELB7oFk4gGnte9gWUzX+IAA/eO5LaKSJjCCWDqc30OLhtVNEMuxqU8YpeFdvKCq/zwJuoJAKC6CVvRXxddKK93rVWrvRV5ZLBIdjTRO5wEkx4/M=", + "op": "00da028bda7156e277d149180f09a615bb7f3f45efabe00137a04f5514176bc162" + }, + "mean": { + "v": 4, + "i": { + "t": "rankings", + "c": "mean" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAXtGGpXlAfrs+IrloNwZO2IACelhdo3FYPTm2Ee6gu3+WpSHxU3IZtSHO2tiiQdtYltALT0WMwiFSu9v/C372nHnQ9Y2F5lQ+SJ9a6UGl7q1Wnzg6OavYb", + "op": "00fbce95d005970edd747e9dbff02f9824d8fedff874593ae7ddceabb8034978ead8b5f3a99c55793ed7912cb85f2cb5b600cc608ead9edfbf551e4d1544fff0d7" + }, + "pace": { + "v": 4, + "i": { + "t": "rankings", + "c": "pace" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAADbT5WtnwkRYMqrlrr5MYHyIAB3uJpHJLZ4qKadvcMBxL3zAMxDkh86LddqQyvJSQAvugKLD9zlce2vNCOnYmInd4TrsCm94ahuAenaAUtKbFc5Fhk=", + "op": "00020a960d8eb4ca100a36cdccaca4b2685bcd7b343e092f8133a320b1d0cb6ec85408fb3485228c62b3512f97dc9b86ff4021b728ce7aec0b99f5bbe72a3fd870" + }, + "points": { + "v": 4, + "i": { + "t": "rankings", + "c": "points" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAADE2rUct3jjTKCWivCCCvn+IACDxItrcNhNJjpoOqJKOryPLgDOg+vvfrH4031ThcjDcgL2v4cWtT1QKjil3dECXavlyHzUuyoinNxTfIYEdhSNTtbKxK1z", + "op": "00a53e38612eddc330547218dda2f5ee376e718061a8ea3af479e8473fadca71aef7476bd681e502cb239d515f23f7ef925e386904bfa7dcea145d06c9bcec551b" + }, + "score": { + "v": 4, + "i": { + "t": "rankings", + "c": "score" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAdcnRvoEEyjJO4SJ0QoQxyIAAWeon6kK0bnzHkJPNFV77QcE9ws0SBOC8udyFu1wQVVQJ2t+3/Rkek59/J7fRQYHVLNvDLxukNBbokL5IOQCiE/3SVDWb0", + "op": "004e3516c0d33a94c4ba52f438645a422d570ec9e8ff91214f13848b1eb09310c1a23351ac149e998374c4baea8eaf9247fcf7465dd3a946be01332c42889aeb49" + }, + "speed": { + "v": 4, + "i": { + "t": "rankings", + "c": "speed" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACQhhB1srtFMhmPGNU3YdsWIADsfyGa4Tr54eU6CvZPZuGD26cBMDuzAO68y/GPMEqBTALILPPKyY05f6gsuB1SdbmqiH4qDmgFT5U58X3BsRGNNfM=", + "op": "003c173a74a6502886339a78c9c32c6aae7ebde1d06257855d71e33b84651ef15d77ddbbc7980a6fa7634fb604fd5b2f52c248e3531b61f181a2a9662ae051aaff" + }, + "title": { + "v": 4, + "i": { + "t": "rankings", + "c": "title" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABDsM58wLdL/OmzeE1bqk6fIAAZc0G+IFRon1pJAfT2YQm7ENl+LSkdnO6ABKfec8JJOwIZax/COEcTjpdSfUvH35SFQKaypGbuq36W7Qkriuu7eEkm", + "hm": "3bb29d6ed8db30040350b25bdb47263cb156666c5214d96f991850a4672eefc0", + "op": "00344fe120b7abb89fdad4d2ac644367e74b2ca4e6a9b6d4115e85b5966136c35ca2f2645bf578d8d1fe730b1465312f27" + }, + "total": { + "v": 4, + "i": { + "t": "rankings", + "c": "total" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAATWgrbBtfjqeFUZIJyCg/TIADRzWl3oad1fwHQ28RfJWb4tEsJ+2+pskxX7xjJHYOtxwKaanS7nY7gY/0rP/z1BlJQivmSTGhqkM8GGU3HYF54RbD163HI", + "op": "007152e605e2cc13823bd1379c7733939403474f5dfe1a65fa73eb63ea134f4a0505668fc80076fb24aaefd4763b1d1a2be9bf875178cf8f4abdbdce26ef1e3d98" + } + } + }, + { + "id": 2, + "plaintext": { + "level": 10, + "floor": -3, + "points": 5000000000, + "total": -1, + "speed": 2.5, + "pace": -0.5, + "score": 9.75, + "mean": 0, + "title": "mango", + "handle": "Carol" + }, + "stored": { + "floor": { + "v": 4, + "i": { + "t": "rankings", + "c": "floor" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAD8EXObyO8iZAsGLtyoF8OzIAAUnZe1c/yU3tUu7btj/FmcuWh0G3VlpdjE4Y1DYkuXYwKjI6FNx98wap6YRPYq0Pr6xumDkjkem3g1aD9Bd15gGJE=", + "op": "0068773fbf20d83c18c9e2c158d14a9601d12eab933e59d10e163110e4f030377b" + }, + "handle": { + "v": 4, + "i": { + "t": "rankings", + "c": "handle" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAJSAHc0qCJ5PzM6mX2ijrQIAAOAb/DTu0ioK8DD+OJLmo37ro6p5goGfRbZvv+4GZmmwLyq1pNP+xziI6NvqEt7inQUrLLPhDVG8j3/FIywLlE/SJx", + "hm": "28fe3661678ecdba7c98355d901c9a8a591c1175c1d7b403bd3d1ec949c8b2e0", + "op": "00e169c8297d7be0a24e597d20e140b6a098c488dda2a5fab8b1a7071ff703df7f0880519d1ea23890b5c6a01066f62633" + }, + "level": { + "v": 4, + "i": { + "t": "rankings", + "c": "level" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAhOR6KLBknqtSBVRnlASoSIAAkxpt5V1/27p77EpAoxlp3ceWsCtSnFCzVx1mJZ9TRkwK8xMXduV+d2TMvfn7+P2QF8EnlLYAiRPNnN29ANmoVSts=", + "op": "0159d19c111791f639ba0638692ca6f6c53ecac713e356a7e8bf95fc2d839691f4" + }, + "mean": { + "v": 4, + "i": { + "t": "rankings", + "c": "mean" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAipqSO612avBu8ILwcZ4zfIAClyVXmOu93Sq1j8QZEePtr9Yn/DaGkc/jIzWIJfzRtqwJ1jc06IDRZmX8wTBKbh4NQUgAPFduL3qFTTmzXxfzmMverhaSn", + "op": "017bc9729378e320ff0c1504dc995074a7db7b05d24bed8a923f6944899e4517d213bba21ee639bb01063902e92cad61b3f3b0755b0dacc66fa5188b434c455360" + }, + "pace": { + "v": 4, + "i": { + "t": "rankings", + "c": "pace" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACSUbSNa21Cz2EdccB0dU93IAB5ZsgjlyQaH70IyAEmbajCC+g5pPkdckAlAyLzt31TpwJZCCAoMewAOd8y+7jLdEfzU5mQ3zdV4dpjHzvMNoIl6q0=", + "op": "00028af974e429d69504e291c6615487c98d3abbaf6a36a012b22bd60ddb569ba83f09243bb5f22d9df419926a7b9e31c7c4411c822471fd427c7a74ac57df0482" + }, + "points": { + "v": 4, + "i": { + "t": "rankings", + "c": "points" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAD7BDP9k+0Hn5JvKavkeIEeIACwwz3ffvBIoUS+WhQi678dNUBCkgT8GduW9s20XVgb7AKy1BxwBvFhYdWu8TjON31J/XFZE6F1lgnSVZLat6Po+utVYHS2", + "op": "0124da6c76e6a9d3572f27a08b17b843e6581a23213f34fea500706db6d0edf539fee6624d544ab352bbfcd0987056c61e7e2b808fcb36eef07e673ec3639e4235" + }, + "score": { + "v": 4, + "i": { + "t": "rankings", + "c": "score" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAC8mEb7pUk1HxVAoAej3DB3IABYatmLY126M9pYkSV/txgFWt8Dn0gqikv85rJxYY3DsAK7P9SKYcuFN3NNXWdqAQ301cj85RYYFUnxeu9PUP6Hv3Rc0TAf", + "op": "00cf2820721cd8c187f434f8986fd01c7eb126c713b0619086b0ca6d0b2120f8d322bbc60d5e40ac640ec49f271c0894a6965ab22b7da190f2e2af8f157a7b503f" + }, + "speed": { + "v": 4, + "i": { + "t": "rankings", + "c": "speed" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAu+yQLbuCeiI1Kc93l5gM9IABDnI3BuN2mIRVGQNCz+OT9g1NBNpy73iq+RyQMrDq2SgLdiotIJVKFxL7zjyPD19PobupEvKh4GhfipnC5MhqxmUc=", + "op": "00bbc2ac417a8cb6a4b5b69c9f81223f9016f7ffc9e250417dd5afa5cfd4844dac6f9f72bf972a4aba57ae0f7e64bc7ce315095aab620f1f0f7a567d525837af8c" + }, + "title": { + "v": 4, + "i": { + "t": "rankings", + "c": "title" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAB8xVf2YzyG2GIJsjlxprEhIAARLofbMnEJkC3zRNC1Liyue93ywxEK707OQBNyU3GRRAIR6N/Yy+L9m18gSMba81M6XZu9nnwSMGCjCFmC6FtEdAC0", + "hm": "96c9b4169dddc5b00a92aca4f2141eaa81586bb3c0459c9621c6152a938bccc2", + "op": "00344fe120b7abb89fdad4d2ace56e65d225dc12e1f08841a86ad18728afb74d36c3bdd298ed9a2e94e98a2e9328a2fa76" + }, + "total": { + "v": 4, + "i": { + "t": "rankings", + "c": "total" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABsGQzdwhlf/5JQSTVnel1lIADu5SaW0n7eTUy2k1WrssfM1qoPuD3RSy12zQc69AvRNwKYqTPivNDeEnZygzTBpFhBGNtG92Y0Kltt9qEE0OEUYseWMu0H", + "op": "007152e605e2cc13823bd1379c7733939403474f5dfe1a65fa73eb63ea134f4a0505668fc80076fb24aaefd4763b1d1a2be9bf875178cf8f4abdbdce276f071ed9" + } + } + }, + { + "id": 3, + "plaintext": { + "level": 99, + "floor": 4, + "points": 6000000000, + "total": 12, + "speed": 8, + "pace": 0.75, + "score": 100, + "mean": 3.5, + "title": "Zucchini", + "handle": "dave" + }, + "stored": { + "floor": { + "v": 4, + "i": { + "t": "rankings", + "c": "floor" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAahRXPLhcOhZalhxaRKtwfIACZJ24pqBpQ/xkQSjuIcUV0/DY8mrP3JugbZIjLooy/agJXmfRZQv8gd+32H9A96zYw31oM8RyIVpR/HrQbVP/a6vM=", + "op": "00e7a865a4a6a28052352a8eb6c1265f682958013daa3f37fce5f07022a097aa85" + }, + "handle": { + "v": 4, + "i": { + "t": "rankings", + "c": "handle" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACAaXkgSLAngfKw540Hh/cyIABUzHBgSmtLU4FEA1PiYLaeQb+T1nu8+sQyX6e1dXFFnAJ8t2RiTgBT5L5jai/lA/1J1ipI8gx72xi4G78HNRc8LzU=", + "hm": "ec1d4753450fceec15afd623ce671fff76c236cbbbc81af81cef9e694a493ac8", + "op": "00e169c8297d7be0a24e597d20e1c094556c47b21bced759dd8e83e5a075f1b02cf50ad54f524ee158" + }, + "level": { + "v": 4, + "i": { + "t": "rankings", + "c": "level" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAxIHgvAEtydMinzMsMC9maIABcXRm4Ec9fNHs/VMPHO2YcFzhLBtvGDaO5/vL94Up4DwKIvL/fnqO4f4Bu9W6FNibpKRmt9aQmi/P+igsXeqf1LXc=", + "op": "0159d19c111791f639ba0638692ca6f6c53ecac713e356a7e8c016099dca23df54" + }, + "mean": { + "v": 4, + "i": { + "t": "rankings", + "c": "mean" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAA3MuHYMxBxol/l3CWUUdMwIACBix0i7ecA6Ldg1y72uB17y+CSAZFHm7KMBeJIDB9SSQJr4639om/GxjhRNe96mH/k6IVqzDKdy1vQcaiHL6M/rhySzCh1", + "op": "017c49c16621a2476ed2e40c07fd2d0b35d8f722f0b0e7bca5a4681d69a349806e3554d39f0d13392b43cfe477aed64f8d13ba4fb8e786dbb8c60b454a8a50197c" + }, + "pace": { + "v": 4, + "i": { + "t": "rankings", + "c": "pace" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAADsocba1ACUuZab/S3cR0ewIACbWZ1UAMwA6rnu+PuFd4RCwsXLXgkmZwavUB2HQ5lIMAKNgBydDXntlpuWxH4iE3ALX8ukrBS2pqIyrliA+pyNHzI=", + "op": "00822a022b1129809c146cada9cd22fa5208b482279f0e58376d67e7619bf3c39ab962520422fd56d4c43422be205365bfe363bf466ba709ced360af209fdf2c8c" + }, + "points": { + "v": 4, + "i": { + "t": "rankings", + "c": "points" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACyINaK+oMYBWGqilpz+Y8WIAAAAwXxsCfja/ehP5So7kKPSpDckgOjdWAFkQ0JFNatGgIjwqEjrceceNJS9EXjqbF+syMBx0UeigKdwBZvpKg1VJUetU8L", + "op": "0124da6c76e6a9d3572f27a08b17b843e6581a23213f34fea500706db6d0edf539ff65903adb0c33d49877a8393f339203152f20ddbf199339e4e940bf5754b804" + }, + "score": { + "v": 4, + "i": { + "t": "rankings", + "c": "score" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAADLJrDpNuSIT1MzDrC3NqkdIADeidZb+K23yM3QNYs+J9lmB9ImCm/0mFW58UkeELUnfgLrLahFD5GGGpELE5j98cbiAvLw/UzqRHXRZdjAzrhSGvAhJpcP", + "op": "00cf2820721cd8c187f4b49ef818bca2626025cd2725b90a8daab1fff0d28e46031a6cf188bff7fd4095aac4fd74613c395a909cb2f6ee863ff59d364234862a3a" + }, + "speed": { + "v": 4, + "i": { + "t": "rankings", + "c": "speed" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACgW67nY8FTYuEOauFB2JqpIAB5N3v5rvteb1kWiSLlblOJ9Bvwa4mzUHOFsJbqvqlsrQL8ByKpYorieYyq9NnIkuVxcznI5zABTlD5OzN1KGkjl+M=", + "op": "00bbc2ac417a8cb6a4b5b71c87a011af4b942767664acfa469bbd491bf66466451a9ee3aac2b56a2f81fcdb0a2b6c84725f60ad5bb727b2c14eda1eb054fb92592" + }, + "title": { + "v": 4, + "i": { + "t": "rankings", + "c": "title" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACoLw9QzYPeYb2lWmo5koQrIAAWqW7Qj+fimzpnYilKdFOpSi5wedGlAhzFUlLDVfQXrgI200vJrAyvuyAWRolG7M4tS7aNYBt3umCJUE7DlkMSjIO3fe+U", + "hm": "0784eaafee80c50e6a9856e256e99dd536f50c9668cba8bfef433b7bf75e22d0", + "op": "00344fe120b7abb89fdad4d32c82054f71be09c4ac588f34f122f9c53b1fdf516a7cd4f4017f13ffd88a1757c19da753ff8eb398b6832378da3944d7e286e6cb345a82887f75e76591" + }, + "total": { + "v": 4, + "i": { + "t": "rankings", + "c": "total" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAADqzuNSUCG8WYJqEd0qG67nIAAN5uG4KA4yAHLXuPwfwCvXit4ti1MjxU/VymYIyK+Q9AKCtwW2fHKhvHt8T3IIrxXZAUpi7B02kqV6TuyK+8SRr5pGIgLH", + "op": "00f029fe2d68c79a0ca72ec21e5352a77673be1b39fae030898356ddae1d2cf9f0d771411be2b36c41f5215db20a3f965b37a8a6f7ff1e80c3be894eeb226759a2" + } + } + } + ] +} diff --git a/packages/eql/tests/encryption/fixtures/v4_queries.json b/packages/eql/tests/encryption/fixtures/v4_queries.json new file mode 100644 index 000000000..5b20273f4 --- /dev/null +++ b/packages/eql/tests/encryption/fixtures/v4_queries.json @@ -0,0 +1,32 @@ +{ + "_comment": "The v4 query operands eql-bindings derives for each plaintext under FakeDataKeySource's index key (keyset nil), read by the Go SDK's hermetic test; regenerate with EQL_UPDATE_FIXTURES=1, do not edit.", + "age": { + "plaintext": 42, + "query": "{\"v\":4,\"i\":{\"t\":\"profiles\",\"c\":\"age\"},\"hm\":\"ed60c97cff62963a142f9b7762de2e2b98e3d486a178b07f6e930318770fbecb\"}" + }, + "email": { + "plaintext": "alice@example.com", + "query": "{\"v\":4,\"i\":{\"t\":\"profiles\",\"c\":\"email\"},\"hm\":\"be863e717d95eecca3f32f53c3c4d397e3e2aefbc4e7e9d2a7a8a21ed539f4eb\"}" + }, + "name": { + "plaintext": "alice", + "query": "{\"v\":4,\"i\":{\"t\":\"profiles\",\"c\":\"name\"},\"bf\":[80,125,212,221,348,638,664,776,1141,1322,1400,1418,1532,1704,1762,1843,1865,1970]}" + }, + "price": { + "plaintext": 9.75, + "query": "{\"v\":4,\"i\":{\"t\":\"profiles\",\"c\":\"price\"},\"hm\":\"1b9f59331489691ca4eee0252b98b0863db3b8fbed9f0a0ba8df58f2bc7564ab\"}" + }, + "rank": { + "plaintext": 7, + "query": "{\"v\":4,\"i\":{\"t\":\"profiles\",\"c\":\"rank\"},\"hm\":\"54e9bd5b5c8620be147b65fe754240f64562d4ce62394b3e4390867f2ef483cc\"}" + }, + "table": "profiles", + "tally": { + "plaintext": -12, + "query": "{\"v\":4,\"i\":{\"t\":\"profiles\",\"c\":\"tally\"},\"hm\":\"7aeb7ba10d7f88d1c6ec1e4d819e20aa0460e2467eaf1c5829437126ecc72db3\"}" + }, + "weight": { + "plaintext": 1.5, + "query": "{\"v\":4,\"i\":{\"t\":\"profiles\",\"c\":\"weight\"},\"hm\":\"96cc94054dd2785dd2592355d2478ca4470d29e09b47637a99f7a91066c93f8b\"}" + } +} diff --git a/packages/eql/tests/encryption/fixtures/v4_rows.json b/packages/eql/tests/encryption/fixtures/v4_rows.json new file mode 100644 index 000000000..fe0350d4d --- /dev/null +++ b/packages/eql/tests/encryption/fixtures/v4_rows.json @@ -0,0 +1,309 @@ +{ + "_comment": "Profile rows sealed by the Go SDK's generated code over the deterministic EQL guest with the seed below; the Rust suite opens and queries them. Regenerate with EQL_UPDATE_FIXTURES=1 go test ./encrypt -run TestV4Rows, do not edit.", + "seed": "encrypt round-trip tests seed v1", + "table": "profiles", + "rows": [ + { + "id": 1, + "plaintext": { + "visits": 3, + "balance": 1234567890123, + "active": true, + "ratio": 0.5, + "score": 2.25, + "note": "a private note", + "name": "alice", + "age": 42, + "rank": 7, + "weight": 1.5, + "price": 9.75, + "email": "alice@example.com" + }, + "stored": { + "active": { + "v": 4, + "i": { + "t": "profiles", + "c": "active" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAA7z71FqWkCCWSkyPiBK7IQIAD0ug/nDu5R6UBEM9vJjtvDMBTuommRH359HgY7qUe5cAI8R/WLB3CY9crMLnjlRMj7ZX/QIZNLi5MW5kToWQ==" + }, + "age": { + "v": 4, + "i": { + "t": "profiles", + "c": "age" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACaqBouRs68ubIb5N1OQbmcIABm7QQMIr1TNGIweTMmGzZsXGuC+7f6J8hofUigXNGM5QIXIEdBIW5IurSiSx5HzqZvnrotMr1+3KjlzthAMHIvvIE=", + "hm": "ed60c97cff62963a142f9b7762de2e2b98e3d486a178b07f6e930318770fbecb" + }, + "balance": { + "v": 4, + "i": { + "t": "profiles", + "c": "balance" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAZJDEBcfVqv/o1B2CASJrAIAA9a/qD4wfv0t6fGVxDhKQOlQDIuYj5si13wnlmGENABAIe6fH9Sb5gE4xrlHbxz6s1zOCiH1sSBzwa5uH2y93Ys1a+6Jpy" + }, + "email": { + "v": 4, + "i": { + "t": "profiles", + "c": "email" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAABpGgQnFhUnk9qcPUWhvKEIAC6CJ3RRUPLWAn161DEhtppbrtiLrrTXmduDnF5M09OKQJa2RVzDu2NNyqt5/l1u9kG5X7sxu4fjTMW5WYjPqg5ANGdb9NQiwUT4zWCa1q9", + "hm": "be863e717d95eecca3f32f53c3c4d397e3e2aefbc4e7e9d2a7a8a21ed539f4eb" + }, + "name": { + "v": 4, + "i": { + "t": "profiles", + "c": "name" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAASxNA10KeHfMqSIglat8/GIADzC2+uswJkz9HL6DqUBBNDtGODBX5yNHLKryZ0Lgc24AKwBM3hLCQrq3TQdiRQ2Vet7Y4KpMASMdaDTbVj/IxxoBk9", + "bf": [ + 80, + 125, + 212, + 221, + 348, + 638, + 664, + 776, + 1141, + 1322, + 1400, + 1418, + 1532, + 1704, + 1762, + 1843, + 1865, + 1970 + ] + }, + "note": { + "v": 4, + "i": { + "t": "profiles", + "c": "note" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACaWtPMkbUZL3WUSHDD8aD7IADB6CfVElii+gglc1gys6JmpNlLoIFn47AvStPnpJb63wLqSJq3CPPfEcuk4FAAYNjdOI3c+WboMGXS9mtnvXU6oo6Z5ilrmcXXKVz5" + }, + "price": { + "v": 4, + "i": { + "t": "profiles", + "c": "price" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABCExNfO+rr+B8wqj1M0aD4IADBdFcMOac9Yl8IAruRLW/XvOYbrEvf8/b/qUk9C02FfwKQEVkiG/fD1XcE07FZw5DhX2d7FGd70dl4RRIpEpxawKrrbi5O", + "hm": "1b9f59331489691ca4eee0252b98b0863db3b8fbed9f0a0ba8df58f2bc7564ab" + }, + "rank": { + "v": 4, + "i": { + "t": "profiles", + "c": "rank" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABlWVkNzeHCBmpVMce0NgD6IAA4mPP/Krsok6Rmw3q0qARIDYCQpqM4GDID/zkILOkeKAITtr8Lvd32fXPL77WP4xwszhQ7Y3XUWPZi1Zrc/4y/uuc0GoIj", + "hm": "54e9bd5b5c8620be147b65fe754240f64562d4ce62394b3e4390867f2ef483cc" + }, + "ratio": { + "v": 4, + "i": { + "t": "profiles", + "c": "ratio" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAuHszuxtkGGxdJ+yeeEgrtIACJ8iRTZnq+2wD3LmxdAqmDDHzDzzH5th5lG8EQq4qujQIlWupvOk/JChjexCHZN84aas3l1ebC/xnJtnFakBf3xBs=" + }, + "score": { + "v": 4, + "i": { + "t": "profiles", + "c": "score" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAbQulFdQ7itXP4biDOHDhxIAA4jkCscZEzyZymEuOdqFk34IZ2lMPnDiYFZgGjl+Qh0gJpENZYDfXk2R+Ds8rrAf0lOc3wPoybrGliwYFSEPMCfUNxdpiT" + }, + "visits": { + "v": 4, + "i": { + "t": "profiles", + "c": "visits" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAFDIc6s4iXDM+dzEA4ntTLIACXLoQBRqkNqM7yC8syykzCq7A4M32xA4/pWvh7C8atkgJG/d9aHc0z9F0VWZXEEbdWQ81PgsCPBye7lT658p/FMbk=" + }, + "weight": { + "v": 4, + "i": { + "t": "profiles", + "c": "weight" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACKITYga2qq0YHkFjTZcJ+4IACohdycH28XrjPCTXO5ZxudPnwg9RQaee1GS8RdT/bMKwJD1lBYSPOBxwDcKYNLicjsOtuwGCIVGt5Iv1ljx7zLqBE=", + "hm": "96cc94054dd2785dd2592355d2478ca4470d29e09b47637a99f7a91066c93f8b" + } + } + }, + { + "id": 2, + "plaintext": { + "visits": 0, + "balance": -1, + "active": false, + "ratio": -1.5, + "score": 0, + "note": "", + "name": "bob smith", + "age": 42, + "rank": -7, + "weight": -1.5, + "price": 0, + "email": "bob@example.com" + }, + "stored": { + "active": { + "v": 4, + "i": { + "t": "profiles", + "c": "active" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAA7Bs/CwXfgNRto39Lx9+NRIABHtJq376CB/hOqvpsVBNMKQvZK+u8DZctSAfHYIGDJ5gKb0mM55orsh7Q91crIPnxhUuOtNNGCH/zKXBTB1w==" + }, + "age": { + "v": 4, + "i": { + "t": "profiles", + "c": "age" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACh4+loJGS/M8JmW2ApKV6nIADAGfla7KUqXluRKpP9grmSFsBXfT0fWr7EfDhM7U5yiwJB6rb+0tlqRWerM712Kw+GyRJvLTJwSh+K9OdiTRoJvS0=", + "hm": "ed60c97cff62963a142f9b7762de2e2b98e3d486a178b07f6e930318770fbecb" + }, + "balance": { + "v": 4, + "i": { + "t": "profiles", + "c": "balance" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABWRmeNqOZai+bzvH+RNm9vIAAXCtBDbAYEI0ZdSyTjqqxJFXDKcFcIPiKZBPhgJ0mPxQI+5Rahc0VQybsI4bj2TQ5awyRsldcn15j+73MrCujohwvff1id" + }, + "email": { + "v": 4, + "i": { + "t": "profiles", + "c": "email" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAQe7vNxSjEj8rjdP3gTsd0IABnormRqRK1U85ELaGOtxQcQ3104HBJRtsaR65nqh6nowIHdnYHzzrl/tifE3ItwSUJzpQDDcLNIR9uIQ0wegQvKQXeEANIN58cgypA3A==", + "hm": "aa75e5aec88e0ccaf381ccb43c0ae6b66d0d9b8a45fca4a69c9efd86ea54a1c0" + }, + "name": { + "v": 4, + "i": { + "t": "profiles", + "c": "name" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAwZi24blzEV0AaJGmb/J0qIACVuh0/kQa3DPQHliIZ/b8zwI984wmgU+Mt32WwdguPVQKTERddkynzo3iV0nTJ8S+xf9t8+w+eRCosiDjqR/YeVyJJ8I03zA==", + "bf": [ + 59, + 178, + 215, + 219, + 333, + 410, + 429, + 431, + 584, + 596, + 623, + 633, + 653, + 801, + 812, + 866, + 897, + 1140, + 1143, + 1217, + 1221, + 1222, + 1240, + 1284, + 1314, + 1329, + 1371, + 1497, + 1563, + 1586, + 1595, + 1680, + 1712, + 1735, + 1808, + 1837, + 1884, + 1933, + 1955, + 2036 + ] + }, + "note": { + "v": 4, + "i": { + "t": "profiles", + "c": "note" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACuX29oOy6CpQMDSRIGRRoBIAADpDaKPNDz33wT17X2TRr+o3CeIaf4IMCF5Bw2OlvxaQIEepseVeWQWt3sJl7boi6Sumw5y3Fuyh7dJZtYhg==" + }, + "price": { + "v": 4, + "i": { + "t": "profiles", + "c": "price" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAADToqGE1AlegXhlNE5k35dfIABV5S7PuJofUEoLo7O+I1gArQImBsFj7dEqGh5HAACRbAJOLvz0UwQSPhVK5gP6bsDnfTn3aVsZIsVQgiNlXpESFYq0Mn5q", + "hm": "b0b544178e92859e68e6435482637ae76bfd6603e503c4ded4881a89aaeb61d1" + }, + "rank": { + "v": 4, + "i": { + "t": "profiles", + "c": "rank" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAABN3Sq3cLE6lQeig3ZdclZIAAFAf0aegehK3EzNh26ugJ9SXl97H0DKaux6GLrZZTAZAK5EbnFV7feLytT5bAn3kVZ0MpikL4m46U/sG7Uw2CytICNGGrD", + "hm": "7b1dbcfc1a19eec19cbda0117985973da7f24dc77c7e97f88f63a948f904d49d" + }, + "ratio": { + "v": 4, + "i": { + "t": "profiles", + "c": "ratio" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABmRooB0kko8FAtEyMCWf7iIAAvxPzawHCl2UsixGJ0tT/wGIG88SOJfrus7QGNUEt6rALy2tEm4gW9/9bXWVkQ7G/SZmoiUEztVxT50eDD8VqLxxA=" + }, + "score": { + "v": 4, + "i": { + "t": "profiles", + "c": "score" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAADFAnZOcaaWD0Ds6Wua3ZztIABA88NJKfXIXC5zas/z1IOhmAyc8XchqZ+EDtNJ2/AWUwLAmK2961C6sZWuDZfliURb+pAi1VT8fwzDVCUibSHqhAim9aaZ" + }, + "visits": { + "v": 4, + "i": { + "t": "profiles", + "c": "visits" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAyLznie0nVoP3WyyvaA5RwIACy7ziBzTMFYlWykYyWE56nBiBsI4ypAZ5btWKCjM3L9ALmtY+UlDNDLH2SppZVLuHdjQaGiMY1c0vYeb3rnXnF/28=" + }, + "weight": { + "v": 4, + "i": { + "t": "profiles", + "c": "weight" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAAB9T5NWlQ6PpoRzz8qJSTWIAClBTm3e2VqrMS4xE6nyR3WjUGxsmdDo+fP14OS1pU0PgLvWwdJV5ojAykg+gxmhmduwOuGFFyDFTKmQCtPPLAoNvU=", + "hm": "e2a35073033a519f51db4adc9ee92fd470cfd6eefc5f4d4c72c9ecc0a9e4e6b9" + } + } + } + ] +} diff --git a/packages/eql/tests/encryption/fixtures/v4_smallint_rows.json b/packages/eql/tests/encryption/fixtures/v4_smallint_rows.json new file mode 100644 index 000000000..a5ccfee5c --- /dev/null +++ b/packages/eql/tests/encryption/fixtures/v4_smallint_rows.json @@ -0,0 +1,115 @@ +{ + "_comment": "Tally rows sealed by the Go SDK's generated code over the deterministic EQL guest with the seed below; the Rust suite opens and queries them. Regenerate with EQL_UPDATE_FIXTURES=1 go test ./encrypt -run TestV4SmallintRows, do not edit.", + "seed": "encrypt round-trip tests seed v1", + "table": "profiles", + "rows": [ + { + "id": 1, + "plaintext": { + "small": -32768, + "tally": -12, + "wide": -32768 + }, + "stored": { + "small": { + "v": 4, + "i": { + "t": "profiles", + "c": "small" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAD4LCrufuRD/FQY4TZFe6AfIACHiUuB0CJjJr+LbNxAwTa6nFzZsohMvYKuG0eEpQBCbgKf9AiLZjYMlO0juGQzOeX6KmJJlGAIEDEAdoDnsA72" + }, + "tally": { + "v": 4, + "i": { + "t": "profiles", + "c": "tally" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAADvGG8yu5085HD9Jm4QqutRIABdpCObhZDRQkCMnI2LxRF5VXligtVWiYIKNuwkApKOhgKuPx0Xh4na+BtvDwsTOE3PUvpIH16sh6KGbP67mou4", + "hm": "7aeb7ba10d7f88d1c6ec1e4d819e20aa0460e2467eaf1c5829437126ecc72db3" + }, + "wide": { + "v": 4, + "i": { + "t": "profiles", + "c": "wide" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACG2/FDPiPfbcgt2KR0n9s0IACH7cDAisfp79UHd5R5MnIYNc9nJHmEe9GA03PUrox54AKI8b2I7Oopv7wKeCbETVPc8n0KoR/eNqNGepjAv0fR", + "hm": "9f5bd412c1ec1d9e4f15369c64ce122ec845647246ca07955d7203fc96555624" + } + } + }, + { + "id": 2, + "plaintext": { + "small": 32767, + "tally": 7, + "wide": 32767 + }, + "stored": { + "small": { + "v": 4, + "i": { + "t": "profiles", + "c": "small" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABY92Lf6tGcgnCxPlh/N7fAIABg4YLpuiC4kQ3TFpot377ZfERfsdbGLyE3T8AOdj5eywIpGUbElbuwIdq+vZDbLOtnOSgRN1qzJYNZ97ZPnO0s" + }, + "tally": { + "v": 4, + "i": { + "t": "profiles", + "c": "tally" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAADJrvFsTc/RhAG3RKXlEdLZIADuWnjVDRcyIKSqfa1PHPcHJ5XGatPoW/q7+Bp+5kS53gIpPvaJ0mvH0fzO9cI0UQ/fCUAX4eVmBQGZFKyyZbG5", + "hm": "047ab2a408d78f27bcc929f822c158467c53876cde604a483c2b5cb7f2e39aab" + }, + "wide": { + "v": 4, + "i": { + "t": "profiles", + "c": "wide" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAACMOoUNfVb6x7EVb4wzgrTKIADuyS3Tll1IIW6pgUv4Cu2iDViH88RHa/FjC5gzNC5jYwJ790dlZc8MjWj1aN3o4Uo0LA0JAnxXgIckJoJGNPSN", + "hm": "8b20978328a93915cf589e8c74fb9028c80b58e461c51314df8d51fe9a36c077" + } + } + }, + { + "id": 3, + "plaintext": { + "small": 0, + "tally": -12, + "wide": -1 + }, + "stored": { + "small": { + "v": 4, + "i": { + "t": "profiles", + "c": "small" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAABYn3RZE90JwspcrV/psve/IACtxdWMfY3cnahhwVmZ+IPpuLhGNVGQnLoU7NkXgJlQlwItsLZHfwkaJ2TywKUBlwsCRmQow0ldmAvx6BDhKpgw" + }, + "tally": { + "v": 4, + "i": { + "t": "profiles", + "c": "tally" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAA1m/PV0eKPMIRerBIYOsnNIABDbUnDV8SPoZNssOuZHnrbBGKhHmWWtLI7MMqCzLZPrQK5dHwUPznYOntuuLR4pnGbLPuPJK4y/0iieiRNHtfv", + "hm": "7aeb7ba10d7f88d1c6ec1e4d819e20aa0460e2467eaf1c5829437126ecc72db3" + }, + "wide": { + "v": 4, + "i": { + "t": "profiles", + "c": "wide" + }, + "c": "stack-encrypt:1:AQAAAAAAAAAAAAAAAAAAAAApfEecjt2IZoP2fHX11pmUIABuRiSfGGi7UIxZHX7tMXh1g5Wzr6lMP48A3l7vIgRwwQI8A1k4j6jffo1R1lwun47UMgH9i4hpRwFfA51gNg2W", + "hm": "ffbbb89c5fc4e850a711ab9547c6eaca24b68f408346591d8032a60488130f87" + } + } + } + ] +} diff --git a/packages/eql/tests/encryption/tests/heap_hygiene.rs b/packages/eql/tests/encryption/tests/heap_hygiene.rs new file mode 100644 index 000000000..32b553e3b --- /dev/null +++ b/packages/eql/tests/encryption/tests/heap_hygiene.rs @@ -0,0 +1,213 @@ +//! No heap block an EQL target's encrypt, decrypt or query frees still +//! holds plaintext. +//! +//! This binary installs its own global allocator: a spy that, while a test +//! watches its own thread, scans every block freed on that thread for a +//! marker the test's plaintext carries, and fails the test on one. It is the +//! regression test for the opened `String` an EQL decrypt used to free +//! unwiped (`Plaintext::into_frame`), and holds every text target's three +//! paths to the same rule. stack-encrypt's `tests/heap_hygiene.rs` holds +//! its dynamic paths the same way. +//! +//! One free is excluded by name: vitaminc-encrypt 0.6.0's aws-lc backend +//! (`backend::aws_lc::CipherKey::seal`, native builds only) frees an unwiped +//! plaintext buffer on every seal. That is vitaminc's to fix; the spy +//! recognises those frees by their backtrace, so a build without symbols +//! fails rather than passes. + +//! +//! Unix only: the spy scans a freed block with libc's `memmem`, not as a +//! Rust slice (see [`holds_mark`]). +#![cfg(unix)] + +use std::alloc::{GlobalAlloc, Layout, System}; +use std::cell::Cell; +use std::ffi::c_void; +use std::sync::Mutex; + +use eql_bindings::encryption::targets; +use stack_encrypt::dynamic::ValueFrame; +use stack_encrypt::{Label, StackCipher}; +use stack_kms::FakeDataKeySource; + +/// What every plaintext under test carries. +const MARK: &[u8] = b"zq-heap-marker-7f3a9c"; + +thread_local! { + static WATCHING: Cell = const { Cell::new(false) }; + static BUSY: Cell = const { Cell::new(false) }; +} + +/// Held for the whole of a watch: the test harness runs tests on several +/// threads, and the findings below are one set. +static GATE: Mutex<()> = Mutex::new(()); + +/// The marked frees seen, as backtraces; and how many were vitaminc's. +static FOUND: Mutex> = Mutex::new(Vec::new()); +static UPSTREAM: Mutex = Mutex::new(0); + +/// The vitaminc frame whose free is excluded (see the module docs). +const UPSTREAM_SEAL: &str = "vitaminc_encrypt::backend::aws_lc::CipherKey::seal"; + +/// Whether the `len` bytes at `ptr` hold [`MARK`]. A freed block can hold +/// bytes Rust never initialised (a `Vec`'s spare capacity, a struct's +/// padding), and reading those through a `&[u8]` is undefined behaviour, so +/// the scan is libc's `memmem`, which reads the block as plain memory. +/// +/// # Safety +/// +/// `ptr` must point to `len` allocated bytes. +unsafe fn holds_mark(ptr: *const u8, len: usize) -> bool { + extern "C" { + fn memmem( + haystack: *const c_void, + haystack_len: usize, + needle: *const c_void, + needle_len: usize, + ) -> *mut c_void; + } + !memmem(ptr.cast(), len, MARK.as_ptr().cast(), MARK.len()).is_null() +} + +struct Spy; + +unsafe impl GlobalAlloc for Spy { + unsafe fn alloc(&self, layout: Layout) -> *mut u8 { + System.alloc(layout) + } + + unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { + let watching = WATCHING.with(Cell::get) && !BUSY.with(Cell::get); + if watching { + // SAFETY: `ptr` is a live block of `layout.size()` bytes until + // the `System.dealloc` below. + if holds_mark(ptr, layout.size()) { + BUSY.with(|busy| busy.set(true)); + let trace = std::backtrace::Backtrace::force_capture().to_string(); + // Symbol demangling differs by platform: Linux writes + // `<…::CipherKey>::seal`, macOS `…::CipherKey::seal`. Match + // with the angle brackets dropped. + if trace.replace(['<', '>'], "").contains(UPSTREAM_SEAL) { + *UPSTREAM.lock().unwrap() += 1; + } else { + FOUND + .lock() + .unwrap() + .push(format!("{} bytes freed unwiped:\n{trace}", layout.size())); + } + BUSY.with(|busy| busy.set(false)); + } + } + System.dealloc(ptr, layout) + } +} + +#[global_allocator] +static SPY: Spy = Spy; + +/// Run `f` with this thread watched, and fail if any block it freed held +/// the marker. +fn watched(what: &str, f: impl FnOnce() -> T) -> T { + let _gate = GATE.lock().unwrap_or_else(|poisoned| poisoned.into_inner()); + FOUND.lock().unwrap().clear(); + *UPSTREAM.lock().unwrap() = 0; + WATCHING.with(|on| on.set(true)); + let out = f(); + WATCHING.with(|on| on.set(false)); + let found = std::mem::take(&mut *FOUND.lock().unwrap()); + let upstream = std::mem::take(&mut *UPSTREAM.lock().unwrap()); + if upstream > 0 { + eprintln!("{what}: skipped {upstream} unwiped frees in vitaminc's aws-lc seal"); + } + assert!( + found.is_empty(), + "{what}: {} heap blocks were freed with plaintext in them:\n{}", + found.len(), + found.join("\n---\n") + ); + out +} + +fn marked(tail: &str) -> String { + format!("{}-{tail}", std::str::from_utf8(MARK).unwrap()) +} + +fn text(value: &str) -> ValueFrame { + ValueFrame::of(value).unwrap() +} + +fn runtime() -> tokio::runtime::Runtime { + tokio::runtime::Builder::new_current_thread() + .build() + .unwrap() +} + +/// The producible EQL types over text, each with whether it has a query. +const TEXT_TARGETS: [(&str, bool); 3] = [("Text", false), ("TextEq", true), ("TextMatch", true)]; + +#[test] +fn a_text_target_leaves_no_plaintext_on_the_heap() { + let rt = runtime(); + let cipher = rt.block_on(async { + StackCipher::builder() + .kms(FakeDataKeySource::new()) + .init() + .await + .unwrap() + }); + let keyset = cipher.default_keyset(); + let label = Label::new(["users", "email"]).unwrap(); + for (name, has_query) in TEXT_TARGETS { + let plaintext = text(&marked("stored")); + let stored = watched(&format!("{name} encrypt"), || { + rt.block_on(async { + targets::encrypt(name, &keyset, &label, plaintext) + .unwrap() + .await + .unwrap() + }) + }); + watched(&format!("{name} decrypt"), || { + let opened = rt.block_on(async { + targets::decrypt(name, &cipher, &label, &stored) + .unwrap() + .await + .unwrap() + }); + assert!(opened + .risky_ref() + .windows(MARK.len()) + .any(|window| window == MARK)); + drop(opened); + }); + watched(&format!("{name} decrypt (keyset)"), || { + let opened = rt.block_on(async { + targets::decrypt(name, &keyset, &label, &stored) + .unwrap() + .await + .unwrap() + }); + drop(opened); + }); + if has_query { + let query = text(&marked("query")); + watched(&format!("{name} query"), || { + rt.block_on(async { + targets::query(name, &keyset, &label, query) + .unwrap() + .await + .unwrap() + }) + }); + } + } +} + +/// The spy itself: a plain `String` holding the marker, freed while +/// watched, fails the watch. +#[test] +#[should_panic(expected = "freed with plaintext in them")] +fn the_spy_sees_an_unwiped_free() { + let text = marked("control"); + watched("control", || drop(text)); +} diff --git a/packages/eql/tests/encryption/tests/targets.rs b/packages/eql/tests/encryption/tests/targets.rs index e5528b43a..ad3020dba 100644 --- a/packages/eql/tests/encryption/tests/targets.rs +++ b/packages/eql/tests/encryption/tests/targets.rs @@ -6,11 +6,16 @@ mod common; use eql_bindings::encryption::targets::{self as targets, Opener, Target, TargetError}; -use eql_bindings::v3::text::{TextEq, TextEqQuery}; -use eql_bindings::{v3, Identifier}; +use eql_bindings::v4::text::{TextEq, TextEqQuery}; +use eql_bindings::{v4, Identifier}; use eql_domains::{Shape, Term, CATALOG}; -use stack_encrypt::Label; -use vitaminc_aead_value::{FfiValue, ValueKind}; +use stack_encrypt::dynamic::{ValueFrame, ValueKind}; +use stack_encrypt::{Decrypt, Encrypt, Label}; + +/// A Rust value as the engine's runtime plaintext: its frame. +fn frame(value: T) -> ValueFrame { + ValueFrame::of(value).unwrap() +} fn email() -> Label { Label::new(["users", "email"]).unwrap() @@ -20,15 +25,16 @@ fn column() -> stack_encrypt::NonEmpty { Identifier::for_column("users", "email").unwrap() } -fn text(value: &str) -> FfiValue { - FfiValue::String(value.into()) +fn text(value: &str) -> ValueFrame { + frame(value) } -fn opened(value: FfiValue) -> String { - match value { - FfiValue::String(s) => std::str::from_utf8(s.risky_ref()).unwrap().to_owned(), - other => panic!("a text target opens to a string, not {:?}", other.kind()), - } +/// An opened frame read as text; any other kind fails the test. +fn opened(value: ValueFrame) -> String { + let kind = value.kind(); + value + .visit(String::sink()) + .unwrap_or_else(|_| panic!("a text target opens to a string, not {kind:?}")) } /// The refusal a dispatch returned. `Pending` has no `Debug`, so this stands @@ -235,12 +241,7 @@ mod given_text_eq { async fn refuses_a_value_of_another_kind_before_minting() { let (cipher, calls) = common::cipher().await; let keyset = cipher.default_keyset(); - let error = refused(targets::encrypt( - "TextEq", - &keyset, - &email(), - FfiValue::UInt64(34), - )); + let error = refused(targets::encrypt("TextEq", &keyset, &email(), frame(34u64))); assert!( matches!( error, @@ -252,7 +253,12 @@ mod given_text_eq { ), "{error}" ); - let error = refused(targets::query("TextEq", &keyset, &email(), FfiValue::Null)); + let error = refused(targets::query( + "TextEq", + &keyset, + &email(), + frame(None::), + )); assert!( matches!(error, TargetError::Plaintext { found: None, .. }), "{error}" @@ -284,6 +290,36 @@ mod given_text_eq { } } + /// Earlier builds wrote Stack Encrypt payloads with `"v": 3` and the same + /// ciphertext prefix. A real, well-formed v4 payload with only its version + /// changed is refused, so the version alone is what refuses it. + #[tokio::test] + async fn refuses_a_stored_payload_of_the_other_version() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + let stored = targets::encrypt("TextEq", &keyset, &email(), text("secret")) + .unwrap() + .await + .unwrap(); + let mut payload: serde_json::Value = serde_json::from_slice(&stored).unwrap(); + assert_eq!(payload["v"], 4); + payload["v"] = 3.into(); + let as_v3 = serde_json::to_vec(&payload).unwrap(); + + let error = refused(targets::decrypt("TextEq", &cipher, &email(), &as_v3)); + assert!( + matches!( + error, + TargetError::Stored { + target: "TextEq", + .. + } + ), + "{error}" + ); + assert!(error.to_string().contains("version 3"), "{error}"); + } + #[tokio::test] async fn refuses_a_label_that_is_not_a_column() { let (cipher, _) = common::cipher().await; @@ -329,15 +365,15 @@ mod given_a_name_the_engine_cannot_produce { let error = refused(targets::encrypt("TextOrdOre", &keyset, &email(), text("x"))); assert_eq!( error.to_string(), - "the engine cannot produce TextOrdOre yet: EQL stores a block ORE term and the engine \ - derives a CLLW ORE term; the two are different algorithms" + "the engine cannot produce TextOrdOre yet: EQL stores block ORE terms and the engine \ + derives CLLW ORE (#1132)" ); // Refused by name before the label or the value is looked at. let error = refused(targets::encrypt( "TextOrdOre", &keyset, &Label::new(["one"]).unwrap(), - FfiValue::Null, + frame(None::), )); assert!(matches!(error, TargetError::Unproducible { .. }), "{error}"); let calls = calls.lock().unwrap(); @@ -420,7 +456,7 @@ mod the_table { assert_eq!(row.family, family.name, "{name}: family"); assert_eq!( row.sql_domain, - format!("public.{}", domain.sql_typname(family.name)), + format!("public.eql_v4_{}", domain.full_name(family.name)), "{name}: stored domain" ); let indexes: Vec<&str> = if matches!(domain.shape, Shape::SteVec) { @@ -442,14 +478,28 @@ mod the_table { }) .collect(); assert_eq!(row.suffix, suffix, "{name}: suffix"); + let kind = match family.name { + "text" => Some(ValueKind::String), + "smallint" => Some(ValueKind::Int16), + "integer" => Some(ValueKind::Int32), + "bigint" => Some(ValueKind::Int64), + "boolean" => Some(ValueKind::Bool), + "real" => Some(ValueKind::Float32), + "double" => Some(ValueKind::Float64), + "date" => Some(ValueKind::Date), + "timestamp" => Some(ValueKind::Timestamp), + "numeric" => Some(ValueKind::Decimal), + // The rest have no Rust plaintext type in eql-bindings yet. + _ => None, + }; assert_eq!( row.plaintext, - (family.name == "text").then_some("string"), - "{name}: only text's plaintext encoding is specified" + kind.map(ValueKind::name), + "{name}: the family's plaintext kind" ); assert_eq!( row.plaintext_kind(), - (family.name == "text").then_some(ValueKind::String), + kind, "{name}: the plaintext name is a vitaminc kind" ); if matches!(domain.shape, Shape::SteVec) { @@ -458,7 +508,7 @@ mod the_table { Some("SteVecQuery"), "{name}: the containment needle" ); - assert_eq!(row.query_sql_domain, Some("eql_v3.query_json"), "{name}"); + assert_eq!(row.query_sql_domain, Some("eql_v4.query_json"), "{name}"); } else if domain.terms.is_empty() { assert_eq!( (row.query, row.query_sql_domain), @@ -473,7 +523,7 @@ mod the_table { ); assert_eq!( row.query_sql_domain.map(str::to_owned), - Some(format!("eql_v3.{}", domain.query_name(family.name))), + Some(format!("eql_v4.{}", domain.query_name(family.name))), "{name}: query domain" ); } @@ -482,9 +532,21 @@ mod the_table { #[test] fn every_row_is_a_compiled_domain_type_and_so_is_its_query() { - let stored: Vec<&str> = v3::all().iter().map(|d| d.sql_domain()).collect(); - let queries: Vec<&str> = v3::all_query().iter().map(|d| d.sql_domain()).collect(); + let stored: Vec<&str> = v4::all().iter().map(|d| d.sql_domain()).collect(); + let queries: Vec<&str> = v4::all_query().iter().map(|d| d.sql_domain()).collect(); + // v4 has no SteVec bindings yet, so the SteVec rows (the document + // and its `SteVecQuery` needle) have no compiled type behind them. + // They must stay unproducible, so neither Rust's `encrypt`/`query` + // nor a generator such as Go's can select them. for row in targets::targets() { + if row.query == Some("SteVecQuery") { + assert!( + !row.producible, + "{}: a SteVec row has no v4 type and must not be producible", + row.name + ); + continue; + } assert!( stored.contains(&row.sql_domain), "{}: {} is in all()", @@ -492,10 +554,8 @@ mod the_table { row.sql_domain ); if let Some(query) = row.query_sql_domain { - // The SteVec needle is in `all()`, not `all_query()`: it is - // a hand-written document shape, not a scalar twin. assert!( - queries.contains(&query) || stored.contains(&query), + queries.contains(&query), "{}: {query} is a compiled domain type", row.name ); @@ -503,8 +563,12 @@ mod the_table { } } + /// The types the engine produces in EQL v4 today: the storage and + /// equality domains of every family whose plaintext eql-bindings names, + /// the OPE-ordered domains of those the engine derives an order term + /// for, and text match. #[test] - fn text_eq_is_the_one_producible_type_today() { + fn the_producible_types_are_the_ones_with_no_ore_and_a_rust_plaintext() { let producible: Vec<&str> = targets::targets() .iter() .filter(|t| t.producible) @@ -512,18 +576,52 @@ mod the_table { .collect(); assert_eq!( producible, - ["TextEq"], - "the plan's list: the engine produces TextEq only" + [ + "Integer", + "IntegerEq", + "IntegerOrd", + "IntegerOrdOpe", + "Smallint", + "SmallintEq", + "SmallintOrd", + "SmallintOrdOpe", + "Bigint", + "BigintEq", + "BigintOrd", + "BigintOrdOpe", + "Date", + "DateEq", + "Timestamp", + "TimestampEq", + "Numeric", + "NumericEq", + "Text", + "TextEq", + "TextMatch", + "TextOrd", + "TextOrdOpe", + "Boolean", + "Real", + "RealEq", + "RealOrd", + "RealOrdOpe", + "Double", + "DoubleEq", + "DoubleOrd", + "DoubleOrdOpe" + ], ); for row in targets::targets().iter().filter(|t| !t.producible) { let reason = row.reason.expect("an unproducible type has a reason"); let expected = match (row.family, row.suffix) { ("json", "Search") => "JSON index", - (family, _) if family != "text" => "encodes a plaintext", - (_, "OrdOre" | "SearchOre") => "CLLW", - (_, "Match" | "Ord" | "OrdOpe" | "Search") => "no EQL type is built", - (_, "") => "storage-only", - (_, suffix) => panic!("{}: unexpected text suffix {suffix}", row.name), + ("json", "") => "tree of leaves", + ("date" | "timestamp" | "numeric", "Ord" | "OrdOpe" | "OrdOre") => { + "no order term for a date, timestamp or decimal yet" + } + (_, "OrdOre" | "SearchOre") => "derives CLLW ORE (#1132)", + ("text", "Search") => "carries a match term", + (family, suffix) => panic!("{}: unexpected {family} {suffix}", row.name), }; assert!(reason.contains(expected), "{}: {reason}", row.name); } @@ -541,15 +639,15 @@ mod the_table { "family": "text", "suffix": "Eq", "plaintext": "string", - "sql_domain": "public.eql_v3_text_eq", + "sql_domain": "public.eql_v4_text_eq", "indexes": ["eq"], "query": "TextEqQuery", - "query_sql_domain": "eql_v3.query_text_eq", + "query_sql_domain": "eql_v4.query_text_eq", "producible": true, "reason": null }) ); - let row = targets::target("Integer").unwrap(); + let row = targets::target("Json").unwrap(); let json = serde_json::to_value(row).unwrap(); assert_eq!( json["plaintext"], diff --git a/packages/eql/tests/encryption/tests/text_eq.rs b/packages/eql/tests/encryption/tests/text_eq.rs index 86a2a2395..9e77000b6 100644 --- a/packages/eql/tests/encryption/tests/text_eq.rs +++ b/packages/eql/tests/encryption/tests/text_eq.rs @@ -3,10 +3,12 @@ mod common; use base64::{engine::general_purpose::STANDARD, Engine as _}; use eql_bindings::encryption::NativeCiphertextVisitor as NativeLeaf; use eql_bindings::v3::terms::{Ciphertext, Hmac256}; -use eql_bindings::v3::text::{TextEq, TextEqQuery}; -use eql_bindings::{Identifier, SchemaVersion}; +use eql_bindings::v4::text::{TextEq, TextEqQuery}; +use eql_bindings::v4::SchemaVersion; +use eql_bindings::Identifier; use stack_encrypt::target::transcode::{Reader, Transcode}; -use stack_encrypt::{Cipher, Encrypt, IntoAad, NonEmpty}; +use stack_encrypt::{Encrypt, NonEmpty}; +use vitaminc_aead::plaintext::Sink; fn column() -> NonEmpty { Identifier::for_column("users", "email").unwrap() @@ -27,11 +29,12 @@ async fn text_round_trips_through_json_and_both_canonical_directions() { let value = text.to_owned(); let stored: TextEq = keyset.encrypt_as(&value, column()).await.unwrap(); let json = serde_json::to_value(&stored).unwrap(); - assert_eq!(json["v"], 3); + assert_eq!(json["v"], 4, "Stack Encrypt writes EQL v4"); assert_eq!(json["i"], serde_json::json!({"t":"users", "c":"email"})); assert_eq!(json.as_object().unwrap().len(), 4); - // The marker is the only thing that separates this producer profile - // from cipherstash-client ciphertext in the same column. Encryption + // The marker is what separates this producer profile from + // cipherstash-client ciphertext inside the payload; the `eql_v4` + // domain separates them in the database. Encryption // and decryption read one constant, so a round trip cannot notice it // changing; rows written under the old text would then stop opening. let encoded = json["c"].as_str().unwrap(); @@ -118,13 +121,26 @@ async fn independent_queries_match_native_terms_without_requesting_data_keys() { let json = serde_json::to_value(&query).unwrap(); assert!(json.get("c").is_none()); assert_eq!(serde_json::from_value::(json).unwrap(), query); - for different in ["CAFÉ", "cafe\u{301}", "café "] { - let probe: TextEqQuery = reader - .default_keyset() - .encrypt_as(&different.to_owned(), column()) - .await - .unwrap(); - assert_ne!(query.hm, probe.hm, "no added normalization or case folding"); + let probe = |text: &str| { + let text = text.to_owned(); + let keyset = reader.default_keyset(); + async move { + let probe: TextEqQuery = keyset.encrypt_as(&text, column()).await.unwrap(); + probe.hm + } + }; + // Unicode 16 NFC: the same text in its other normal form is one value. + assert_eq!( + probe("cafe\u{301}").await, + probe("caf\u{e9}").await, + "text is compared in NFC" + ); + for different in ["CAFÉ", "café "] { + assert_ne!( + query.hm, + probe(different).await, + "no case folding or trimming" + ); } let calls = calls.lock().unwrap(); assert!(calls.generate.is_empty()); @@ -289,12 +305,13 @@ async fn a_column_batches_generation_and_retrieval_under_the_same_descriptors() #[derive(Clone)] struct WithoutSerde(String); impl Encrypt for WithoutSerde { - fn encrypt_with_aad<'a, C: Cipher, A: IntoAad<'a>>( - self, - cipher: C, - aad: A, - ) -> Result { - self.0.encrypt_with_aad(cipher, aad) + fn visit(self, sink: S) -> Result { + self.0.visit(sink) + } +} +impl Encrypt for &WithoutSerde { + fn visit(self, sink: S) -> Result { + (&self.0).visit(sink) } } #[tokio::test] @@ -313,9 +330,9 @@ async fn leaf_transcoding_requires_no_serde_and_refuses_container_shapes() { .is_err()); } -/// Needs an EQL v3 installation; uses fresh real ciphertext with a fake key source. +/// Needs an EQL v4 installation; uses fresh real ciphertext with a fake key source. #[test] -#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v3 database"] +#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v4 database"] fn postgres_stores_queries_indexes_and_returns_decryptable_text() { let runtime = tokio::runtime::Builder::new_current_thread() .enable_all() @@ -329,8 +346,8 @@ fn postgres_stores_queries_indexes_and_returns_decryptable_text() { ) .unwrap(); db.batch_execute( - "CREATE TEMP TABLE text_eq_roundtrip (id int PRIMARY KEY, email public.eql_v3_text_eq); - CREATE INDEX text_eq_email_idx ON text_eq_roundtrip (eql_v3.eq_term(email));", + "CREATE TEMP TABLE text_eq_roundtrip (id int PRIMARY KEY, email public.eql_v4_text_eq); + CREATE INDEX text_eq_email_idx ON text_eq_roundtrip (eql_v4.eq_term(email));", ) .unwrap(); for (id, value) in [ @@ -344,7 +361,7 @@ fn postgres_stores_queries_indexes_and_returns_decryptable_text() { .unwrap(); let json = serde_json::to_string(&record).unwrap(); db.execute( - "INSERT INTO text_eq_roundtrip VALUES ($1, $2::text::jsonb::public.eql_v3_text_eq)", + "INSERT INTO text_eq_roundtrip VALUES ($1, $2::text::jsonb::public.eql_v4_text_eq)", &[&id, &json], ) .unwrap(); @@ -359,7 +376,7 @@ fn postgres_stores_queries_indexes_and_returns_decryptable_text() { }) .unwrap(); let json = serde_json::to_string(&query).unwrap(); - let rows = db.query("SELECT id, email::text FROM text_eq_roundtrip WHERE email = $1::text::jsonb::eql_v3.query_text_eq ORDER BY id", &[&json]).unwrap(); + let rows = db.query("SELECT id, email::text FROM text_eq_roundtrip WHERE email = $1::text::jsonb::eql_v4.query_text_eq ORDER BY id", &[&json]).unwrap(); assert_eq!( rows.iter().map(|r| r.get::<_, i32>(0)).collect::>(), [1, 3] @@ -371,7 +388,7 @@ fn postgres_stores_queries_indexes_and_returns_decryptable_text() { .unwrap(); assert_eq!(value, "alice@example.com"); } - let different = db.query("SELECT id FROM text_eq_roundtrip WHERE email <> $1::text::jsonb::eql_v3.query_text_eq ORDER BY id", &[&json]).unwrap(); + let different = db.query("SELECT id FROM text_eq_roundtrip WHERE email <> $1::text::jsonb::eql_v4.query_text_eq ORDER BY id", &[&json]).unwrap(); assert_eq!( different .iter() @@ -380,7 +397,7 @@ fn postgres_stores_queries_indexes_and_returns_decryptable_text() { [2, 4] ); db.batch_execute("SET enable_seqscan = off").unwrap(); - let plan = db.query("EXPLAIN SELECT * FROM text_eq_roundtrip WHERE email = $1::text::jsonb::eql_v3.query_text_eq", &[&json]).unwrap(); + let plan = db.query("EXPLAIN SELECT * FROM text_eq_roundtrip WHERE email = $1::text::jsonb::eql_v4.query_text_eq", &[&json]).unwrap(); assert!( plan.iter() .any(|r| r.get::<_, &str>(0).contains("text_eq_email_idx")), diff --git a/packages/eql/tests/encryption/tests/v4_date_time_numeric.rs b/packages/eql/tests/encryption/tests/v4_date_time_numeric.rs new file mode 100644 index 000000000..8026446eb --- /dev/null +++ b/packages/eql/tests/encryption/tests/v4_date_time_numeric.rs @@ -0,0 +1,909 @@ +//! The EQL v4 date, timestamp and numeric types Stack Encrypt produces: +//! each family's storage-only type (`Date`, `Timestamp`, `Numeric`) and its +//! equality type (`DateEq`, `TimestampEq`, `NumericEq`), from eql-bindings' +//! own plaintexts (`v4::plaintext`). Their ordered types wait for the +//! engine's order terms and are refused. +//! +//! Each type must round-trip through both entry points, seal the leaf a +//! chrono or rust_decimal value of the same instant, day or number seals +//! (what any other producer writes for that kind), open a leaf such a value +//! sealed, and refuse a value of another kind. The Go SDK's rows +//! (`fixtures/v4_ledger_rows.json`) open here and are queried in +//! PostgreSQL with the queries this file derives +//! (`fixtures/v4_ledger_queries.json`). + +mod common; + +use std::str::FromStr; + +use chrono::{DateTime, NaiveDate, Utc}; +use eql_bindings::encryption::targets::{self as targets, TargetError}; +use eql_bindings::encryption::NativeCiphertextVisitor as NativeLeaf; +use eql_bindings::v3::terms::Ciphertext; +use eql_bindings::v4::plaintext::{Date, Decimal, Timestamp}; +use eql_bindings::v4::{date, numeric, timestamp}; +use eql_bindings::Identifier; +use serde::de::DeserializeOwned; +use stack_encrypt::dynamic::{ValueFrame, ValueKind}; +use stack_encrypt::target::transcode::Reader; +use stack_encrypt::{Encrypt, Label, NonEmpty}; + +fn frame(value: T) -> ValueFrame { + ValueFrame::of(value).unwrap() +} + +fn same(a: &ValueFrame, b: &ValueFrame) -> bool { + a.risky_ref() == b.risky_ref() +} + +fn column() -> NonEmpty { + Identifier::for_column("profiles", "entry").unwrap() +} + +fn label() -> Label { + Label::new(["profiles", "entry"]).unwrap() +} + +fn refused(result: Result) -> TargetError { + match result { + Err(error) => error, + Ok(_) => panic!("the dispatch accepted what it should have refused"), + } +} + +fn day(text: &str) -> NaiveDate { + NaiveDate::from_str(text).unwrap() +} + +fn instant(text: &str) -> DateTime { + DateTime::parse_from_rfc3339(text).unwrap().to_utc() +} + +fn number(text: &str) -> rust_decimal::Decimal { + rust_decimal::Decimal::from_str(text).unwrap() +} + +/// What a stored `c` opens to as a frame, without any EQL type: the leaf +/// as another producer would read it. +async fn as_frame( + cipher: &stack_encrypt::StackCipher, + c: Ciphertext, +) -> ValueFrame { + let native = c.read(NativeLeaf).unwrap(); + cipher.decrypt(native, column()).await.unwrap() +} + +async fn by_name( + keyset: &stack_encrypt::KeysetCipher<'_, common::Observed>, + name: &str, + value: ValueFrame, +) -> T { + let bytes = targets::encrypt(name, keyset, &label(), value) + .unwrap() + .await + .unwrap(); + serde_json::from_slice(&bytes).unwrap() +} + +/// The `hm` of `name` over `value`, through the by-name query dispatch. +async fn hm( + keyset: &stack_encrypt::KeysetCipher<'_, common::Observed>, + name: &str, + value: ValueFrame, +) -> String { + let bytes = targets::query(name, keyset, &label(), value) + .unwrap() + .await + .unwrap(); + let json: serde_json::Value = serde_json::from_slice(&bytes).unwrap(); + json["hm"].as_str().unwrap().to_owned() +} + +#[tokio::test] +async fn dates_round_trip_and_seal_the_leaf_a_naive_date_seals() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + for text in ["2024-02-29", "1969-12-31", "0001-01-01", "1970-01-01"] { + let theirs = day(text); + let value = Date::from(theirs); + let stored: date::Date = keyset.encrypt_as(&value, column()).await.unwrap(); + let opened: Date = cipher + .decrypt_as(stored.clone(), column().into()) + .await + .unwrap(); + assert_eq!(NaiveDate::from(&opened), theirs, "{text}"); + assert!( + same(&as_frame(&cipher, stored.c.clone()).await, &frame(theirs)), + "{text}: the leaf a NaiveDate seals" + ); + + let searchable: date::DateEq = keyset.encrypt_as(&value, column()).await.unwrap(); + let named: date::DateEq = by_name(&keyset, "DateEq", frame(theirs)).await; + assert_eq!(searchable.hm, named.hm, "{text}: one term on both paths"); + let opened = targets::decrypt( + "DateEq", + &cipher, + &label(), + &serde_json::to_vec(&named).unwrap(), + ) + .unwrap() + .await + .unwrap(); + assert!(same(&opened, &frame(theirs)), "{text}: by name"); + } + for edge in [NaiveDate::MIN, NaiveDate::MAX] { + let stored: date::DateEq = keyset + .encrypt_as(&Date::from(edge), column()) + .await + .unwrap(); + let opened: Date = cipher.decrypt_as(stored, column().into()).await.unwrap(); + assert_eq!(NaiveDate::from(&opened), edge); + } +} + +#[tokio::test] +async fn timestamps_round_trip_to_the_nanosecond_and_seal_the_leaf_a_date_time_seals() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + for text in [ + "2024-02-29T12:34:56.123456789Z", + "1969-12-31T23:59:59.999999999Z", + "1970-01-01T00:00:00Z", + ] { + let theirs = instant(text); + let value = Timestamp::try_from(theirs).unwrap(); + let stored: timestamp::Timestamp = keyset.encrypt_as(&value, column()).await.unwrap(); + let opened: Timestamp = cipher + .decrypt_as(stored.clone(), column().into()) + .await + .unwrap(); + assert_eq!(DateTime::::from(&opened), theirs, "{text}"); + assert!( + same(&as_frame(&cipher, stored.c.clone()).await, &frame(theirs)), + "{text}: the leaf a DateTime seals" + ); + + let searchable: timestamp::TimestampEq = keyset.encrypt_as(&value, column()).await.unwrap(); + let named: timestamp::TimestampEq = by_name(&keyset, "TimestampEq", frame(theirs)).await; + assert_eq!(searchable.hm, named.hm, "{text}: one term on both paths"); + let opened: Timestamp = cipher + .decrypt_as(searchable, column().into()) + .await + .unwrap(); + assert_eq!( + DateTime::::from(&opened), + theirs, + "{text}: nanoseconds kept" + ); + } + for edge in [ + chrono::NaiveDateTime::MIN.and_utc(), + chrono::NaiveDateTime::MAX.and_utc(), + ] { + let stored: timestamp::TimestampEq = keyset + .encrypt_as(&Timestamp::try_from(edge).unwrap(), column()) + .await + .unwrap(); + let opened: Timestamp = cipher.decrypt_as(stored, column().into()).await.unwrap(); + assert_eq!(DateTime::::from(&opened), edge); + } +} + +#[tokio::test] +async fn decimals_round_trip_with_their_scale_and_seal_the_leaf_rust_decimal_seals() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + for text in [ + "1.50", + "-1234.5678", + "0.00", + "79228162514264337593543950335", + "-0.0000000000000000000000000001", + ] { + let theirs = number(text); + let value = Decimal::from(theirs); + let stored: numeric::Numeric = keyset.encrypt_as(&value, column()).await.unwrap(); + let opened: Decimal = cipher + .decrypt_as(stored.clone(), column().into()) + .await + .unwrap(); + assert_eq!( + rust_decimal::Decimal::from(&opened).to_string(), + text, + "the scale is kept" + ); + assert!( + same(&as_frame(&cipher, stored.c.clone()).await, &frame(theirs)), + "{text}: the leaf a rust_decimal Decimal seals" + ); + + let searchable: numeric::NumericEq = keyset.encrypt_as(&value, column()).await.unwrap(); + let named: numeric::NumericEq = by_name(&keyset, "NumericEq", frame(theirs)).await; + assert_eq!(searchable.hm, named.hm, "{text}: one term on both paths"); + let opened = targets::decrypt( + "NumericEq", + &cipher, + &label(), + &serde_json::to_vec(&named).unwrap(), + ) + .unwrap() + .await + .unwrap(); + assert!(same(&opened, &frame(theirs)), "{text}: by name"); + } +} + +/// ADR-0002's baseline and vitaminc's equality encodings: a decimal's scale +/// is normalised, a timestamp is truncated to the microsecond, and distinct +/// values have distinct terms. +#[tokio::test] +async fn equality_terms_follow_the_baseline() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + let n = |text: &str| frame(number(text)); + assert_eq!( + hm(&keyset, "NumericEq", n("1.5")).await, + hm(&keyset, "NumericEq", n("1.50")).await, + "1.5 = 1.50" + ); + assert_eq!( + hm(&keyset, "NumericEq", n("0")).await, + hm(&keyset, "NumericEq", n("-0.000")).await, + "every zero is one value" + ); + assert_ne!( + hm(&keyset, "NumericEq", n("1.5")).await, + hm(&keyset, "NumericEq", n("1.51")).await + ); + assert_ne!( + hm(&keyset, "NumericEq", n("1.5")).await, + hm(&keyset, "NumericEq", n("-1.5")).await + ); + + let t = |text: &str| frame(instant(text)); + assert_eq!( + hm(&keyset, "TimestampEq", t("2024-02-29T12:00:00.123456001Z")).await, + hm(&keyset, "TimestampEq", t("2024-02-29T12:00:00.123456999Z")).await, + "one microsecond, one term" + ); + // Truncated, never rounded: the nanoseconds below the microsecond are + // dropped, as the order term drops them. Before 1970 that is floor on + // the count since the epoch. + assert_eq!( + hm(&keyset, "TimestampEq", t("2024-02-29T12:00:00.1234567Z")).await, + hm(&keyset, "TimestampEq", t("2024-02-29T12:00:00.123456Z")).await, + "truncated, not rounded" + ); + assert_eq!( + hm(&keyset, "TimestampEq", t("1969-12-31T23:59:59.9999995Z")).await, + hm(&keyset, "TimestampEq", t("1969-12-31T23:59:59.999999Z")).await, + "floor before the epoch" + ); + assert_ne!( + hm(&keyset, "TimestampEq", t("2024-02-29T12:00:00.123456Z")).await, + hm(&keyset, "TimestampEq", t("2024-02-29T12:00:00.123457Z")).await + ); + + let d = |text: &str| frame(day(text)); + assert_ne!( + hm(&keyset, "DateEq", d("2024-02-29")).await, + hm(&keyset, "DateEq", d("2024-03-01")).await + ); + // A date, an instant and a number are separate domains: the same + // integer underneath is no match. + assert_ne!( + hm( + &keyset, + "DateEq", + frame(Date::from_days_since_epoch(0).unwrap()) + ) + .await, + hm(&keyset, "TimestampEq", frame(Timestamp::new(0, 0).unwrap())).await + ); + assert_ne!( + hm( + &keyset, + "DateEq", + frame(Date::from_days_since_epoch(0).unwrap()) + ) + .await, + hm(&keyset, "NumericEq", frame(Decimal::new(0, 0).unwrap())).await + ); +} + +#[tokio::test] +async fn a_value_of_another_kind_is_refused_not_converted() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + for (name, value, expected) in [ + ( + "Date", + frame(instant("2024-02-29T00:00:00Z")), + ValueKind::Date, + ), + ("DateEq", frame::(19_782), ValueKind::Date), + ("Timestamp", frame(day("2024-02-29")), ValueKind::Timestamp), + ("TimestampEq", frame::(0), ValueKind::Timestamp), + ("Numeric", frame::(1.5), ValueKind::Decimal), + ("NumericEq", frame("1.50"), ValueKind::Decimal), + ] { + let error = refused(targets::encrypt(name, &keyset, &label(), value)); + assert!( + matches!(error, TargetError::Plaintext { target, expected: e, .. } if target == name && e == expected), + "{name}: {error}" + ); + } + + // A stored date moved into a timestamp is not read as one. + let stored: date::Date = keyset + .encrypt_as(&Date::from(day("2024-02-29")), column()) + .await + .unwrap(); + let moved = timestamp::Timestamp { + v: stored.v, + i: stored.i, + c: stored.c, + }; + let opened: Result = cipher.decrypt_as(moved, column().into()).await; + assert!(opened.is_err(), "a date is not a timestamp"); +} + +/// The ordered types wait for the engine's order terms over these kinds, +/// and say so; block ORE waits for that first. +#[tokio::test] +async fn the_ordered_types_are_refused_with_their_reason() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + for family in ["Date", "Timestamp", "Numeric"] { + for suffix in ["Ord", "OrdOpe", "OrdOre"] { + let name = format!("{family}{suffix}"); + let value = frame(Decimal::new(1, 0).unwrap()); + match refused(targets::encrypt(&name, &keyset, &label(), value)) { + TargetError::Unproducible { reason, .. } => assert!( + reason.contains("no order term for a date, timestamp or decimal"), + "{name}: {reason}" + ), + other => panic!("{name}: {other}"), + } + } + } +} + +/// `fixtures/v4_ledger_queries.json`: the `DateEq`, `TimestampEq` and +/// `NumericEq` query operands the dispatch derives under +/// `FakeDataKeySource`'s index key, which the Go SDK's deterministic guest +/// shares. Its test derives the same queries through generated code and +/// requires the same bytes. Regenerate with `EQL_UPDATE_FIXTURES=1`. +#[tokio::test] +async fn the_ledger_query_fixture_is_what_the_dispatch_derives() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + let query = |name: &'static str, column: &'static str, value: ValueFrame| { + let keyset = &keyset; + async move { + let label = Label::new(["profiles", column]).unwrap(); + let bytes = targets::query(name, keyset, &label, value) + .unwrap() + .await + .unwrap(); + String::from_utf8(bytes).unwrap() + } + }; + let fixture = serde_json::json!({ + "_comment": "The DateEq, TimestampEq and NumericEq query operands eql-bindings derives for each plaintext under FakeDataKeySource's index key (keyset nil), read by the Go SDK's hermetic test; regenerate with EQL_UPDATE_FIXTURES=1, do not edit.", + "table": "profiles", + "due": { + "plaintext": "2024-02-29", + "query": query("DateEq", "due", frame(day("2024-02-29"))).await, + }, + "posted": { + "plaintext": "2024-02-29T12:34:56.123456Z", + "query": query("TimestampEq", "posted", frame(instant("2024-02-29T12:34:56.123456Z"))).await, + }, + "amount": { + "plaintext": "1.50", + "query": query("NumericEq", "amount", frame(number("1.50"))).await, + }, + }); + let path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("fixtures/v4_ledger_queries.json"); + let rendered = serde_json::to_string_pretty(&fixture).unwrap() + "\n"; + if std::env::var_os("EQL_UPDATE_FIXTURES").is_some() { + std::fs::write(&path, &rendered).unwrap(); + } + let committed = std::fs::read_to_string(&path) + .expect("fixtures/v4_ledger_queries.json is committed; EQL_UPDATE_FIXTURES=1 writes it"); + assert_eq!( + committed, rendered, + "the committed fixture is what the dispatch derives today" + ); +} + +fn database() -> postgres::Client { + postgres::Client::connect( + &std::env::var("EQL_TEST_DATABASE_URL").expect("EQL_TEST_DATABASE_URL"), + postgres::NoTls, + ) + .unwrap() +} + +fn json(value: &T) -> String { + serde_json::to_string(value).unwrap() +} + +/// Needs an EQL v4 installation. Rust-sealed values of each type pass their +/// domain check and read back, `=` on each equality column finds the rows +/// its query names (1.5 and 1.50 are one number; one microsecond is one +/// instant), and the storage-only columns refuse `=`. +#[test] +#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v4 database"] +fn postgres_stores_and_finds_date_timestamp_and_numeric_rows() { + let runtime = tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap(); + let (cipher, _) = runtime.block_on(common::cipher()); + let keyset = cipher.default_keyset(); + let mut db = database(); + db.batch_execute( + "CREATE TEMP TABLE v4_ledger ( + id int PRIMARY KEY, + opened public.eql_v4_date, + due public.eql_v4_date_eq, + created public.eql_v4_timestamp, + posted public.eql_v4_timestamp_eq, + total public.eql_v4_numeric, + amount public.eql_v4_numeric_eq + );", + ) + .unwrap(); + let rows = [ + (1, "2024-02-29", "2024-02-29T12:00:00.123456001Z", "1.5"), + ( + 2, + "0001-01-01", + "1969-12-31T23:59:59.999999999Z", + "-79228162514264337593543950335", + ), + (3, "2024-02-29", "2024-02-29T12:00:00.123456999Z", "1.50"), + (4, "2024-03-01", "2024-02-29T12:00:00.123457Z", "1.51"), + ]; + for (id, d, t, n) in rows { + let (opened, due, created, posted, total, amount) = runtime.block_on(async { + let d = Date::from(day(d)); + let t = Timestamp::try_from(instant(t)).unwrap(); + let n = Decimal::from(number(n)); + ( + json( + &keyset + .encrypt_as::<_, date::Date>(&d, column()) + .await + .unwrap(), + ), + json( + &keyset + .encrypt_as::<_, date::DateEq>(&d, column()) + .await + .unwrap(), + ), + json( + &keyset + .encrypt_as::<_, timestamp::Timestamp>(&t, column()) + .await + .unwrap(), + ), + json( + &keyset + .encrypt_as::<_, timestamp::TimestampEq>(&t, column()) + .await + .unwrap(), + ), + json( + &keyset + .encrypt_as::<_, numeric::Numeric>(&n, column()) + .await + .unwrap(), + ), + json( + &keyset + .encrypt_as::<_, numeric::NumericEq>(&n, column()) + .await + .unwrap(), + ), + ) + }); + db.execute( + "INSERT INTO v4_ledger VALUES ($1, + $2::text::jsonb::public.eql_v4_date, + $3::text::jsonb::public.eql_v4_date_eq, + $4::text::jsonb::public.eql_v4_timestamp, + $5::text::jsonb::public.eql_v4_timestamp_eq, + $6::text::jsonb::public.eql_v4_numeric, + $7::text::jsonb::public.eql_v4_numeric_eq)", + &[&id, &opened, &due, &created, &posted, &total, &amount], + ) + .unwrap(); + } + let mut ids = |column_name: &str, query_domain: &str, query: String| -> Vec { + db.query( + &format!( + "SELECT id FROM v4_ledger WHERE {column_name} = $1::text::jsonb::eql_v4.{query_domain} ORDER BY id" + ), + &[&query], + ) + .unwrap() + .iter() + .map(|r| r.get(0)) + .collect() + }; + let date_query = |text: &str| { + let value = Date::from(day(text)); + runtime.block_on(async { + json( + &keyset + .encrypt_as::<_, date::DateEqQuery>(&value, column()) + .await + .unwrap(), + ) + }) + }; + let timestamp_query = |text: &str| { + let value = Timestamp::try_from(instant(text)).unwrap(); + runtime.block_on(async { + json( + &keyset + .encrypt_as::<_, timestamp::TimestampEqQuery>(&value, column()) + .await + .unwrap(), + ) + }) + }; + let numeric_query = |text: &str| { + let value = Decimal::from(number(text)); + runtime.block_on(async { + json( + &keyset + .encrypt_as::<_, numeric::NumericEqQuery>(&value, column()) + .await + .unwrap(), + ) + }) + }; + assert_eq!( + ids("due", "query_date_eq", date_query("2024-02-29")), + [1, 3] + ); + assert_eq!(ids("due", "query_date_eq", date_query("0001-01-01")), [2]); + assert_eq!( + ids("due", "query_date_eq", date_query("2025-01-01")), + Vec::::new() + ); + assert_eq!( + ids( + "posted", + "query_timestamp_eq", + timestamp_query("2024-02-29T12:00:00.123456Z") + ), + [1, 3], + "one microsecond is one instant" + ); + assert_eq!( + ids( + "posted", + "query_timestamp_eq", + timestamp_query("2024-02-29T12:00:00.123457Z") + ), + [4] + ); + assert_eq!( + ids("amount", "query_numeric_eq", numeric_query("1.500")), + [1, 3], + "1.5 = 1.50 = 1.500" + ); + assert_eq!( + ids( + "amount", + "query_numeric_eq", + numeric_query("-79228162514264337593543950335") + ), + [2] + ); + + // A stored value reads back and opens with its scale and nanoseconds. + let row = db + .query_one( + "SELECT opened::text, created::text, total::text FROM v4_ledger WHERE id = 3", + &[], + ) + .unwrap(); + let (opened, created, total): (String, String, String) = (row.get(0), row.get(1), row.get(2)); + runtime.block_on(async { + let opened: Date = cipher + .decrypt_as( + serde_json::from_str::(&opened).unwrap(), + column().into(), + ) + .await + .unwrap(); + assert_eq!(NaiveDate::from(&opened), day("2024-02-29")); + let created: Timestamp = cipher + .decrypt_as( + serde_json::from_str::(&created).unwrap(), + column().into(), + ) + .await + .unwrap(); + assert_eq!(created.nanoseconds(), 123_456_999); + let total: Decimal = cipher + .decrypt_as( + serde_json::from_str::(&total).unwrap(), + column().into(), + ) + .await + .unwrap(); + assert_eq!(rust_decimal::Decimal::from(&total).to_string(), "1.50"); + }); + + // The storage-only columns have no equality operator. + for (column_name, domain) in [ + ("opened", "eql_v4_date"), + ("created", "eql_v4_timestamp"), + ("total", "eql_v4_numeric"), + ] { + let err = db + .query( + &format!("SELECT id FROM v4_ledger WHERE {column_name} = {column_name}"), + &[], + ) + .unwrap_err(); + let message = err.as_db_error().map(|e| e.message()).unwrap_or_default(); + assert!( + message.contains(&format!("is not supported for public.{domain}")), + "{column_name}: {message}" + ); + } +} + +/// `fixtures/v4_ledger_rows.json`: `Ledger` rows the Go SDK's generated code +/// sealed over the deterministic EQL guest +/// (`TestV4LedgerRowsMatchTheCommittedFixture` writes it). +mod go_ledger { + use super::*; + use std::collections::BTreeMap; + + #[derive(serde::Deserialize)] + pub struct Fixture { + pub seed: String, + pub table: String, + pub rows: Vec, + } + #[derive(serde::Deserialize)] + pub struct Row { + pub id: i32, + pub plaintext: Plain, + pub stored: BTreeMap, + } + /// Dates in ISO 8601, instants in RFC 3339 with nanoseconds, decimals + /// as fixed-point text with their scale. + #[derive(serde::Deserialize)] + pub struct Plain { + pub opened: String, + pub due: String, + pub created: String, + pub posted: String, + pub total: String, + pub amount: String, + } + + pub fn fixture() -> Fixture { + let path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("fixtures/v4_ledger_rows.json"); + let raw = std::fs::read_to_string(path).expect( + "fixtures/v4_ledger_rows.json is written by the Go SDK's \ + TestV4LedgerRowsMatchTheCommittedFixture", + ); + serde_json::from_str(&raw).unwrap() + } + + pub async fn cipher(seed: &str) -> stack_encrypt::StackCipher { + let seed: [u8; 32] = seed.as_bytes().try_into().expect("a 32-byte seed"); + stack_encrypt::StackCipher::builder() + .kms(stack_kms::DeterministicSource::new(seed)) + .init() + .await + .unwrap() + } + + fn parsed(row: &Row, column: &str) -> T { + serde_json::from_value(row.stored[column].clone()) + .unwrap_or_else(|e| panic!("row {} {column}: {e}", row.id)) + } + + /// Open every field of `row` as its v4 type, into eql-bindings' + /// plaintexts, and check it against what Go sealed. + pub async fn open_row( + cipher: &stack_encrypt::StackCipher, + row: &Row, + ) { + let column = |name: &str| Identifier::for_column("profiles", name).unwrap(); + let p = &row.plaintext; + let id = row.id; + let opened: Date = cipher + .decrypt_as(parsed::(row, "opened"), column("opened").into()) + .await + .unwrap(); + assert_eq!(NaiveDate::from(&opened), day(&p.opened), "row {id} opened"); + let due: Date = cipher + .decrypt_as(parsed::(row, "due"), column("due").into()) + .await + .unwrap(); + assert_eq!(NaiveDate::from(&due), day(&p.due), "row {id} due"); + let created: Timestamp = cipher + .decrypt_as( + parsed::(row, "created"), + column("created").into(), + ) + .await + .unwrap(); + assert_eq!( + DateTime::::from(&created), + instant(&p.created), + "row {id} created" + ); + let posted: Timestamp = cipher + .decrypt_as( + parsed::(row, "posted"), + column("posted").into(), + ) + .await + .unwrap(); + assert_eq!( + DateTime::::from(&posted), + instant(&p.posted), + "row {id} posted" + ); + let total: Decimal = cipher + .decrypt_as( + parsed::(row, "total"), + column("total").into(), + ) + .await + .unwrap(); + assert_eq!( + rust_decimal::Decimal::from(&total).to_string(), + p.total, + "row {id} total keeps its scale" + ); + let amount: Decimal = cipher + .decrypt_as( + parsed::(row, "amount"), + column("amount").into(), + ) + .await + .unwrap(); + assert_eq!( + rust_decimal::Decimal::from(&amount).to_string(), + p.amount, + "row {id} amount keeps its scale" + ); + } +} + +/// What the Go SDK sealed as the date, timestamp and numeric types parses as +/// each type and opens in Rust to the same day, instant and number. +#[tokio::test] +async fn ledger_rows_the_go_sdk_sealed_open_in_rust() { + let fixture = go_ledger::fixture(); + assert_eq!(fixture.table, "profiles"); + assert!(fixture.rows.len() > 1); + let cipher = go_ledger::cipher(&fixture.seed).await; + for row in &fixture.rows { + go_ledger::open_row(&cipher, row).await; + } +} + +/// The Go-sealed ledger rows in PostgreSQL: each value passes its domain +/// check, and `=` with this file's queries (which the Go SDK's test derives +/// byte for byte) finds the rows holding that day, microsecond and number. +#[test] +#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v4 database"] +fn postgres_stores_and_queries_ledger_rows_the_go_sdk_sealed() { + let fixture = go_ledger::fixture(); + let mut db = database(); + db.batch_execute( + "CREATE TEMP TABLE go_ledgers ( + id int PRIMARY KEY, + opened public.eql_v4_date, + due public.eql_v4_date_eq, + created public.eql_v4_timestamp, + posted public.eql_v4_timestamp_eq, + total public.eql_v4_numeric, + amount public.eql_v4_numeric_eq + );", + ) + .unwrap(); + for row in &fixture.rows { + let v = |column: &str| row.stored[column].to_string(); + db.execute( + "INSERT INTO go_ledgers VALUES ($1, + $2::text::jsonb::public.eql_v4_date, + $3::text::jsonb::public.eql_v4_date_eq, + $4::text::jsonb::public.eql_v4_timestamp, + $5::text::jsonb::public.eql_v4_timestamp_eq, + $6::text::jsonb::public.eql_v4_numeric, + $7::text::jsonb::public.eql_v4_numeric_eq)", + &[ + &row.id, + &v("opened"), + &v("due"), + &v("created"), + &v("posted"), + &v("total"), + &v("amount"), + ], + ) + .unwrap(); + } + let queries: serde_json::Value = serde_json::from_str( + &std::fs::read_to_string( + std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("fixtures/v4_ledger_queries.json"), + ) + .unwrap(), + ) + .unwrap(); + let plaintext = |key: &str| queries[key]["plaintext"].as_str().unwrap().to_owned(); + let due = day(&plaintext("due")); + let posted = instant(&plaintext("posted")).timestamp_micros(); + let amount = number(&plaintext("amount")).normalize(); + for (column_name, query_domain, expected) in [ + ( + "due", + "query_date_eq", + fixture + .rows + .iter() + .filter(|r| day(&r.plaintext.due) == due) + .map(|r| r.id) + .collect::>(), + ), + ( + "posted", + "query_timestamp_eq", + fixture + .rows + .iter() + .filter(|r| instant(&r.plaintext.posted).timestamp_micros() == posted) + .map(|r| r.id) + .collect(), + ), + ( + "amount", + "query_numeric_eq", + fixture + .rows + .iter() + .filter(|r| number(&r.plaintext.amount).normalize() == amount) + .map(|r| r.id) + .collect(), + ), + ] { + assert!( + !expected.is_empty() && expected.len() < fixture.rows.len(), + "{column_name}: the fixture splits the rows" + ); + let key = column_name; + let ids: Vec = db + .query( + &format!( + "SELECT id FROM go_ledgers WHERE {column_name} = $1::text::jsonb::eql_v4.{query_domain} ORDER BY id" + ), + &[&queries[key]["query"].as_str().unwrap()], + ) + .unwrap() + .iter() + .map(|r| r.get(0)) + .collect(); + assert_eq!(ids, expected, "= over Go-sealed {column_name}"); + } +} diff --git a/packages/eql/tests/encryption/tests/v4_order.rs b/packages/eql/tests/encryption/tests/v4_order.rs new file mode 100644 index 000000000..f9f76da38 --- /dev/null +++ b/packages/eql/tests/encryption/tests/v4_order.rs @@ -0,0 +1,886 @@ +//! The OPE-ordered EQL v4 types Stack Encrypt produces: `IntegerOrd`, +//! `BigintOrd`, `RealOrd`, `DoubleOrd`, `TextOrd` and their `OrdOpe` twins. +//! +//! EQL compares the `op` term as `bytea` after decoding its hex, which is +//! lexicographic byte order. So the stored terms must sort as ADR-0002's +//! order keys sort: integers by value, floats as PostgreSQL's `float8` sorts +//! them (`-0.0` ties `0.0`, every NaN is one value after `+Infinity`), and +//! text by its fold (case and accents folded, Unicode 16). These tests hold +//! that through both entry points, pin the query twins to the stored terms, +//! and, against an EQL v4 database, check that `<`, `<=`, `>`, `>=`, `=` and +//! `ORDER BY` find exactly the rows the plaintexts say. + +mod common; + +use eql_bindings::encryption::targets::{self as targets}; +use eql_bindings::v4::{bigint, double, integer, real, text}; +use eql_bindings::Identifier; +use stack_encrypt::dynamic::ValueFrame; +use stack_encrypt::{Encrypt, Label, NonEmpty}; + +fn frame(value: T) -> ValueFrame { + ValueFrame::of(value).unwrap() +} + +fn column() -> NonEmpty { + Identifier::for_column("rankings", "level").unwrap() +} + +fn label() -> Label { + Label::new(["rankings", "level"]).unwrap() +} + +/// Every type this file covers, with the plaintext kind it takes. +const ORDERED: &[&str] = &[ + "IntegerOrd", + "IntegerOrdOpe", + "SmallintOrd", + "SmallintOrdOpe", + "BigintOrd", + "BigintOrdOpe", + "RealOrd", + "RealOrdOpe", + "DoubleOrd", + "DoubleOrdOpe", + "TextOrd", + "TextOrdOpe", +]; + +/// The stored JSON the named type writes for `value`, through the by-name +/// dispatch a Go plan reaches. +async fn stored( + keyset: &stack_encrypt::KeysetCipher<'_, common::Observed>, + name: &str, + value: ValueFrame, +) -> serde_json::Value { + let bytes = targets::encrypt(name, keyset, &label(), value) + .unwrap() + .await + .unwrap(); + serde_json::from_slice(&bytes).unwrap() +} + +/// The query operand the named type's twin derives for `value`. +async fn query( + keyset: &stack_encrypt::KeysetCipher<'_, common::Observed>, + name: &str, + value: ValueFrame, +) -> serde_json::Value { + let bytes = targets::query(name, keyset, &label(), value) + .unwrap() + .await + .unwrap(); + serde_json::from_slice(&bytes).unwrap() +} + +/// The `op` term of a stored value or query, as its hex. Lower-case hex +/// sorts as the bytes it encodes (each byte is two digits, and `0`–`9` sort +/// before `a`–`f`), so comparing the strings is comparing the `bytea` EQL +/// compares. +fn op(value: &serde_json::Value) -> &str { + value["op"].as_str().expect("an ordered value carries op") +} + +/// Every producible ordered type is in [`ORDERED`] and the other way +/// round: a type that becomes producible is covered here or fails. +#[test] +fn the_ordered_producible_types_are_these() { + let mut ordered: Vec<&str> = targets::targets() + .iter() + .filter(|t| t.producible && t.indexes.contains(&"ope")) + .map(|t| t.name) + .collect(); + ordered.sort_unstable(); + let mut expected = ORDERED.to_vec(); + expected.sort_unstable(); + assert_eq!(ordered, expected); + // No producible type carries an ORE term: EQL's is block ORE, and the + // engine's is CLLW ORE. + assert!(targets::targets() + .iter() + .filter(|t| t.producible) + .all(|t| !t.indexes.contains(&"ore"))); +} + +/// The stored keys of each type: the ciphertext and the OPE term, and the +/// equality term too for text, whose order term folds case and so cannot +/// answer `=`. +#[tokio::test] +async fn each_ordered_type_stores_its_catalog_terms() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + for name in ORDERED { + let value = if name.starts_with("Text") { + frame("alice") + } else if name.starts_with("Integer") { + frame::(7) + } else if name.starts_with("Smallint") { + frame::(7) + } else if name.starts_with("Bigint") { + frame::(7) + } else if name.starts_with("Real") { + frame::(7.0) + } else { + frame::(7.0) + }; + let json = stored(&keyset, name, value.clone()).await; + let mut keys: Vec<&str> = json + .as_object() + .unwrap() + .keys() + .map(String::as_str) + .collect(); + keys.sort_unstable(); + let expected: &[&str] = if name.starts_with("Text") { + &["c", "hm", "i", "op", "v"] + } else { + &["c", "i", "op", "v"] + }; + assert_eq!(keys, expected, "{name}"); + assert_eq!(json["v"], 4, "{name}"); + + let q = query(&keyset, name, value.clone()).await; + assert!( + q.get("c").is_none(), + "{name}: a query carries no ciphertext" + ); + assert_eq!(op(&q), op(&json), "{name}: the query's op is the stored op"); + assert_eq!(q["hm"], json["hm"], "{name}: and so is its hm, if any"); + + let opened = targets::decrypt(name, &cipher, &label(), json.to_string().as_bytes()) + .unwrap() + .await + .unwrap(); + assert_eq!(opened.risky_ref(), value.risky_ref(), "{name}: opens back"); + } +} + +/// Assert that the terms `values` store under `name` sort as `expected` +/// says: each entry's group is its rank, so equal groups must store one +/// term and a lower group a lower term. +async fn sorts_as( + keyset: &stack_encrypt::KeysetCipher<'_, common::Observed>, + name: &str, + values: Vec<(usize, ValueFrame, &str)>, +) { + let mut terms = Vec::new(); + for (group, value, shown) in values { + let json = stored(keyset, name, value).await; + terms.push((group, op(&json).to_owned(), shown)); + } + for a in &terms { + for b in &terms { + assert_eq!( + a.1.cmp(&b.1), + a.0.cmp(&b.0), + "{name}: {} vs {}: the terms must order as the order keys do", + a.2, + b.2 + ); + } + } +} + +#[tokio::test] +async fn integer_terms_order_by_value() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + let ints = [i32::MIN, -70_000, -1, 0, 1, 255, 256, 70_000, i32::MAX]; + for name in ["IntegerOrd", "IntegerOrdOpe"] { + let values = ints + .iter() + .enumerate() + .map(|(rank, v)| (rank, frame(*v), "an i32")) + .collect(); + sorts_as(&keyset, name, values).await; + } + let smalls = [i16::MIN, -300, -1, 0, 1, 255, 256, i16::MAX]; + for name in ["SmallintOrd", "SmallintOrdOpe"] { + let values = smalls + .iter() + .enumerate() + .map(|(rank, v)| (rank, frame(*v), "an i16")) + .collect(); + sorts_as(&keyset, name, values).await; + } + let bigs = [i64::MIN, -(1 << 40), -1, 0, 1, 1 << 40, i64::MAX]; + for name in ["BigintOrd", "BigintOrdOpe"] { + let values = bigs + .iter() + .enumerate() + .map(|(rank, v)| (rank, frame(*v), "an i64")) + .collect(); + sorts_as(&keyset, name, values).await; + } +} + +#[tokio::test] +async fn float_terms_order_as_postgres_float8_does() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + for name in ["DoubleOrd", "DoubleOrdOpe"] { + let values = vec![ + (0, frame(f64::NEG_INFINITY), "-inf"), + (1, frame(f64::MIN), "MIN"), + (2, frame(-1.5f64), "-1.5"), + (3, frame(-0.0f64), "-0.0"), + (3, frame(0.0f64), "0.0"), + (4, frame(f64::MIN_POSITIVE), "MIN_POSITIVE"), + (5, frame(1.5f64), "1.5"), + (6, frame(f64::MAX), "MAX"), + (7, frame(f64::INFINITY), "+inf"), + (8, frame(f64::NAN), "NaN"), + ( + 8, + frame(f64::from_bits(0xfff8_0000_0000_beef)), + "another NaN", + ), + ]; + sorts_as(&keyset, name, values).await; + } + for name in ["RealOrd", "RealOrdOpe"] { + let values = vec![ + (0, frame(f32::NEG_INFINITY), "-inf"), + (1, frame(f32::MIN), "MIN"), + (2, frame(-1.5f32), "-1.5"), + (3, frame(-0.0f32), "-0.0"), + (3, frame(0.0f32), "0.0"), + (4, frame(1.5f32), "1.5"), + (5, frame(f32::MAX), "MAX"), + (6, frame(f32::INFINITY), "+inf"), + (7, frame(f32::NAN), "NaN"), + (7, frame(f32::from_bits(0xffc0_1234)), "another NaN"), + ]; + sorts_as(&keyset, name, values).await; + } +} + +/// A `float32` orders as the `float64` it widens to, so a `RealOrd` and a +/// `DoubleOrd` column under one name store one term for one value. +#[tokio::test] +async fn a_real_orders_as_the_double_it_widens_to() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + for v in [-1.5f32, 0.0, 1.5, f32::INFINITY, f32::NAN] { + let real = stored(&keyset, "RealOrd", frame(v)).await; + let double = stored(&keyset, "DoubleOrd", frame(f64::from(v))).await; + assert_eq!(op(&real), op(&double), "{v}"); + } +} + +/// Text orders by its fold: case and accents tie, `é` sorts with `e`, and +/// `alice` comes before `Zoe`. A prefix sorts first. +#[tokio::test] +async fn text_terms_order_by_the_fold() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + for name in ["TextOrd", "TextOrdOpe"] { + let values = vec![ + (0, frame(""), "the empty string"), + (1, frame("al"), "al"), + (2, frame("alice"), "alice"), + (2, frame("ALICE"), "ALICE"), + (3, frame("bob"), "bob"), + (4, frame("cafe"), "cafe"), + (4, frame("Café"), "Café"), + (4, frame("CAFE\u{301}"), "CAFE with a combining accent"), + (5, frame("cafes"), "cafes"), + (6, frame("Zoe"), "Zoe"), + ]; + sorts_as(&keyset, name, values).await; + } +} + +/// `=` on a `TextOrd` column reads the equality term, which folds no case: +/// `Café` and `cafe` tie in order and are still two values to `=`. The +/// equality term is `TextEq`'s for the same column. +#[tokio::test] +async fn text_order_ties_are_not_equal() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + let a = stored(&keyset, "TextOrd", frame("Café")).await; + let b = stored(&keyset, "TextOrd", frame("cafe")).await; + assert_eq!(op(&a), op(&b)); + assert_ne!(a["hm"], b["hm"]); + let eq = stored(&keyset, "TextEq", frame("Café")).await; + assert_eq!(a["hm"], eq["hm"], "TextOrd's hm is TextEq's"); +} + +/// A family's `Ord` and `OrdOpe` types are the same index under two names: +/// they store one term for one value under one column. +#[tokio::test] +async fn ord_and_ord_ope_store_one_term() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + let pairs = [ + ("IntegerOrd", "IntegerOrdOpe", frame::(-9)), + ("SmallintOrd", "SmallintOrdOpe", frame::(-9)), + ("BigintOrd", "BigintOrdOpe", frame::(1 << 50)), + ("RealOrd", "RealOrdOpe", frame::(2.5)), + ("DoubleOrd", "DoubleOrdOpe", frame::(-2.5)), + ("TextOrd", "TextOrdOpe", frame("Zoë")), + ]; + for (ord, ope, value) in pairs { + let a = stored(&keyset, ord, value.clone()).await; + let b = stored(&keyset, ope, value).await; + assert_eq!(op(&a), op(&b), "{ord} and {ope}"); + } +} + +/// Text with a code point Unicode 16 does not assign has no fold, so no +/// order term: refused stored and queried, before any term reaches a row. +#[tokio::test] +async fn text_with_no_fold_is_refused() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + let unassigned = "a\u{0378}b"; + for name in ["TextOrd", "TextOrdOpe"] { + let stored = match targets::encrypt(name, &keyset, &label(), frame(unassigned)) { + Ok(pending) => pending.await, + Err(error) => panic!("{name}: refused before the plan ran: {error}"), + }; + assert!(stored.is_err(), "{name}: stored text with no fold"); + let queried = match targets::query(name, &keyset, &label(), frame(unassigned)) { + Ok(pending) => pending.await, + Err(error) => panic!("{name}: refused before the plan ran: {error}"), + }; + assert!(queried.is_err(), "{name}: queried text with no fold"); + } + let typed: Result = keyset.encrypt_as(&unassigned.to_owned(), column()).await; + assert!(typed.is_err(), "the typed entry point refuses it too"); +} + +/// The typed entry point writes what the by-name dispatch writes: the same +/// terms, and a ciphertext that opens to the exact value. +#[tokio::test] +async fn the_typed_entry_point_stores_the_dispatchs_terms() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + + let typed: integer::IntegerOrd = keyset.encrypt_as(&-9i32, column()).await.unwrap(); + let named = stored(&keyset, "IntegerOrd", frame(-9i32)).await; + assert_eq!(serde_json::to_value(&typed.op).unwrap(), named["op"]); + let opened: i32 = cipher.decrypt_as(typed, column().into()).await.unwrap(); + assert_eq!(opened, -9); + + let typed: bigint::BigintOrdOpeQuery = keyset.encrypt_as(&7i64, column()).await.unwrap(); + let named = query(&keyset, "BigintOrdOpe", frame(7i64)).await; + assert_eq!(serde_json::to_value(&typed.op).unwrap(), named["op"]); + + let typed: real::RealOrd = keyset.encrypt_as(&-0.0f32, column()).await.unwrap(); + let named = stored(&keyset, "RealOrd", frame(0.0f32)).await; + assert_eq!( + serde_json::to_value(&typed.op).unwrap(), + named["op"], + "-0.0 ties 0.0 in the term" + ); + let opened: f32 = cipher.decrypt_as(typed, column().into()).await.unwrap(); + assert_eq!( + opened.to_bits(), + (-0.0f32).to_bits(), + "and keeps its sign in c" + ); + + let typed: double::DoubleOrdOpe = keyset.encrypt_as(&f64::NAN, column()).await.unwrap(); + let named = stored(&keyset, "DoubleOrdOpe", frame(f64::NAN)).await; + assert_eq!(serde_json::to_value(&typed.op).unwrap(), named["op"]); + + let typed: text::TextOrdQuery = keyset + .encrypt_as(&"Café".to_owned(), column()) + .await + .unwrap(); + let named = query(&keyset, "TextOrd", frame("Café")).await; + assert_eq!(serde_json::to_value(&typed).unwrap(), named); +} + +/// `fixtures/v4_ordered_queries.json`: a query operand for one value of each +/// ordered type, under `FakeDataKeySource`'s index key (keyset nil), read by +/// the Go SDK's hermetic test, which derives the same operands through +/// generated `Lt` methods and asserts the bytes are equal. Regenerate with +/// `EQL_UPDATE_FIXTURES=1`; the bytes must not change otherwise. +#[tokio::test] +async fn the_ordered_query_fixture_is_what_the_dispatch_derives() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + let query = |name: &'static str, column: &'static str, value: ValueFrame| { + let keyset = &keyset; + async move { + let label = Label::new(["rankings", column]).unwrap(); + let bytes = targets::query(name, keyset, &label, value) + .unwrap() + .await + .unwrap(); + String::from_utf8(bytes).unwrap() + } + }; + let fixture = serde_json::json!({ + "_comment": "The v4 query operands eql-bindings derives for one plaintext of each OPE-ordered type under FakeDataKeySource's index key (keyset nil), read by the Go SDK's hermetic test; regenerate with EQL_UPDATE_FIXTURES=1, do not edit.", + "table": "rankings", + "level": {"plaintext": 10, "query": query("IntegerOrd", "level", frame::(10)).await}, + "floor": {"plaintext": -3, "query": query("IntegerOrdOpe", "floor", frame::(-3)).await}, + "points": {"plaintext": 5_000_000_000_i64, "query": query("BigintOrd", "points", frame::(5_000_000_000)).await}, + "total": {"plaintext": -1, "query": query("BigintOrdOpe", "total", frame::(-1)).await}, + "speed": {"plaintext": 2.5, "query": query("RealOrd", "speed", frame::(2.5)).await}, + "pace": {"plaintext": -0.5, "query": query("RealOrdOpe", "pace", frame::(-0.5)).await}, + "score": {"plaintext": 9.75, "query": query("DoubleOrd", "score", frame::(9.75)).await}, + "mean": {"plaintext": 0.0, "query": query("DoubleOrdOpe", "mean", frame::(0.0)).await}, + "title": {"plaintext": "Mango", "query": query("TextOrd", "title", frame("Mango")).await}, + "handle": {"plaintext": "carol", "query": query("TextOrdOpe", "handle", frame("carol")).await}, + }); + let path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("fixtures/v4_ordered_queries.json"); + let rendered = serde_json::to_string_pretty(&fixture).unwrap() + "\n"; + if std::env::var_os("EQL_UPDATE_FIXTURES").is_some() { + std::fs::write(&path, &rendered).unwrap(); + } + let committed = std::fs::read_to_string(&path) + .expect("fixtures/v4_ordered_queries.json is committed; EQL_UPDATE_FIXTURES=1 writes it"); + assert_eq!( + committed, rendered, + "the committed fixture is what the dispatch derives today" + ); +} + +/// `fixtures/v4_ordered_rows.json`: `Ranking` rows the Go SDK's generated +/// code sealed over the deterministic EQL guest +/// (`TestV4OrderedRowsMatchTheCommittedFixture` in languages/golang/encrypt +/// writes it). +mod go_rows { + use super::*; + use serde::de::DeserializeOwned; + use std::collections::BTreeMap; + + #[derive(serde::Deserialize)] + pub struct Fixture { + pub seed: String, + pub table: String, + pub rows: Vec, + } + #[derive(serde::Deserialize)] + pub struct Row { + pub id: i32, + pub plaintext: Plain, + pub stored: BTreeMap, + } + #[derive(serde::Deserialize, Clone)] + pub struct Plain { + pub level: i32, + pub floor: i32, + pub points: i64, + pub total: i64, + pub speed: f32, + pub pace: f32, + pub score: f64, + pub mean: f64, + pub title: String, + pub handle: String, + } + + pub fn fixture() -> Fixture { + let path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("fixtures/v4_ordered_rows.json"); + let raw = std::fs::read_to_string(path).expect( + "fixtures/v4_ordered_rows.json is written by the Go SDK's \ + TestV4OrderedRowsMatchTheCommittedFixture", + ); + serde_json::from_str(&raw).unwrap() + } + + pub async fn cipher(seed: &str) -> stack_encrypt::StackCipher { + let seed: [u8; 32] = seed.as_bytes().try_into().expect("a 32-byte seed"); + stack_encrypt::StackCipher::builder() + .kms(stack_kms::DeterministicSource::new(seed)) + .init() + .await + .unwrap() + } + + pub fn column(name: &str) -> NonEmpty { + Identifier::for_column("rankings", name).unwrap() + } + + pub fn parsed(row: &Row, column: &str) -> T { + serde_json::from_value(row.stored[column].clone()) + .unwrap_or_else(|e| panic!("row {} {column}: {e}", row.id)) + } + + /// Open every field of `row` and check it against what Go sealed. + pub async fn open_row( + cipher: &stack_encrypt::StackCipher, + row: &Row, + ) { + let p = &row.plaintext; + macro_rules! open { + ($ty:ty, $plain:ty, $column:literal) => {{ + let opened: $plain = cipher + .decrypt_as(parsed::<$ty>(row, $column), column($column).into()) + .await + .unwrap(); + opened + }}; + } + assert_eq!(open!(integer::IntegerOrd, i32, "level"), p.level); + assert_eq!(open!(integer::IntegerOrdOpe, i32, "floor"), p.floor); + assert_eq!(open!(bigint::BigintOrd, i64, "points"), p.points); + assert_eq!(open!(bigint::BigintOrdOpe, i64, "total"), p.total); + assert_eq!( + open!(real::RealOrd, f32, "speed").to_bits(), + p.speed.to_bits() + ); + assert_eq!( + open!(real::RealOrdOpe, f32, "pace").to_bits(), + p.pace.to_bits() + ); + assert_eq!( + open!(double::DoubleOrd, f64, "score").to_bits(), + p.score.to_bits() + ); + assert_eq!( + open!(double::DoubleOrdOpe, f64, "mean").to_bits(), + p.mean.to_bits() + ); + assert_eq!(open!(text::TextOrd, String, "title"), p.title); + assert_eq!(open!(text::TextOrdOpe, String, "handle"), p.handle); + } +} + +/// What the Go SDK sealed parses as each ordered v4 type and opens in Rust. +#[tokio::test] +async fn ordered_rows_the_go_sdk_sealed_open_in_rust() { + let fixture = go_rows::fixture(); + assert_eq!(fixture.table, "rankings"); + assert!(fixture.rows.len() > 1); + let cipher = go_rows::cipher(&fixture.seed).await; + for row in &fixture.rows { + go_rows::open_row(&cipher, row).await; + } +} + +/// The ordered columns and their SQL types, for the PostgreSQL tests: +/// (column, stored domain, query domain). +const COLUMNS: &[(&str, &str, &str)] = &[ + ("level", "integer_ord", "query_integer_ord"), + ("floor", "integer_ord_ope", "query_integer_ord_ope"), + ("points", "bigint_ord", "query_bigint_ord"), + ("total", "bigint_ord_ope", "query_bigint_ord_ope"), + ("speed", "real_ord", "query_real_ord"), + ("pace", "real_ord_ope", "query_real_ord_ope"), + ("score", "double_ord", "query_double_ord"), + ("mean", "double_ord_ope", "query_double_ord_ope"), + ("title", "text_ord", "query_text_ord"), + ("handle", "text_ord_ope", "query_text_ord_ope"), +]; + +fn connect() -> postgres::Client { + postgres::Client::connect( + &std::env::var("EQL_TEST_DATABASE_URL").expect("EQL_TEST_DATABASE_URL"), + postgres::NoTls, + ) + .unwrap() +} + +fn create_table(db: &mut postgres::Client, table: &str) { + let columns: Vec = COLUMNS + .iter() + .map(|(column, domain, _)| format!("{column} public.eql_v4_{domain}")) + .collect(); + db.batch_execute(&format!( + "CREATE TEMP TABLE {table} (id int PRIMARY KEY, {});", + columns.join(", ") + )) + .unwrap(); +} + +fn insert(db: &mut postgres::Client, table: &str, id: i32, stored: &[String]) { + let placeholders: Vec = COLUMNS + .iter() + .enumerate() + .map(|(n, (_, domain, _))| format!("${}::text::jsonb::public.eql_v4_{domain}", n + 2)) + .collect(); + let mut params: Vec<&(dyn postgres::types::ToSql + Sync)> = vec![&id]; + params.extend( + stored + .iter() + .map(|s| s as &(dyn postgres::types::ToSql + Sync)), + ); + db.execute( + &format!( + "INSERT INTO {table} VALUES ($1, {})", + placeholders.join(", ") + ), + ¶ms, + ) + .unwrap(); +} + +fn ids(db: &mut postgres::Client, sql: &str, query: &str) -> Vec { + db.query(sql, &[&query]) + .unwrap_or_else(|e| panic!("{sql}: {e}")) + .iter() + .map(|r| r.get(0)) + .collect() +} + +/// Needs an EQL v4 installation. Rows written through the by-name dispatch: +/// each ordered column answers `<`, `<=`, `>`, `>=` and `=` with exactly the +/// rows the plaintexts say, and `ORDER BY eql_v4.ord_term(column)` sorts +/// them as the order keys do. +#[test] +#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v4 database"] +fn postgres_compares_and_orders_ope_rows() { + let runtime = tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap(); + let (cipher, _) = runtime.block_on(common::cipher()); + let keyset = cipher.default_keyset(); + let mut db = connect(); + create_table(&mut db, "v4_ordered"); + + // One value per column per row. Row 3 ties row 2 in every column's order + // key: equal integers, `-0.0` against `0.0`, and text that differs only + // in case and accents. + struct Plain(i32, i64, f32, f64, &'static str); + let rows = [ + (1, Plain(-5, i64::MIN, f32::NEG_INFINITY, -1.5, "alice")), + (2, Plain(0, 0, 0.0, 0.0, "Cafe")), + (3, Plain(0, 0, -0.0, -0.0, "café")), + (4, Plain(7, 1 << 40, 2.5, 1e300, "carol")), + (5, Plain(i32::MAX, i64::MAX, f32::NAN, f64::NAN, "Zoe")), + ]; + let frames = |p: &Plain| -> Vec<(&'static str, ValueFrame)> { + vec![ + ("IntegerOrd", frame(p.0)), + ("IntegerOrdOpe", frame(p.0)), + ("BigintOrd", frame(p.1)), + ("BigintOrdOpe", frame(p.1)), + ("RealOrd", frame(p.2)), + ("RealOrdOpe", frame(p.2)), + ("DoubleOrd", frame(p.3)), + ("DoubleOrdOpe", frame(p.3)), + ("TextOrd", frame(p.4)), + ("TextOrdOpe", frame(p.4)), + ] + }; + let under = |column: &str| Label::new(["rankings", column]).unwrap(); + for (id, plain) in &rows { + let stored: Vec = runtime.block_on(async { + let mut stored = Vec::new(); + for ((column, _, _), (name, value)) in COLUMNS.iter().zip(frames(plain)) { + let bytes = targets::encrypt(name, &keyset, &under(column), value) + .unwrap() + .await + .unwrap(); + stored.push(String::from_utf8(bytes).unwrap()); + } + stored + }); + insert(&mut db, "v4_ordered", *id, &stored); + } + + // The query operand for the middle row's values (row 2), per column. + let probes: Vec = runtime.block_on(async { + let mut probes = Vec::new(); + for ((column, _, _), (name, value)) in COLUMNS.iter().zip(frames(&rows[1].1)) { + let bytes = targets::query(name, &keyset, &under(column), value) + .unwrap() + .await + .unwrap(); + probes.push(String::from_utf8(bytes).unwrap()); + } + probes + }); + + for ((column, _, query_domain), probe) in COLUMNS.iter().zip(&probes) { + let cmp = |op: &str| { + format!( + "SELECT id FROM v4_ordered WHERE {column} {op} $1::text::jsonb::eql_v4.{query_domain} ORDER BY id" + ) + }; + let text = column == &"title" || column == &"handle"; + assert_eq!(ids(&mut db, &cmp("<"), probe), [1], "{column} <"); + assert_eq!(ids(&mut db, &cmp("<="), probe), [1, 2, 3], "{column} <="); + assert_eq!(ids(&mut db, &cmp(">"), probe), [4, 5], "{column} >"); + assert_eq!(ids(&mut db, &cmp(">="), probe), [2, 3, 4, 5], "{column} >="); + // `=` reads the order term on a number column, where -0.0 ties 0.0 + // as in float8, and the case-sensitive equality term on text. + let equal: &[i32] = if text { &[2] } else { &[2, 3] }; + assert_eq!(ids(&mut db, &cmp("="), probe), equal, "{column} ="); + + // The query operand may stand on the left too. + let flipped = format!( + "SELECT id FROM v4_ordered WHERE $1::text::jsonb::eql_v4.{query_domain} > {column} ORDER BY id" + ); + assert_eq!( + ids(&mut db, &flipped, probe), + [1], + "{column}: query > column" + ); + + // Ascending by the order term: row 1 first, the tied rows 2 and 3 + // together (broken by id), then 4 and 5. + let ordered: Vec = db + .query( + &format!("SELECT id FROM v4_ordered ORDER BY eql_v4.ord_term({column}), id"), + &[], + ) + .unwrap() + .iter() + .map(|r| r.get(0)) + .collect(); + assert_eq!(ordered, [1, 2, 3, 4, 5], "{column}: ORDER BY ord_term"); + } + + // MIN and MAX over the order term name the extreme rows' values. + let back: String = db + .query_one("SELECT eql_v4.max(level)::text FROM v4_ordered", &[]) + .map(|r| r.get(0)) + .unwrap_or_else(|e| panic!("max(level): {e}")); + let opened: i32 = runtime + .block_on(async { + cipher + .decrypt_as( + serde_json::from_str::(&back).unwrap(), + column().into(), + ) + .await + }) + .unwrap(); + assert_eq!(opened, i32::MAX); +} + +/// The Go-sealed rows in PostgreSQL: each value passes its domain check, +/// `<`, `<=`, `>` and `>=` with the fixture's query operands (which the Go +/// SDK's test derives byte for byte) find the rows whose plaintext is on +/// that side of the query's, and `ORDER BY eql_v4.ord_term(column)` sorts +/// Go's rows as their plaintexts do. +#[test] +#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v4 database"] +fn postgres_compares_rows_the_go_sdk_sealed() { + let fixture = go_rows::fixture(); + let mut db = connect(); + create_table(&mut db, "go_rankings"); + for row in &fixture.rows { + let stored: Vec = COLUMNS + .iter() + .map(|(column, _, _)| row.stored[*column].to_string()) + .collect(); + insert(&mut db, "go_rankings", row.id, &stored); + } + let queries: serde_json::Value = serde_json::from_str( + &std::fs::read_to_string( + std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("fixtures/v4_ordered_queries.json"), + ) + .unwrap(), + ) + .unwrap(); + // A column's order key, as a value that sorts as the order term does. + #[derive(PartialEq, PartialOrd, Debug)] + enum Key { + Int(i64), + Float(f64), + Text(String), + } + let fold = |s: &str| { + // The fixture's text is ASCII, so lower-casing is the fold here. + assert!(s.is_ascii(), "{s}: the expectation folds ASCII only"); + Key::Text(s.to_ascii_lowercase()) + }; + let key = |column: &str, p: &go_rows::Plain| -> Key { + match column { + "level" => Key::Int(p.level.into()), + "floor" => Key::Int(p.floor.into()), + "points" => Key::Int(p.points), + "total" => Key::Int(p.total), + "speed" => Key::Float(p.speed.into()), + "pace" => Key::Float(p.pace.into()), + "score" => Key::Float(p.score), + "mean" => Key::Float(p.mean), + "title" => fold(&p.title), + "handle" => fold(&p.handle), + other => panic!("no order key for {other}"), + } + }; + let query_key = |column: &str, plain: &serde_json::Value| -> Key { + match column { + "level" | "floor" | "points" | "total" => Key::Int(plain.as_i64().unwrap()), + "speed" | "pace" | "score" | "mean" => Key::Float(plain.as_f64().unwrap()), + "title" | "handle" => fold(plain.as_str().unwrap()), + other => panic!("no order key for {other}"), + } + }; + for (column, _, query_domain) in COLUMNS { + let probe = query_key(column, &queries[*column]["plaintext"]); + // Sorted, as the SQL below sorts its ids: the assertion is about + // which rows, not the order the fixture lists them in. + let side = |keep: &dyn Fn(&Key) -> bool| -> Vec { + let mut ids: Vec = fixture + .rows + .iter() + .filter(|r| keep(&key(column, &r.plaintext))) + .map(|r| r.id) + .collect(); + ids.sort_unstable(); + ids + }; + let below = side(&|k| *k < probe); + let above = side(&|k| *k > probe); + assert!( + !below.is_empty() && !above.is_empty(), + "{column}: the fixture has rows on both sides of the query" + ); + let not_below = side(&|k| *k >= probe); + let not_above = side(&|k| *k <= probe); + + let query = queries[*column]["query"].as_str().unwrap(); + let cmp = |op: &str| { + format!( + "SELECT id FROM go_rankings WHERE {column} {op} $1::text::jsonb::eql_v4.{query_domain} ORDER BY id" + ) + }; + assert_eq!( + ids(&mut db, &cmp("<"), query), + below, + "< over Go-sealed {column}" + ); + assert_eq!( + ids(&mut db, &cmp("<="), query), + not_above, + "<= over Go-sealed {column}" + ); + assert_eq!( + ids(&mut db, &cmp(">"), query), + above, + "> over Go-sealed {column}" + ); + assert_eq!( + ids(&mut db, &cmp(">="), query), + not_below, + ">= over Go-sealed {column}" + ); + + // Go's terms sort among themselves as the plaintexts do, ties + // broken by id. + let mut by_plaintext: Vec<(Key, i32)> = fixture + .rows + .iter() + .map(|r| (key(column, &r.plaintext), r.id)) + .collect(); + by_plaintext.sort_by(|a, b| a.partial_cmp(b).expect("the fixture's keys are finite")); + let expected: Vec = by_plaintext.into_iter().map(|(_, id)| id).collect(); + let ordered: Vec = db + .query( + &format!("SELECT id FROM go_rankings ORDER BY eql_v4.ord_term({column}), id"), + &[], + ) + .unwrap() + .iter() + .map(|r| r.get(0)) + .collect(); + assert_eq!( + ordered, expected, + "ORDER BY ord_term over Go-sealed {column}" + ); + } +} diff --git a/packages/eql/tests/encryption/tests/v4_range.rs b/packages/eql/tests/encryption/tests/v4_range.rs new file mode 100644 index 000000000..e5038b01d --- /dev/null +++ b/packages/eql/tests/encryption/tests/v4_range.rs @@ -0,0 +1,1057 @@ +//! The EQL v4 range query domains and `eql_v4.between` (ADR-0009, decision 7). +//! +//! A `Between` query is one term holding both bounds, and in SQL it is one +//! operand: `WHERE eql_v4.between(col, $1::eql_v4.query_integer_range_ore)`. +//! A range is `{"v": 4, "i": {…}, "lo": , "hi": }`, each bound the +//! value the single-bound query domain for the same term holds under its term +//! key (`ob` for block ORE, `op` for CLLW OPE). +//! +//! EQL v4's ordered types are not producible yet: EQL compares block-ORE and +//! CLLW-OPE terms, and Stack Encrypt does not derive those for EQL (#1132, +//! #1236). So the order terms here come from cipherstash-client's ORE and OPE +//! indexers, the code that writes the terms EQL's comparators are built for, +//! run offline over `FakeDataKeySource`'s index key as +//! `ste_vec_selectors.rs` does. The rest of each stored value (`v`, `i`, `c`, +//! and `hm` for text) is a real Stack Encrypt `Integer` or `TextEq`. Nothing +//! here derives an order term itself. +//! +//! The PostgreSQL tests need an EQL v4 installation (`mise run +//! test:encryption:postgres`); the others need no database. + +mod common; + +use cipherstash_client::encryption::{IndexTerm, OpeIndexer, OreIndexer, Plaintext}; +use cipherstash_client::zerokms; +use eql_bindings::v4::{self, integer, text, DomainType}; +use eql_bindings::Identifier; +use serde_json::{json, Value}; +use stack_encrypt::NonEmpty; +use stack_kms::{FakeDataKeySource, IndexKeySource}; + +fn column() -> NonEmpty { + Identifier::for_column("users", "age").unwrap() +} + +fn identifier() -> Value { + json!({"t": "users", "c": "age"}) +} + +/// `FakeDataKeySource`'s index key for the default keyset, as the key type +/// cipherstash-client's indexers take. +async fn index_key() -> zerokms::IndexKey { + let (_, key) = FakeDataKeySource::new().load_index_key(None).await.unwrap(); + zerokms::IndexKey::from(*key.key()) +} + +fn hex(bytes: &[u8]) -> String { + bytes.iter().map(|b| format!("{b:02x}")).collect() +} + +/// The `ob` value cipherstash-client writes for `plaintext`: one hex block +/// for a number, one per block for text. `query` asks for the query form. +fn ob(key: &zerokms::IndexKey, plaintext: Plaintext, query: bool) -> Value { + let term = if query { + OreIndexer.encrypt_for_query(&plaintext, key) + } else { + OreIndexer.encrypt(&plaintext, key) + }; + match term.unwrap() { + IndexTerm::OreFull(bytes) => json!([hex(&bytes)]), + IndexTerm::OreArray(blocks) => { + Value::Array(blocks.iter().map(|b| Value::String(hex(b))).collect()) + } + other => panic!("not an ORE term: {other:?}"), + } +} + +/// The `op` value cipherstash-client writes for `plaintext`. +fn op(key: &zerokms::IndexKey, plaintext: Plaintext) -> Value { + match OpeIndexer.encrypt(&plaintext, key).unwrap() { + IndexTerm::OpeFixed(bytes) | IndexTerm::OpeVariable(bytes) => Value::String(hex(&bytes)), + other => panic!("not an OPE term: {other:?}"), + } +} + +/// A range over the bounds `lo` and `hi`, read through the binding `T` (so +/// the binding accepts it) and written back as the JSON text a driver binds. +fn range( + lo: Value, + hi: Value, +) -> String { + let value: T = + serde_json::from_value(json!({"v": 4, "i": identifier(), "lo": lo, "hi": hi})).unwrap(); + serde_json::to_string(&value).unwrap() +} + +#[tokio::test] +async fn range_bindings_hold_two_bounds_of_their_term_and_refuse_anything_else() { + let key = index_key().await; + let (lo, hi) = (Plaintext::Int(Some(10)), Plaintext::Int(Some(30))); + + // Each bound is what the single-bound query operand holds as `ob`: the + // same value reads as either. (A block-ORE term carries a nonce, so two + // derivations of one value differ; one derivation is used for both.) + let lo_ob = ob(&key, lo.clone(), true); + let ore: integer::IntegerRangeOreQuery = serde_json::from_value(json!({ + "v": 4, "i": identifier(), "lo": lo_ob, "hi": ob(&key, hi.clone(), true), + })) + .unwrap(); + let single: integer::IntegerOrdOreQuery = + serde_json::from_value(json!({"v": 4, "i": identifier(), "ob": lo_ob})).unwrap(); + assert_eq!(ore.lo, single.ob); + assert_ne!(ore.lo, ore.hi); + let json = serde_json::to_value(&ore).unwrap(); + let mut keys: Vec<&str> = json + .as_object() + .unwrap() + .keys() + .map(String::as_str) + .collect(); + keys.sort_unstable(); + assert_eq!(keys, ["hi", "i", "lo", "v"]); + assert_eq!( + integer::IntegerRangeOreQuery::sql_domain_static(), + "eql_v4.query_integer_range_ore" + ); + assert_eq!( + integer::IntegerRangeOreQuery::term_json_keys_static(), + Some(&["lo", "hi"][..]) + ); + + let ope: integer::IntegerRangeOpeQuery = serde_json::from_value(json!({ + "v": 4, "i": identifier(), + "lo": op(&key, lo.clone()), "hi": op(&key, hi.clone()), + })) + .unwrap(); + let single: integer::IntegerOrdOpeQuery = serde_json::from_value(json!({ + "v": 4, "i": identifier(), "op": op(&key, lo.clone()), + })) + .unwrap(); + assert_eq!(ope.lo, single.op); + + let good = json!({"v": 4, "i": identifier(), "lo": op(&key, lo.clone()), "hi": op(&key, hi)}); + let refused = |change: &dyn Fn(&mut Value)| { + let mut value = good.clone(); + change(&mut value); + serde_json::from_value::(value).is_err() + }; + assert!( + refused(&|v| v["c"] = json!("ciphertext")), + "a range holds no ciphertext" + ); + assert!(refused(&|v| v["v"] = json!(3)), "a range is EQL v4 only"); + assert!(refused(&|v| { + v.as_object_mut().unwrap().remove("hi"); + })); + assert!( + refused(&|v| v["op"] = v["lo"].clone()), + "a range is not a single-bound operand" + ); + // An ORE bound is an `ob` array, not an `op` string. + assert!(serde_json::from_value::(good).is_err()); +} + +#[test] +fn every_ordered_family_has_an_ore_and_an_ope_range() { + let domains: Vec<&str> = v4::all_range_query() + .iter() + .map(|d| d.sql_domain()) + .collect(); + let families = [ + "integer", + "smallint", + "bigint", + "date", + "timestamp", + "numeric", + "text", + "real", + "double", + ]; + let expected: Vec = families + .iter() + .flat_map(|f| { + [ + format!("eql_v4.query_{f}_range_ore"), + format!("eql_v4.query_{f}_range_ope"), + ] + }) + .collect(); + assert_eq!(domains, expected); + for d in v4::all_range_query() { + assert_eq!( + d.term_json_keys(), + Some(&["lo", "hi"][..]), + "{}", + d.sql_domain() + ); + } +} + +/// Run `EXPLAIN (FORMAT JSON) query` and return the plan as JSON. The simple +/// query protocol hands back text, which spares a JSON column type. +fn explain(db: &mut postgres::Client, query: &str) -> Value { + let messages = db + .simple_query(&format!("EXPLAIN (FORMAT JSON) {query}")) + .unwrap(); + let text = messages + .iter() + .find_map(|m| match m { + postgres::SimpleQueryMessage::Row(row) => row.get(0).map(str::to_owned), + _ => None, + }) + .expect("EXPLAIN returns one row"); + serde_json::from_str(&text).unwrap() +} + +/// The index-scan nodes of a plan, as `(Index Name, Index Cond)`. +fn index_scans(plan: &Value, found: &mut Vec<(String, String)>) { + match plan { + Value::Object(node) => { + if matches!( + node.get("Node Type").and_then(Value::as_str), + Some("Index Scan" | "Index Only Scan" | "Bitmap Index Scan") + ) { + found.push(( + node["Index Name"].as_str().unwrap_or_default().to_owned(), + node.get("Index Cond") + .and_then(Value::as_str) + .unwrap_or_default() + .to_owned(), + )); + } + node.values().for_each(|v| index_scans(v, found)); + } + Value::Array(items) => items.iter().for_each(|v| index_scans(v, found)), + _ => {} + } +} + +fn runtime() -> tokio::runtime::Runtime { + tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap() +} + +fn connect() -> postgres::Client { + postgres::Client::connect( + &std::env::var("EQL_TEST_DATABASE_URL").expect("EQL_TEST_DATABASE_URL"), + postgres::NoTls, + ) + .unwrap() +} + +fn sqlstate(error: &postgres::Error) -> String { + error + .code() + .map(|c| c.code().to_owned()) + .unwrap_or_default() +} + +const INTEGERS: [i32; 12] = [-1000, -5, -1, 0, 1, 7, 10, 20, 29, 30, 31, 1000]; + +/// Integer rows in all three ordered column domains, each value's real +/// Stack Encrypt `Integer` (`v`, `i`, `c`) with cipherstash-client's order +/// term added: `ob` for `_ord_ore`, `op` for `_ord` and `_ord_ope`. +fn integer_table( + runtime: &tokio::runtime::Runtime, + db: &mut postgres::Client, + key: &zerokms::IndexKey, +) { + let (cipher, _) = runtime.block_on(common::cipher()); + let keyset = cipher.default_keyset(); + db.batch_execute( + "CREATE TEMP TABLE v4_int_range ( + n int PRIMARY KEY, + ore public.eql_v4_integer_ord_ore, + ord public.eql_v4_integer_ord, + ope public.eql_v4_integer_ord_ope + );", + ) + .unwrap(); + for n in INTEGERS { + let stored: integer::Integer = runtime + .block_on(async { keyset.encrypt_as(&n, column()).await }) + .unwrap(); + let base = serde_json::to_value(&stored).unwrap(); + let with = |k: &str, term: Value| { + let mut v = base.clone(); + v[k] = term; + v.to_string() + }; + db.execute( + "INSERT INTO v4_int_range VALUES ($1, + $2::text::jsonb::public.eql_v4_integer_ord_ore, + $3::text::jsonb::public.eql_v4_integer_ord, + $4::text::jsonb::public.eql_v4_integer_ord_ope)", + &[ + &n, + &with("ob", ob(key, Plaintext::Int(Some(n)), false)), + &with("op", op(key, Plaintext::Int(Some(n)))), + &with("op", op(key, Plaintext::Int(Some(n)))), + ], + ) + .unwrap(); + } +} + +/// Needs an EQL v4 installation. Rows inside, outside and exactly at both +/// bounds, for ORE and OPE, over integers. +#[test] +#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v4 database"] +fn postgres_between_finds_integers_in_an_inclusive_range() { + let runtime = runtime(); + let key = runtime.block_on(index_key()); + { + let mut db = connect(); + integer_table(&runtime, &mut db, &key); + + let ore = |lo: i32, hi: i32| { + range::( + ob(&key, Plaintext::Int(Some(lo)), true), + ob(&key, Plaintext::Int(Some(hi)), true), + ) + }; + let ope = |lo: i32, hi: i32| { + range::( + op(&key, Plaintext::Int(Some(lo))), + op(&key, Plaintext::Int(Some(hi))), + ) + }; + let mut found = |column: &str, domain: &str, range: &str| -> Vec { + db.query( + &format!( + "SELECT n FROM v4_int_range \ + WHERE eql_v4.between({column}, $1::text::jsonb::eql_v4.{domain}) ORDER BY n" + ), + &[&range], + ) + .unwrap() + .iter() + .map(|r| r.get(0)) + .collect() + }; + // (lo, hi) and the rows the plaintext range holds, bounds included. + let cases: [(i32, i32, &[i32]); 6] = [ + // Both bounds are rows: both are in. + (10, 30, &[10, 20, 29, 30]), + // Across zero, where a sign-blind order would break. + (-5, 1, &[-5, -1, 0, 1]), + // Neither bound is a row. + (8, 28, &[10, 20]), + // A range of one value. + (31, 31, &[31]), + // Between two rows: nothing. + (2, 6, &[]), + // The whole of i32. + (i32::MIN, i32::MAX, &INTEGERS), + ]; + for (lo, hi, want) in cases { + assert_eq!( + found("ore", "query_integer_range_ore", &ore(lo, hi)), + want, + "ORE [{lo}, {hi}]" + ); + for column in ["ord", "ope"] { + assert_eq!( + found(column, "query_integer_range_ope", &ope(lo, hi)), + want, + "OPE {column} [{lo}, {hi}]" + ); + } + } + + // A range whose low bound is above its high bound matches nothing, + // as with SQL `BETWEEN`: the SQL does not reorder the bounds. + assert_eq!( + found("ore", "query_integer_range_ore", &ore(30, 10)), + Vec::::new() + ); + assert_eq!( + found("ope", "query_integer_range_ope", &ope(30, 10)), + Vec::::new() + ); + + // A NULL range is NULL, so no row, not an error. + let none: Vec = db + .query( + "SELECT n FROM v4_int_range WHERE eql_v4.between(ore, NULL::eql_v4.query_integer_range_ore)", + &[], + ) + .unwrap() + .iter() + .map(|r| r.get(0)) + .collect(); + assert!(none.is_empty()); + + // A range over the other term has no `between` for the column. The + // statement fails when it is parsed, with 42725 ("not unique"): + // PostgreSQL resolves a function's domain arguments as their base + // type, `jsonb`, which every `between` overload takes. + let err = db + .query( + "SELECT n FROM v4_int_range WHERE eql_v4.between(ore, $1::text::jsonb::eql_v4.query_integer_range_ope)", + &[&ope(10, 30)], + ) + .unwrap_err(); + assert_eq!(sqlstate(&err), "42725", "{err}"); + } +} + +/// Needs an EQL v4 installation. The same over text, whose ordered domains +/// also carry `hm`. +#[test] +#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v4 database"] +fn postgres_between_finds_text_in_an_inclusive_range() { + let runtime = runtime(); + let key = runtime.block_on(index_key()); + let (cipher, _) = runtime.block_on(common::cipher()); + let keyset = cipher.default_keyset(); + let words = [ + "apple", + "banana", + "blueberry", + "cherry", + "date", + "elderberry", + "fig", + ]; + let mut rows = Vec::new(); + for (id, word) in words.iter().enumerate() { + let stored: text::TextEq = runtime + .block_on(async { keyset.encrypt_as(&word.to_string(), column()).await }) + .unwrap(); + let base = serde_json::to_value(&stored).unwrap(); + let mut ore = base.clone(); + ore["ob"] = ob(&key, Plaintext::Text(Some(word.to_string())), false); + let mut ope = base; + ope["op"] = op(&key, Plaintext::Text(Some(word.to_string()))); + rows.push((id as i32, ore.to_string(), ope.to_string())); + } + { + let mut db = connect(); + db.batch_execute( + "CREATE TEMP TABLE v4_text_range ( + id int PRIMARY KEY, + ore public.eql_v4_text_ord_ore, + ope public.eql_v4_text_ord_ope + );", + ) + .unwrap(); + for (id, ore, ope) in &rows { + db.execute( + "INSERT INTO v4_text_range VALUES ($1, + $2::text::jsonb::public.eql_v4_text_ord_ore, + $3::text::jsonb::public.eql_v4_text_ord_ope)", + &[id, ore, ope], + ) + .unwrap(); + } + let text = |s: &str| Plaintext::Text(Some(s.to_owned())); + let mut found = |column: &str, domain: &str, range: &str| -> Vec { + db.query( + &format!( + "SELECT id FROM v4_text_range \ + WHERE eql_v4.between({column}, $1::text::jsonb::eql_v4.{domain}) ORDER BY id" + ), + &[&range], + ) + .unwrap() + .iter() + .map(|r| words[r.get::<_, i32>(0) as usize].to_owned()) + .collect() + }; + let cases: [(&str, &str, &[&str]); 4] = [ + // Both bounds are rows: both are in. + ("banana", "date", &["banana", "blueberry", "cherry", "date"]), + // Neither bound is a row. + ("b", "c", &["banana", "blueberry"]), + ("fig", "fig", &["fig"]), + ("dog", "eel", &[]), + ]; + for (lo, hi, want) in cases { + let ore = range::( + ob(&key, text(lo), true), + ob(&key, text(hi), true), + ); + assert_eq!( + found("ore", "query_text_range_ore", &ore), + want, + "ORE [{lo}, {hi}]" + ); + let ope = range::(op(&key, text(lo)), op(&key, text(hi))); + assert_eq!( + found("ope", "query_text_range_ope", &ope), + want, + "OPE [{lo}, {hi}]" + ); + } + } +} + +/// Needs an EQL v4 installation. `eql_v4.between` inlines, so a btree on the +/// column's order term serves it as one index scan with both bounds in the +/// index condition. A `between` the planner could not inline would be a +/// filter on every row, and no index scan would appear. +/// +/// Validity, not preference: like the SQLx suite's index-engagement tests, +/// this turns sequential scans off on a small table, so it proves the index +/// can serve the range, not that the planner prefers it at scale. +/// +/// Checked twice: with the range as a literal, and as a driver sends it, a +/// `$1` of the range domain under a generic plan. With a literal the planner +/// folds both bounds to constants, so only the generic plan shows that +/// `between` still inlines when its range is a parameter used twice. +#[test] +#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v4 database"] +fn postgres_between_uses_the_order_term_index() { + let runtime = runtime(); + let key = runtime.block_on(index_key()); + { + let mut db = connect(); + integer_table(&runtime, &mut db, &key); + db.batch_execute( + "CREATE INDEX v4_int_range_ore ON v4_int_range USING btree (eql_v4.ord_term_ore(ore)); + CREATE INDEX v4_int_range_ope ON v4_int_range USING btree (eql_v4.ord_term(ope)); + ANALYZE v4_int_range; + SET enable_seqscan = off;", + ) + .unwrap(); + let ore = range::( + ob(&key, Plaintext::Int(Some(10)), true), + ob(&key, Plaintext::Int(Some(30)), true), + ); + let ope = range::( + op(&key, Plaintext::Int(Some(10))), + op(&key, Plaintext::Int(Some(30))), + ); + for (column, domain, index, range) in [ + ("ore", "query_integer_range_ore", "v4_int_range_ore", &ore), + ("ope", "query_integer_range_ope", "v4_int_range_ope", &ope), + ] { + let query = format!( + "SELECT n FROM v4_int_range WHERE eql_v4.between({column}, '{}'::jsonb::eql_v4.{domain})", + range.replace('\'', "''") + ); + let plan = explain(&mut db, &query); + let mut scans = Vec::new(); + index_scans(&plan, &mut scans); + let (_, cond) = scans + .iter() + .find(|(name, _)| name == index) + .unwrap_or_else(|| panic!("{column}: no index scan on {index}:\n{plan:#}")); + assert!( + cond.contains(">=") && cond.contains("<="), + "{column}: both bounds are index conditions, one range scan: {cond}" + ); + assert!( + !cond.contains("between"), + "{column}: between was inlined: {cond}" + ); + // The plan answers the same rows the function does. + let n: Vec = db + .query(&format!("{query} ORDER BY n"), &[]) + .unwrap() + .iter() + .map(|r| r.get(0)) + .collect(); + assert_eq!(n, [10, 20, 29, 30], "{column}"); + + // The range as a parameter, under a generic plan. + db.batch_execute(&format!( + "SET plan_cache_mode = force_generic_plan; + PREPARE generic_{column}(eql_v4.{domain}) AS + SELECT n FROM v4_int_range WHERE eql_v4.between({column}, $1);" + )) + .unwrap(); + let execute = format!("EXECUTE generic_{column}('{}')", range.replace('\'', "''")); + let plan = explain(&mut db, &execute); + let mut scans = Vec::new(); + index_scans(&plan, &mut scans); + let (_, cond) = scans + .iter() + .find(|(name, _)| name == index) + .unwrap_or_else(|| { + panic!("{column}: generic: no index scan on {index}:\n{plan:#}") + }); + assert!( + cond.contains(">=") && cond.contains("<=") && cond.contains("$1"), + "{column}: generic: both bounds, from the parameter, are index conditions: {cond}" + ); + assert!( + !cond.contains("between"), + "{column}: generic: between was inlined: {cond}" + ); + db.batch_execute(&format!( + "DEALLOCATE generic_{column}; RESET plan_cache_mode;" + )) + .unwrap(); + } + db.batch_execute("RESET enable_seqscan;").unwrap(); + } +} + +/// Needs an EQL v4 installation. The range domains' CHECKs admit exactly the +/// shape the bindings write. +#[test] +#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v4 database"] +fn postgres_range_domains_check_their_shape() { + let key = runtime().block_on(index_key()); + let (lo, hi) = (Plaintext::Int(Some(1)), Plaintext::Int(Some(2))); + let ore = json!({"v": 4, "i": identifier(), "lo": ob(&key, lo.clone(), true), "hi": ob(&key, hi.clone(), true)}); + let ope = json!({"v": 4, "i": identifier(), "lo": op(&key, lo), "hi": op(&key, hi)}); + { + let mut db = connect(); + let cast = |db: &mut postgres::Client, value: &Value, domain: &str| { + db.query_one( + &format!("SELECT $1::text::jsonb::eql_v4.{domain}::text"), + &[&value.to_string()], + ) + .map(|_| ()) + }; + cast(&mut db, &ore, "query_integer_range_ore").unwrap(); + cast(&mut db, &ope, "query_integer_range_ope").unwrap(); + let with = |value: &Value, change: &dyn Fn(&mut Value)| { + let mut v = value.clone(); + change(&mut v); + v + }; + for (value, domain, why) in [ + ( + with(&ore, &|v| v["c"] = json!("x")), + "query_integer_range_ore", + "no ciphertext", + ), + ( + with(&ore, &|v| v["v"] = json!(3)), + "query_integer_range_ore", + "EQL v4 only", + ), + ( + with(&ore, &|v| v["v"] = json!(null)), + "query_integer_range_ore", + "a JSON null version is not v4", + ), + ( + with(&ope, &|v| v["v"] = json!(null)), + "query_integer_range_ope", + "a JSON null version is not v4", + ), + ( + with(&ore, &|v| { + v.as_object_mut().unwrap().remove("hi"); + }), + "query_integer_range_ore", + "both bounds", + ), + ( + with(&ore, &|v| v["lo"] = json!([])), + "query_integer_range_ore", + "a non-empty ORE bound", + ), + ( + ope.clone(), + "query_integer_range_ore", + "an ORE bound is an array", + ), + ( + ore.clone(), + "query_integer_range_ope", + "an OPE bound is a string", + ), + ] { + let err = cast(&mut db, &value, domain).unwrap_err(); + assert_eq!(sqlstate(&err), "23514", "{why}: {err}"); + } + } +} + +/// Five plaintexts of `family`, strictly ascending, as cipherstash-client's +/// indexers take them: what the smoke test stores and ranges over. A new +/// ordered family must add a row here, or the test fails naming it. +fn ascending(family: &str) -> [Plaintext; 5] { + use chrono::{DateTime, NaiveDate}; + use rust_decimal::Decimal; + let date = |y, m, d| Plaintext::NaiveDate(NaiveDate::from_ymd_opt(y, m, d)); + let at = |secs| Plaintext::Timestamp(DateTime::from_timestamp(secs, 0)); + let dec = |n, scale| Plaintext::Decimal(Some(Decimal::new(n, scale))); + let text = |s: &str| Plaintext::Text(Some(s.to_owned())); + match family { + "integer" => [-20, -1, 0, 7, 100].map(|n| Plaintext::Int(Some(n))), + "smallint" => [-300, -1, 0, 5, 300].map(|n| Plaintext::SmallInt(Some(n))), + "bigint" => [i64::MIN + 1, -1, 0, 1 << 40, i64::MAX].map(|n| Plaintext::BigInt(Some(n))), + "date" => [ + date(1969, 12, 31), + date(1970, 1, 1), + date(2000, 2, 29), + date(2024, 6, 1), + date(2099, 12, 31), + ], + "timestamp" => [-86_400, 0, 951_782_400, 1_717_200_000, 4_102_444_800].map(at), + "numeric" => [ + dec(-15, 1), + dec(0, 0), + dec(25, 2), + dec(314_159, 5), + dec(1000, 0), + ], + "text" => ["apple", "banana", "cherry", "damson", "elderberry"].map(text), + // `real` values are exact in f32; both float widths encrypt as f64. + "real" => [-2.5, -0.5, 0.0, 1.25, 1e10].map(|f| Plaintext::Float(Some(f))), + "double" => [-1e300, -1.0, 0.0, 2.5, 1e300].map(|f| Plaintext::Float(Some(f))), + other => panic!("no smoke-test values for the ordered family {other:?}: add them here"), + } +} + +/// The text a smoke-test value seals as for its `c` (and, for text, its +/// `hm` and `bf`): `between` never reads them, and most ordered families +/// have no producible type to seal the value itself. +fn display(plaintext: &Plaintext) -> String { + match plaintext { + Plaintext::Text(Some(s)) => s.clone(), + other => format!("{other:?}"), + } +} + +/// Needs an EQL v4 installation. A smoke test over every ordered family +/// and every `between` overload, generated from the catalog: five ascending +/// rows per family in each column domain that carries an ordering term, and +/// a range from the second value to the fourth, which must find exactly the +/// rows at both bounds and the one inside, and neither row outside. For text +/// it also checks that an order-term index serves `between`, for ORE on +/// `_ord_ore` and for OPE on `_search`. +#[test] +#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v4 database"] +fn postgres_between_smoke_test_over_every_ordered_family() { + let runtime = runtime(); + let key = runtime.block_on(index_key()); + let (cipher, _) = runtime.block_on(common::cipher()); + let keyset = cipher.default_keyset(); + let mut db = connect(); + let ranges = v4::all_range_query(); + let mut checked = 0; + + for family in eql_domains::CATALOG + .iter() + .filter(|f| !f.range_terms().is_empty()) + { + let values = ascending(family.name); + let table = format!("v4_smoke_{}", family.name); + let columns: Vec<&eql_domains::Domain> = family + .domains + .iter() + .filter(|d| d.terms.iter().any(|t| t.range_suffix().is_some())) + .collect(); + db.batch_execute(&format!( + "CREATE TEMP TABLE {table} (id int PRIMARY KEY, {})", + columns + .iter() + .map(|d| format!("c_{} public.eql_v4_{}", d.name, d.full_name(family.name))) + .collect::>() + .join(", ") + )) + .unwrap(); + + for (id, value) in values.iter().enumerate() { + let text = display(value); + let (eq, matched) = runtime.block_on(async { + let eq: text::TextEq = keyset.encrypt_as(&text, column()).await.unwrap(); + let matched = match family.name { + "text" => Some( + keyset + .encrypt_as::<_, text::TextMatch>(&text, column()) + .await + .unwrap(), + ), + _ => None, + }; + (eq, matched) + }); + let eq = serde_json::to_value(&eq).unwrap(); + let payloads: Vec = columns + .iter() + .map(|d| { + let mut p = json!({"v": eq["v"], "i": eq["i"], "c": eq["c"]}); + for term in d.terms { + match term { + eql_domains::Term::Hm => p["hm"] = eq["hm"].clone(), + eql_domains::Term::Bloom => { + let m = matched.as_ref().expect("only text has a match term"); + p["bf"] = serde_json::to_value(m).unwrap()["bf"].clone(); + } + eql_domains::Term::Ore => p["ob"] = ob(&key, value.clone(), false), + eql_domains::Term::Ope => p["op"] = op(&key, value.clone()), + } + } + p.to_string() + }) + .collect(); + let placeholders: Vec = columns + .iter() + .enumerate() + .map(|(i, d)| { + format!( + "${}::text::jsonb::public.eql_v4_{}", + i + 2, + d.full_name(family.name) + ) + }) + .collect(); + let id = id as i32; + let mut params: Vec<&(dyn postgres::types::ToSql + Sync)> = vec![&id]; + params.extend( + payloads + .iter() + .map(|p| p as &(dyn postgres::types::ToSql + Sync)), + ); + db.execute( + &format!( + "INSERT INTO {table} VALUES ($1, {})", + placeholders.join(", ") + ), + ¶ms, + ) + .unwrap(); + } + + for term in family.range_terms() { + let bound = |v: &Plaintext| match term { + eql_domains::Term::Ore => ob(&key, v.clone(), true), + eql_domains::Term::Ope => op(&key, v.clone()), + other => unreachable!("{other:?} has no range"), + }; + let domain = family.range_query_name(term); + let range = json!({"v": 4, "i": identifier(), "lo": bound(&values[1]), "hi": bound(&values[3])}); + // The binding for the domain accepts the range. + ranges + .iter() + .find(|r| r.sql_domain() == format!("eql_v4.{domain}")) + .unwrap_or_else(|| panic!("no binding for {domain}")) + .parse_value(&range) + .unwrap(); + for d in family.range_columns(term) { + let found: Vec = db + .query( + &format!( + "SELECT id FROM {table} \ + WHERE eql_v4.between(c_{}, $1::text::jsonb::eql_v4.{domain}) ORDER BY id", + d.name + ), + &[&range.to_string()], + ) + .unwrap() + .iter() + .map(|r| r.get(0)) + .collect(); + assert_eq!( + found, + [1, 2, 3], + "{}: between(_{}, {domain})", + family.name, + d.name + ); + checked += 1; + } + } + + if family.name == "text" { + let range = |term: eql_domains::Term| { + let bound = |v: &Plaintext| match term { + eql_domains::Term::Ore => ob(&key, v.clone(), true), + _ => op(&key, v.clone()), + }; + json!({"v": 4, "i": identifier(), "lo": bound(&values[1]), "hi": bound(&values[3])}) + .to_string() + }; + db.batch_execute(&format!( + "CREATE INDEX {table}_ore ON {table} USING btree (eql_v4.ord_term_ore(c_ord_ore)); + CREATE INDEX {table}_search ON {table} USING btree (eql_v4.ord_term(c_search)); + ANALYZE {table}; + SET enable_seqscan = off;" + )) + .unwrap(); + for (column, domain, index, value) in [ + ( + "c_ord_ore", + "query_text_range_ore", + format!("{table}_ore"), + range(eql_domains::Term::Ore), + ), + ( + "c_search", + "query_text_range_ope", + format!("{table}_search"), + range(eql_domains::Term::Ope), + ), + ] { + let plan = explain( + &mut db, + &format!( + "SELECT id FROM {table} WHERE eql_v4.between({column}, '{}'::jsonb::eql_v4.{domain})", + value.replace('\'', "''") + ), + ); + let mut scans = Vec::new(); + index_scans(&plan, &mut scans); + let (_, cond) = scans + .iter() + .find(|(name, _)| *name == index) + .unwrap_or_else(|| { + panic!("text {column}: no index scan on {index}:\n{plan:#}") + }); + assert!( + cond.contains(">=") && cond.contains("<="), + "text {column}: {cond}" + ); + } + db.batch_execute("RESET enable_seqscan;").unwrap(); + } + } + // 8 numeric and temporal families with 3 overloads each, and text's 5. + assert_eq!(checked, 29, "every between overload was exercised"); +} + +/// Needs an EQL v4 installation. The range parameter must be cast to its +/// exact range domain. An uncast `$1`, a `jsonb` parameter, or a range of +/// another family matches several `between` overloads (PostgreSQL resolves +/// a function's domain arguments as their base type, `jsonb`), so preparing +/// the statement fails with 42725, before any value is bound. The +/// single-bound operators resolve an uncast `$1` on the same column. +#[test] +#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v4 database"] +fn postgres_between_needs_the_exact_range_domain() { + let mut db = connect(); + db.batch_execute("CREATE TEMP TABLE v4_range_cast (ore public.eql_v4_integer_ord_ore);") + .unwrap(); + for range in [ + "$1", + "$1::jsonb", + "$1::eql_v4.query_bigint_range_ore", + "$1::eql_v4.query_integer_range_ope", + ] { + let err = db + .prepare(&format!( + "SELECT 1 FROM v4_range_cast WHERE eql_v4.between(ore, {range})" + )) + .unwrap_err(); + assert_eq!(sqlstate(&err), "42725", "{range}: {err}"); + assert!( + err.as_db_error() + .is_some_and(|e| e.message().contains("is not unique")), + "{range}: {err}" + ); + } + db.prepare( + "SELECT 1 FROM v4_range_cast WHERE eql_v4.between(ore, $1::eql_v4.query_integer_range_ore)", + ) + .unwrap(); + db.prepare("SELECT 1 FROM v4_range_cast WHERE ore < $1") + .unwrap(); +} + +/// A role and a database of its own, made by the superuser connection and +/// dropped on the way out, panic or not. Roles are cluster-global, so the +/// name carries the process id. +struct NonSuperuserDatabase { + name: String, +} + +impl NonSuperuserDatabase { + fn create(admin: &mut postgres::Client) -> Self { + let name = format!("eql_v4_nosuper_{}", std::process::id()); + // One statement per call: a multi-statement query runs in one + // transaction, and `CREATE DATABASE` / `DROP DATABASE` refuse one. + for statement in [ + format!("DROP DATABASE IF EXISTS {name} WITH (FORCE)"), + format!("DROP ROLE IF EXISTS {name}"), + format!("CREATE ROLE {name} LOGIN NOSUPERUSER PASSWORD '{name}'"), + format!("CREATE DATABASE {name} OWNER {name}"), + ] { + admin.batch_execute(&statement).unwrap(); + } + Self { name } + } + + fn connect(&self) -> postgres::Client { + let url = std::env::var("EQL_TEST_DATABASE_URL").expect("EQL_TEST_DATABASE_URL"); + let mut config: postgres::Config = url.parse().unwrap(); + config + .dbname(&self.name) + .user(&self.name) + .password(&self.name); + config.connect(postgres::NoTls).unwrap() + } +} + +impl Drop for NonSuperuserDatabase { + fn drop(&mut self) { + let name = &self.name; + let mut admin = connect(); + let _ = admin.batch_execute(&format!("DROP DATABASE IF EXISTS {name} WITH (FORCE)")); + let _ = admin.batch_execute(&format!("DROP ROLE IF EXISTS {name}")); + } +} + +/// Needs an EQL v4 installation, and a superuser on `EQL_TEST_DATABASE_URL` +/// who can create a role and a database. A non-superuser install skips the +/// `ore_block_256` btree opclass, and `ore_fallback.sql` disables the +/// single-bound ORE domains. Every ORE range domain is disabled the same way, +/// naming its family's OPE range, which stays usable. The bundle is the one +/// `mise run test:encryption:postgres` builds and installs. +#[test] +#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v4 database"] +fn postgres_a_non_superuser_install_disables_the_ore_ranges() { + let bundle = std::fs::read_to_string(concat!( + env!("CARGO_MANIFEST_DIR"), + "/../../release/cipherstash-encrypt-v4.sql" + )) + .expect("the v4 bundle: run `mise run build`"); + let mut admin = connect(); + let database = NonSuperuserDatabase::create(&mut admin); + let mut db = database.connect(); + db.batch_execute(&bundle).unwrap(); + + let opclass: bool = db + .query_one( + "SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_opclass c + JOIN pg_catalog.pg_am am ON am.oid = c.opcmethod + WHERE am.amname = 'btree' AND c.opcdefault + AND c.opcintype = 'eql_v4_internal.ore_block_256'::pg_catalog.regtype)", + &[], + ) + .unwrap() + .get(0); + assert!(!opclass, "a non-superuser install created the ORE opclass"); + + let cast = |db: &mut postgres::Client, value: &Value, domain: &str| { + db.query_one( + &format!("SELECT $1::text::jsonb::{domain}::text"), + &[&value.to_string()], + ) + .map(|_| ()) + }; + let ore = json!({"v": 4, "i": identifier(), "lo": ["00"], "hi": ["00"]}); + let ope = json!({"v": 4, "i": identifier(), "lo": "00", "hi": "00"}); + let mut checked = 0; + for family in eql_domains::CATALOG + .iter() + .filter(|f| f.range_terms().contains(&eql_domains::Term::Ore)) + { + let ore_range = format!("eql_v4.{}", family.range_query_name(eql_domains::Term::Ore)); + let ope_range = format!("eql_v4.{}", family.range_query_name(eql_domains::Term::Ope)); + let err = cast(&mut db, &ore, &ore_range).unwrap_err(); + assert_eq!(sqlstate(&err), "0A000", "{ore_range}: {err}"); + let db_error = err.as_db_error().unwrap(); + assert!(db_error.message().contains(&ore_range), "{err}"); + assert!( + db_error.hint().is_some_and(|h| h.contains(&ope_range)), + "{ore_range}: {:?}", + db_error.hint() + ); + cast(&mut db, &ope, &ope_range).unwrap(); + checked += 1; + } + assert_eq!(checked, 9, "every ordered family has an ORE range"); + drop(db); +} diff --git a/packages/eql/tests/encryption/tests/v4_types.rs b/packages/eql/tests/encryption/tests/v4_types.rs new file mode 100644 index 000000000..84f0c32a6 --- /dev/null +++ b/packages/eql/tests/encryption/tests/v4_types.rs @@ -0,0 +1,1682 @@ +//! The EQL v4 types Stack Encrypt produces besides `TextEq`: the +//! storage-only integer, smallint, bigint, boolean, float and text types, the +//! integer and float equality types, and `TextMatch`. `Json` is not producible yet: a +//! JSON value seals as a tree of leaves and EQL's `c` holds one. +//! +//! Each type must round-trip through both entry points (the typed +//! `encrypt_as` and the by-name dispatch a Go plan reaches), seal exactly the +//! leaf the same value's frame seals as (what the Go SDK writes for a plain +//! field of that kind) and open the leaf a frame sealed, and refuse a value +//! of another kind. + +mod common; + +use eql_bindings::encryption::targets::{self as targets, TargetError}; +use eql_bindings::encryption::{CiphertextVisitor, NativeCiphertextVisitor as NativeLeaf}; +use eql_bindings::v3::terms::Ciphertext; +use eql_bindings::v4::{bigint, boolean, double, integer, plaintext, real, smallint, text}; +use eql_bindings::Identifier; +use serde::{de::DeserializeOwned, Serialize}; +use stack_encrypt::dynamic::{ValueFrame, ValueKind}; +use stack_encrypt::target::transcode::{Reader, Visitor}; +use stack_encrypt::{CipherText, Encrypt, Label, NonEmpty}; + +/// A Rust value as the engine's runtime plaintext: its frame. +fn frame(value: T) -> ValueFrame { + ValueFrame::of(value).unwrap() +} + +/// Whether two frames hold the same value of the same kind: the frame +/// carries both, and a float's bit pattern, so `-0.0` and a NaN's payload +/// count. +fn same(a: &ValueFrame, b: &ValueFrame) -> bool { + a.risky_ref() == b.risky_ref() +} + +fn column() -> NonEmpty { + Identifier::for_column("users", "age").unwrap() +} + +fn label() -> Label { + Label::new(["users", "age"]).unwrap() +} + +/// The refusal a dispatch returned; `Pending` has no `Debug`. +fn refused(result: Result) -> TargetError { + match result { + Err(error) => error, + Ok(_) => panic!("the dispatch accepted what it should have refused"), + } +} + +/// The JSON a stored v4 value serializes to: version 4, the column, and the +/// ciphertext with the producer marker. +fn assert_v4_envelope(stored: &T, keys: &[&str]) { + let json = serde_json::to_value(stored).unwrap(); + assert_eq!(json["v"], 4, "Stack Encrypt writes EQL v4"); + assert_eq!(json["i"], serde_json::json!({"t": "users", "c": "age"})); + assert!(json["c"].as_str().unwrap().starts_with("stack-encrypt:1:")); + let mut found: Vec<&str> = json + .as_object() + .unwrap() + .keys() + .map(String::as_str) + .collect(); + found.sort_unstable(); + let mut expected = keys.to_vec(); + expected.sort_unstable(); + assert_eq!(found, expected); +} + +/// What the stored ciphertext opens to as a frame: the leaf a plain Go +/// field of the same kind seals, read back as the engine's runtime value. +async fn as_frame( + cipher: &stack_encrypt::StackCipher, + c: Ciphertext, +) -> ValueFrame { + let native = c.read(NativeLeaf).unwrap(); + cipher.decrypt(native, column()).await.unwrap() +} + +/// The other direction: the `c` a plain field of `value`'s kind gets when +/// its frame is sealed, as a Go SDK field without an EQL type is. +async fn sealed_from_frame( + keyset: &stack_encrypt::KeysetCipher<'_, common::Observed>, + value: ValueFrame, +) -> Ciphertext { + match keyset.encrypt(value, column()).await.unwrap() { + CipherText::Single(leaf) => CiphertextVisitor.sealed(leaf).unwrap(), + _ => panic!("a scalar seals as one leaf"), + } +} + +/// A storage-only v4 value of type `T` around `c`, for this test's column. +fn stored_as(c: Ciphertext) -> T { + serde_json::from_value(serde_json::json!({ + "v": 4, + "i": {"t": "users", "c": "age"}, + "c": c, + })) + .unwrap() +} + +/// Run one named target over `value` and read the stored JSON back as `T`. +async fn by_name( + keyset: &stack_encrypt::KeysetCipher<'_, common::Observed>, + name: &str, + value: ValueFrame, +) -> T { + let bytes = targets::encrypt(name, keyset, &label(), value) + .unwrap() + .await + .unwrap(); + serde_json::from_slice(&bytes).unwrap() +} + +/// A sample plaintext of each kind a producible type takes. +fn sample(kind: ValueKind) -> ValueFrame { + match kind { + ValueKind::Int16 => frame::(i16::MIN), + ValueKind::Int32 => frame::(-42), + ValueKind::Int64 => frame::(i64::MIN + 1), + ValueKind::Bool => frame::(true), + ValueKind::Float32 => frame::(-0.0), + ValueKind::Float64 => frame::(f64::NAN), + ValueKind::String => frame("a private note"), + ValueKind::Date => frame(plaintext::Date::from_days_since_epoch(-719_162).unwrap()), + ValueKind::Timestamp => frame(plaintext::Timestamp::new(-1, 999_999_999).unwrap()), + ValueKind::Decimal => frame(plaintext::Decimal::new(-123_450, 2).unwrap()), + other => panic!("no sample for {other:?}: add one with the type that takes it"), + } +} + +#[tokio::test] +async fn integers_round_trip_and_seal_the_leaf_their_frame_seals() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + for value in [0, 42, -7, i32::MIN, i32::MAX] { + let stored: integer::Integer = keyset.encrypt_as(&value, column()).await.unwrap(); + assert_v4_envelope(&stored, &["v", "i", "c"]); + + let opened: i32 = cipher + .decrypt_as(stored.clone(), column().into()) + .await + .unwrap(); + assert_eq!(opened, value); + assert!(same( + &as_frame(&cipher, stored.c.clone()).await, + &frame(value) + )); + + // The by-name dispatch runs the same plan. + let named: integer::Integer = by_name(&keyset, "Integer", frame::(value)).await; + let opened = targets::decrypt( + "Integer", + &cipher, + &label(), + &serde_json::to_vec(&named).unwrap(), + ) + .unwrap() + .await + .unwrap(); + assert!(same(&opened, &frame(value))); + } + + for value in [0i16, -1, i16::MIN, i16::MAX] { + let stored: smallint::Smallint = keyset.encrypt_as(&value, column()).await.unwrap(); + assert_v4_envelope(&stored, &["v", "i", "c"]); + let opened: i16 = cipher + .decrypt_as(stored.clone(), column().into()) + .await + .unwrap(); + assert_eq!(opened, value); + assert!(same( + &as_frame(&cipher, stored.c.clone()).await, + &frame(value) + )); + let named: smallint::Smallint = by_name(&keyset, "Smallint", frame::(value)).await; + let opened = targets::decrypt( + "Smallint", + &cipher, + &label(), + &serde_json::to_vec(&named).unwrap(), + ) + .unwrap() + .await + .unwrap(); + assert!(same(&opened, &frame(value))); + } + + for value in [0i64, -1, i64::MIN, i64::MAX] { + let stored: bigint::Bigint = keyset.encrypt_as(&value, column()).await.unwrap(); + assert_v4_envelope(&stored, &["v", "i", "c"]); + let opened: i64 = cipher + .decrypt_as(stored.clone(), column().into()) + .await + .unwrap(); + assert_eq!(opened, value); + assert!(same( + &as_frame(&cipher, stored.c.clone()).await, + &frame(value) + )); + } +} + +/// The `hm` the named type stores for `value`, and the one its query twin +/// derives. +async fn eq_terms( + keyset: &stack_encrypt::KeysetCipher<'_, common::Observed>, + name: &str, + value: ValueFrame, +) -> (serde_json::Value, serde_json::Value) { + let stored: serde_json::Value = by_name(keyset, name, value.clone()).await; + let query = targets::query(name, keyset, &label(), value) + .unwrap() + .await + .unwrap(); + let query: serde_json::Value = serde_json::from_slice(&query).unwrap(); + (stored["hm"].clone(), query["hm"].clone()) +} + +/// The equality term follows ADR-0002's semantic baseline: integers of +/// either width share one term for one value, and a float's `-0.0` and every +/// NaN fold to one value each, as Postgres's own `float8 =` treats them. +#[tokio::test] +async fn number_equality_terms_follow_the_semantic_baseline() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + let hm = |name: &'static str, value: ValueFrame| { + let keyset = &keyset; + async move { + let (stored, query) = eq_terms(keyset, name, value).await; + assert!(stored.is_string(), "{name} stores an hm: {stored}"); + assert_eq!(stored, query, "{name}: the query probes the stored term"); + stored + } + }; + + assert_ne!( + hm("IntegerEq", frame::(42)).await, + hm("IntegerEq", frame::(43)).await + ); + assert_eq!( + hm("IntegerEq", frame::(42)).await, + hm("BigintEq", frame::(42)).await, + "one integer domain for every width" + ); + assert_eq!( + hm("SmallintEq", frame::(42)).await, + hm("IntegerEq", frame::(42)).await, + "a smallint too" + ); + assert_ne!( + hm("SmallintEq", frame::(-1)).await, + hm("SmallintEq", frame::(1)).await + ); + + assert_eq!( + hm("RealEq", frame::(-0.0)).await, + hm("RealEq", frame::(0.0)).await + ); + assert_eq!( + hm("RealEq", frame::(f32::from_bits(0xffc0_1234))).await, + hm("RealEq", frame::(f32::NAN)).await + ); + assert_eq!( + hm("DoubleEq", frame::(-0.0)).await, + hm("DoubleEq", frame::(0.0)).await + ); + assert_eq!( + hm( + "DoubleEq", + frame::(f64::from_bits(0xfff8_0000_0000_beef)) + ) + .await, + hm("DoubleEq", frame::(f64::NAN)).await + ); + assert_ne!( + hm("DoubleEq", frame::(1.5)).await, + hm("DoubleEq", frame::(2.5)).await + ); + assert_eq!( + hm("RealEq", frame::(1.5)).await, + hm("DoubleEq", frame::(1.5)).await, + "an f32 hashes as the f64 it widens to" + ); + // An integer and a float are different kinds, even at one value. + assert_ne!( + hm("BigintEq", frame::(1)).await, + hm("DoubleEq", frame::(1.0)).await + ); +} + +/// The typed entry point stores the same term as the by-name dispatch, and +/// the ciphertext keeps the value exactly: `-0.0` folds in the term only. +#[tokio::test] +async fn number_equality_types_round_trip_through_the_typed_entry_point() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + + let stored: integer::IntegerEq = keyset.encrypt_as(&-7i32, column()).await.unwrap(); + assert_v4_envelope(&stored, &["v", "i", "c", "hm"]); + let named: serde_json::Value = by_name(&keyset, "IntegerEq", frame::(-7)).await; + assert_eq!(serde_json::to_value(&stored).unwrap()["hm"], named["hm"]); + let opened: i32 = cipher.decrypt_as(stored, column().into()).await.unwrap(); + assert_eq!(opened, -7); + + let stored: smallint::SmallintEq = keyset.encrypt_as(&i16::MIN, column()).await.unwrap(); + assert_v4_envelope(&stored, &["v", "i", "c", "hm"]); + let named: serde_json::Value = by_name(&keyset, "SmallintEq", frame::(i16::MIN)).await; + assert_eq!(serde_json::to_value(&stored).unwrap()["hm"], named["hm"]); + let opened: i16 = cipher.decrypt_as(stored, column().into()).await.unwrap(); + assert_eq!(opened, i16::MIN); + + let stored: bigint::BigintEq = keyset.encrypt_as(&i64::MIN, column()).await.unwrap(); + assert_v4_envelope(&stored, &["v", "i", "c", "hm"]); + let opened: i64 = cipher.decrypt_as(stored, column().into()).await.unwrap(); + assert_eq!(opened, i64::MIN); + + let stored: real::RealEq = keyset.encrypt_as(&-0.0f32, column()).await.unwrap(); + assert_v4_envelope(&stored, &["v", "i", "c", "hm"]); + let opened: f32 = cipher.decrypt_as(stored, column().into()).await.unwrap(); + assert_eq!(opened.to_bits(), (-0.0f32).to_bits()); + + let stored: double::DoubleEq = keyset.encrypt_as(&f64::NAN, column()).await.unwrap(); + assert_v4_envelope(&stored, &["v", "i", "c", "hm"]); + let opened: f64 = cipher.decrypt_as(stored, column().into()).await.unwrap(); + assert_eq!(opened.to_bits(), f64::NAN.to_bits()); +} + +#[tokio::test] +async fn booleans_and_floats_round_trip_as_storage_only_types() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + for value in [true, false] { + let stored: boolean::Boolean = keyset.encrypt_as(&value, column()).await.unwrap(); + assert_v4_envelope(&stored, &["v", "i", "c"]); + let opened: bool = cipher + .decrypt_as(stored.clone(), column().into()) + .await + .unwrap(); + assert_eq!(opened, value); + assert!(same(&as_frame(&cipher, stored.c).await, &frame(value))); + } + // Floats seal their bit pattern: -0.0 and a NaN's payload survive. + for value in [1.5f32, -0.0, f32::NAN, f32::INFINITY] { + let stored: real::Real = keyset.encrypt_as(&value, column()).await.unwrap(); + let opened: f32 = cipher + .decrypt_as(stored.clone(), column().into()) + .await + .unwrap(); + assert_eq!(opened.to_bits(), value.to_bits()); + assert!(same(&as_frame(&cipher, stored.c).await, &frame(value))); + } + for value in [2.25f64, -0.0, f64::NAN] { + let stored: double::Double = keyset.encrypt_as(&value, column()).await.unwrap(); + let opened: f64 = cipher + .decrypt_as(stored.clone(), column().into()) + .await + .unwrap(); + assert_eq!(opened.to_bits(), value.to_bits()); + assert!(same(&as_frame(&cipher, stored.c).await, &frame(value))); + } +} + +/// The direction `LeafVisitor` and `BoolVisitor` implement: a leaf sealed +/// from a frame, as a plain Go field writes it, opens as the typed plaintext. +#[tokio::test] +async fn a_leaf_sealed_from_a_frame_opens_as_the_typed_plaintext() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + let c = sealed_from_frame(&keyset, frame::(-7)).await; + let opened: i32 = cipher + .decrypt_as(stored_as::(c), column().into()) + .await + .unwrap(); + assert_eq!(opened, -7); + + let c = sealed_from_frame(&keyset, frame::(i64::MAX)).await; + let opened: i64 = cipher + .decrypt_as(stored_as::(c), column().into()) + .await + .unwrap(); + assert_eq!(opened, i64::MAX); + + let c = sealed_from_frame(&keyset, frame::(true)).await; + let opened: bool = cipher + .decrypt_as(stored_as::(c), column().into()) + .await + .unwrap(); + assert!(opened); + + let c = sealed_from_frame(&keyset, frame::(-0.0)).await; + let opened: f32 = cipher + .decrypt_as(stored_as::(c), column().into()) + .await + .unwrap(); + assert_eq!(opened.to_bits(), (-0.0f32).to_bits()); + + let c = sealed_from_frame(&keyset, frame::(f64::NAN)).await; + let opened: f64 = cipher + .decrypt_as(stored_as::(c), column().into()) + .await + .unwrap(); + assert_eq!(opened.to_bits(), f64::NAN.to_bits()); +} + +/// Every producible row of the generated table, through all three by-name +/// entry points: a swapped type or plaintext in the generator fails here. +#[tokio::test] +async fn every_producible_type_dispatches_by_name() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + let producible: Vec<_> = targets::targets().iter().filter(|t| t.producible).collect(); + assert!(!producible.is_empty()); + for target in producible { + let name = target.name; + let kind = target + .plaintext_kind() + .expect("a producible type names its kind"); + let stored = targets::encrypt(name, &keyset, &label(), sample(kind)) + .unwrap() + .await + .unwrap(); + let json: serde_json::Value = serde_json::from_slice(&stored).unwrap(); + assert_eq!(json["v"], 4, "{name}"); + let opened = targets::decrypt(name, &cipher, &label(), &stored) + .unwrap() + .await + .unwrap(); + assert!(same(&opened, &sample(kind)), "{name}: opened another value"); + + match target.query { + None => { + let error = refused(targets::query(name, &keyset, &label(), sample(kind))); + assert!( + matches!(error, TargetError::NoQuery { .. }), + "{name}: {error}" + ); + } + Some(_) => { + let query = targets::query(name, &keyset, &label(), sample(kind)) + .unwrap() + .await + .unwrap(); + let query: serde_json::Value = serde_json::from_slice(&query).unwrap(); + assert!( + query.get("c").is_none(), + "{name}: a query carries no ciphertext" + ); + if target.indexes.contains(&"eq") { + assert_eq!( + query["hm"], json["hm"], + "{name}: the query probes the stored term" + ); + } + if target.indexes.contains(&"ope") { + assert!(json["op"].is_string(), "{name} stores an op"); + assert_eq!( + query["op"], json["op"], + "{name}: the query compares the stored order term" + ); + } + } + } + } +} + +#[tokio::test] +async fn storage_only_text_round_trips_through_both_entry_points() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + let stored: text::Text = keyset + .encrypt_as(&"a private note".to_owned(), column()) + .await + .unwrap(); + assert_v4_envelope(&stored, &["v", "i", "c"]); + let opened: String = cipher.decrypt_as(stored, column().into()).await.unwrap(); + assert_eq!(opened, "a private note"); + + let named: text::Text = by_name(&keyset, "Text", frame("note")).await; + let opened: String = cipher.decrypt_as(named, column().into()).await.unwrap(); + assert_eq!(opened, "note"); + // A storage-only type answers no query. + let error = refused(targets::query("Text", &keyset, &label(), frame("note"))); + assert!( + matches!(error, TargetError::NoQuery { name: "Text" }), + "{error}" + ); +} + +/// A match query's filter positions, which EQL's `@@` tests for containment. +fn positions(filter: &eql_bindings::v3::terms::BloomFilter) -> std::collections::BTreeSet { + filter.0.iter().copied().collect() +} + +#[tokio::test] +async fn text_match_filters_contain_their_substrings() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + let stored: text::TextMatch = keyset + .encrypt_as(&"Alice@Example.com".to_owned(), column()) + .await + .unwrap(); + assert_v4_envelope(&stored, &["v", "i", "c", "bf"]); + assert!( + stored.bf.0.iter().all(|&p| (0..2048).contains(&p)), + "a 2048-bit filter" + ); + let opened: String = cipher + .decrypt_as(stored.clone(), column().into()) + .await + .unwrap(); + assert_eq!(opened, "Alice@Example.com"); + + // `true` is a property of the filter: every bit a contained needle sets + // is set in the stored value's. `false` is not: a Bloom filter can cover + // an absent needle's bits by chance. "bob" is clear of it under the + // test key source and the pinned configuration, so a change to either + // can flip that case with no bug behind it. + let all = positions(&stored.bf); + for (needle, contained) in [ + ("alice", true), + ("EXAMPLE", true), + ("ice@ex", true), + ("bob", false), + ] { + let query: text::TextMatchQuery = keyset + .encrypt_as(&needle.to_owned(), column()) + .await + .unwrap(); + assert_eq!( + positions(&query.bf).is_subset(&all), + contained, + "{needle:?} in Alice@Example.com" + ); + } + + // The dispatch derives the same filter. + let named: text::TextMatch = by_name(&keyset, "TextMatch", frame("Alice@Example.com")).await; + assert_eq!(named.bf, stored.bf); + + // Text shorter than a 3-gram has no tokens. eql-bindings refuses it for a + // stored value as well as a query: one filter type builds both, and an + // empty filter as a query would match every row. So a short value cannot + // be written to a TextMatch column yet. + let short: Result = keyset.encrypt_as(&"ab".to_owned(), column()).await; + assert!(short.is_err()); + let short_query: Result = + keyset.encrypt_as(&"ab".to_owned(), column()).await; + assert!(short_query.is_err(), "a short query would match every row"); +} + +/// The filter bits for one query under the test key source. The +/// configuration is part of the stored format (`EqlMatch`): if these move, +/// every stored filter stops agreeing with new queries, so a change here must +/// arrive as a new domain or payload version. +#[tokio::test] +async fn text_match_filter_positions_are_pinned() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + let query: text::TextMatchQuery = keyset + .encrypt_as(&"alice".to_owned(), column()) + .await + .unwrap(); + // 3 tokens ("ali", "lic", "ice") at 6 positions each, de-duplicated. + assert_eq!(query.bf.0, PINNED_ALICE); +} + +const PINNED_ALICE: [i16; 18] = [ + 9, 203, 351, 542, 626, 697, 748, 872, 917, 1023, 1062, 1190, 1251, 1355, 1613, 1710, 1792, 2025, +]; + +#[tokio::test] +async fn a_value_of_another_kind_is_refused_not_converted() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + for (name, value, expected) in [ + ("Integer", frame::(1), ValueKind::Int32), + ("Smallint", frame::(1), ValueKind::Int16), + ("SmallintEq", frame::(1), ValueKind::Int16), + ("Bigint", frame::(1), ValueKind::Int64), + ("Boolean", frame::(1), ValueKind::Bool), + ("Real", frame::(1.0), ValueKind::Float32), + ("Text", frame::(1), ValueKind::String), + ] { + let error = refused(targets::encrypt(name, &keyset, &label(), value)); + assert!( + matches!(error, TargetError::Plaintext { target, expected: e, .. } if target == name && e == expected), + "{name}: {error}" + ); + } + + // A ciphertext moved into another type opens through that type's Rust + // plaintext as vitaminc reads it: an integer of another width that fits + // opens unchanged, one that does not fit is refused, and a value of + // another kind is refused. + let narrow: integer::Integer = keyset.encrypt_as(&42i32, column()).await.unwrap(); + let moved = bigint::Bigint { + v: narrow.v, + i: narrow.i.clone(), + c: narrow.c.clone(), + }; + let opened: i64 = cipher.decrypt_as(moved, column().into()).await.unwrap(); + assert_eq!(opened, 42); + + let wide: bigint::Bigint = keyset.encrypt_as(&i64::MAX, column()).await.unwrap(); + let moved = integer::Integer { + v: narrow.v, + i: wide.i, + c: wide.c, + }; + let opened: Result = cipher.decrypt_as(moved, column().into()).await; + assert!(opened.is_err(), "i64::MAX does not fit an i32"); + + let moved = smallint::Smallint { + v: narrow.v, + i: narrow.i.clone(), + c: narrow.c.clone(), + }; + let opened: i16 = cipher.decrypt_as(moved, column().into()).await.unwrap(); + assert_eq!(opened, 42, "an i32 that fits opens as an i16"); + let big: integer::Integer = keyset.encrypt_as(&70_000i32, column()).await.unwrap(); + let moved = smallint::Smallint { + v: narrow.v, + i: big.i, + c: big.c, + }; + let opened: Result = cipher.decrypt_as(moved, column().into()).await; + assert!(opened.is_err(), "70000 does not fit an i16"); + + let flag: boolean::Boolean = keyset.encrypt_as(&true, column()).await.unwrap(); + let moved = integer::Integer { + v: narrow.v, + i: flag.i, + c: flag.c, + }; + let opened: Result = cipher.decrypt_as(moved, column().into()).await; + assert!(opened.is_err(), "a bool is not an integer"); +} + +/// Needs an EQL v4 installation; uses fresh real ciphertext with a fake key +/// source. +#[test] +#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v4 database"] +fn postgres_stores_and_queries_every_producible_v4_type() { + let runtime = tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap(); + let (cipher, _) = runtime.block_on(common::cipher()); + let keyset = cipher.default_keyset(); + let mut db = postgres::Client::connect( + &std::env::var("EQL_TEST_DATABASE_URL").expect("EQL_TEST_DATABASE_URL"), + postgres::NoTls, + ) + .unwrap(); + db.batch_execute( + "CREATE TEMP TABLE v4_types ( + id int PRIMARY KEY, + age public.eql_v4_integer, + balance public.eql_v4_bigint, + active public.eql_v4_boolean, + ratio public.eql_v4_real, + score public.eql_v4_double, + note public.eql_v4_text, + name public.eql_v4_text_match + );", + ) + .unwrap(); + + let json = |value: &dyn erased::Json| value.to_json(); + for (id, age, balance) in [(1, 42, 10i64), (2, 7, 20), (3, 42, 30)] { + let row = runtime.block_on(async { + ( + keyset + .encrypt_as::<_, integer::Integer>(&age, column()) + .await + .unwrap(), + keyset + .encrypt_as::<_, bigint::Bigint>(&balance, column()) + .await + .unwrap(), + keyset + .encrypt_as::<_, boolean::Boolean>(&(id % 2 == 0), column()) + .await + .unwrap(), + keyset + .encrypt_as::<_, real::Real>(&0.5f32, column()) + .await + .unwrap(), + keyset + .encrypt_as::<_, double::Double>(&0.25f64, column()) + .await + .unwrap(), + keyset + .encrypt_as::<_, text::Text>(&"note".to_owned(), column()) + .await + .unwrap(), + keyset + .encrypt_as::<_, text::TextMatch>(&format!("user{id}@example.com"), column()) + .await + .unwrap(), + ) + }); + db.execute( + "INSERT INTO v4_types VALUES ($1, + $2::text::jsonb::public.eql_v4_integer, + $3::text::jsonb::public.eql_v4_bigint, + $4::text::jsonb::public.eql_v4_boolean, + $5::text::jsonb::public.eql_v4_real, + $6::text::jsonb::public.eql_v4_double, + $7::text::jsonb::public.eql_v4_text, + $8::text::jsonb::public.eql_v4_text_match)", + &[ + &id, + &json(&row.0), + &json(&row.1), + &json(&row.2), + &json(&row.3), + &json(&row.4), + &json(&row.5), + &json(&row.6), + ], + ) + .unwrap(); + } + + let mut matching = |needle: &str| -> Vec { + let probe: text::TextMatchQuery = runtime + .block_on(async { keyset.encrypt_as(&needle.to_owned(), column()).await }) + .unwrap(); + db.query( + "SELECT id FROM v4_types WHERE name @@ $1::text::jsonb::eql_v4.query_text_match ORDER BY id", + &[&json(&probe)], + ) + .unwrap() + .iter() + .map(|r| r.get(0)) + .collect() + }; + assert_eq!(matching("example.com"), [1, 2, 3], "TextMatch: every row"); + assert_eq!(matching("user2"), [2], "TextMatch: one row"); + assert_eq!(matching("nobody"), Vec::::new(), "TextMatch: none"); + + // Known gap in the SQL (#1171), pinned so its fix shows here: with the + // query on the left, `@@` asks whether the query's filter contains the + // stored value's, so that operand order finds nothing. Only + // `stored @@ query` works until then; the README says so. + let probe: text::TextMatchQuery = runtime + .block_on(async { keyset.encrypt_as(&"user2".to_owned(), column()).await }) + .unwrap(); + let reversed: Vec = db + .query( + "SELECT id FROM v4_types WHERE $1::text::jsonb::eql_v4.query_text_match @@ name", + &[&json(&probe)], + ) + .unwrap() + .iter() + .map(|r| r.get(0)) + .collect(); + assert_eq!( + reversed, + Vec::::new(), + "query @@ stored still finds nothing (#1171); when the SQL is fixed this becomes [2]" + ); + + // Every stored value reads back from its domain and opens. + let row = db + .query_one( + "SELECT age::text, balance::text, active::text, ratio::text, score::text, note::text + FROM v4_types WHERE id = 2", + &[], + ) + .unwrap(); + let open = |i: usize| -> String { row.get(i) }; + runtime.block_on(async { + let opened: i32 = cipher + .decrypt_as( + serde_json::from_str::(&open(0)).unwrap(), + column().into(), + ) + .await + .unwrap(); + assert_eq!(opened, 7); + let opened: i64 = cipher + .decrypt_as( + serde_json::from_str::(&open(1)).unwrap(), + column().into(), + ) + .await + .unwrap(); + assert_eq!(opened, 20); + let opened: bool = cipher + .decrypt_as( + serde_json::from_str::(&open(2)).unwrap(), + column().into(), + ) + .await + .unwrap(); + assert!(opened); + let opened: f32 = cipher + .decrypt_as( + serde_json::from_str::(&open(3)).unwrap(), + column().into(), + ) + .await + .unwrap(); + assert_eq!(opened, 0.5); + let opened: f64 = cipher + .decrypt_as( + serde_json::from_str::(&open(4)).unwrap(), + column().into(), + ) + .await + .unwrap(); + assert_eq!(opened, 0.25); + let opened: String = cipher + .decrypt_as( + serde_json::from_str::(&open(5)).unwrap(), + column().into(), + ) + .await + .unwrap(); + assert_eq!(opened, "note"); + }); + + // A storage-only column has no equality operator: it is blocked, not + // silently compared as jsonb. + let err = db + .query("SELECT id FROM v4_types WHERE age = age", &[]) + .unwrap_err(); + let message = err.as_db_error().map(|e| e.message()).unwrap_or_default(); + assert!( + message.contains("is not supported for public.eql_v4_integer"), + "{message}" + ); +} + +/// Needs an EQL v4 installation. `=` on each number equality type finds +/// exactly the rows its query names, with `-0.0` and NaN treated as +/// Postgres's own `float8 =` treats them. +#[test] +#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v4 database"] +fn postgres_finds_number_equality_rows() { + let runtime = tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap(); + let (cipher, _) = runtime.block_on(common::cipher()); + let keyset = cipher.default_keyset(); + let mut db = postgres::Client::connect( + &std::env::var("EQL_TEST_DATABASE_URL").expect("EQL_TEST_DATABASE_URL"), + postgres::NoTls, + ) + .unwrap(); + db.batch_execute( + "CREATE TEMP TABLE v4_number_eq ( + id int PRIMARY KEY, + age public.eql_v4_integer_eq, + balance public.eql_v4_bigint_eq, + ratio public.eql_v4_real_eq, + score public.eql_v4_double_eq + );", + ) + .unwrap(); + + let json = |value: &dyn erased::Json| value.to_json(); + let rows = [ + (1, 42, 10i64, 0.5f32, 0.0f64), + (2, 7, -1, -0.0, f64::NAN), + (3, 42, i64::MAX, 0.0, -0.0), + ]; + for (id, age, balance, ratio, score) in rows { + let stored = runtime.block_on(async { + ( + keyset + .encrypt_as::<_, integer::IntegerEq>(&age, column()) + .await + .unwrap(), + keyset + .encrypt_as::<_, bigint::BigintEq>(&balance, column()) + .await + .unwrap(), + keyset + .encrypt_as::<_, real::RealEq>(&ratio, column()) + .await + .unwrap(), + keyset + .encrypt_as::<_, double::DoubleEq>(&score, column()) + .await + .unwrap(), + ) + }); + db.execute( + "INSERT INTO v4_number_eq VALUES ($1, + $2::text::jsonb::public.eql_v4_integer_eq, + $3::text::jsonb::public.eql_v4_bigint_eq, + $4::text::jsonb::public.eql_v4_real_eq, + $5::text::jsonb::public.eql_v4_double_eq)", + &[ + &id, + &json(&stored.0), + &json(&stored.1), + &json(&stored.2), + &json(&stored.3), + ], + ) + .unwrap(); + } + + let mut ids = |column_name: &str, query_domain: &str, query: String| -> Vec { + db.query( + &format!( + "SELECT id FROM v4_number_eq WHERE {column_name} = $1::text::jsonb::eql_v4.{query_domain} ORDER BY id" + ), + &[&query], + ) + .unwrap() + .iter() + .map(|r| r.get(0)) + .collect() + }; + let q = |stored: Result| stored.unwrap(); + let age = |v: i32| { + q(runtime.block_on(async { + keyset + .encrypt_as::<_, integer::IntegerEqQuery>(&v, column()) + .await + .map(|q| json(&q)) + })) + }; + let balance = |v: i64| { + q(runtime.block_on(async { + keyset + .encrypt_as::<_, bigint::BigintEqQuery>(&v, column()) + .await + .map(|q| json(&q)) + })) + }; + let ratio = |v: f32| { + q(runtime.block_on(async { + keyset + .encrypt_as::<_, real::RealEqQuery>(&v, column()) + .await + .map(|q| json(&q)) + })) + }; + let score = |v: f64| { + q(runtime.block_on(async { + keyset + .encrypt_as::<_, double::DoubleEqQuery>(&v, column()) + .await + .map(|q| json(&q)) + })) + }; + let (age_42, age_8) = (age(42), age(8)); + let (balance_max, balance_0) = (balance(i64::MAX), balance(0)); + let (ratio_zero, ratio_half) = (ratio(0.0), ratio(0.5)); + let (score_neg_zero, score_nan) = (score(-0.0), score(f64::from_bits(0xfff8_0000_0000_beef))); + + assert_eq!(ids("age", "query_integer_eq", age_42), [1, 3]); + assert_eq!(ids("age", "query_integer_eq", age_8), Vec::::new()); + assert_eq!(ids("balance", "query_bigint_eq", balance_max), [3]); + assert_eq!( + ids("balance", "query_bigint_eq", balance_0), + Vec::::new() + ); + assert_eq!( + ids("ratio", "query_real_eq", ratio_zero), + [2, 3], + "-0.0 = 0.0" + ); + assert_eq!(ids("ratio", "query_real_eq", ratio_half), [1]); + assert_eq!( + ids("score", "query_double_eq", score_neg_zero), + [1, 3], + "-0.0 = 0.0" + ); + assert_eq!( + ids("score", "query_double_eq", score_nan), + [2], + "NaN = NaN, whatever its payload" + ); +} + +/// Needs an EQL v4 installation. A `Smallint` stores and reads back, and +/// `=` on a `SmallintEq` column finds the rows its query names, including +/// the extremes of the width. +#[test] +#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v4 database"] +fn postgres_stores_and_finds_smallint_rows() { + let runtime = tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap(); + let (cipher, _) = runtime.block_on(common::cipher()); + let keyset = cipher.default_keyset(); + let mut db = postgres::Client::connect( + &std::env::var("EQL_TEST_DATABASE_URL").expect("EQL_TEST_DATABASE_URL"), + postgres::NoTls, + ) + .unwrap(); + db.batch_execute( + "CREATE TEMP TABLE v4_smallint ( + id int PRIMARY KEY, + plain public.eql_v4_smallint, + searchable public.eql_v4_smallint_eq + );", + ) + .unwrap(); + let json = |value: &dyn erased::Json| value.to_json(); + for (id, value) in [(1, i16::MIN), (2, 7i16), (3, i16::MAX), (4, 7)] { + let (plain, searchable) = runtime.block_on(async { + ( + keyset + .encrypt_as::<_, smallint::Smallint>(&value, column()) + .await + .unwrap(), + keyset + .encrypt_as::<_, smallint::SmallintEq>(&value, column()) + .await + .unwrap(), + ) + }); + db.execute( + "INSERT INTO v4_smallint VALUES ($1, + $2::text::jsonb::public.eql_v4_smallint, + $3::text::jsonb::public.eql_v4_smallint_eq)", + &[&id, &json(&plain), &json(&searchable)], + ) + .unwrap(); + } + let mut ids = |value: i16| -> Vec { + let query: smallint::SmallintEqQuery = runtime + .block_on(async { keyset.encrypt_as(&value, column()).await }) + .unwrap(); + db.query( + "SELECT id FROM v4_smallint WHERE searchable = $1::text::jsonb::eql_v4.query_smallint_eq ORDER BY id", + &[&json(&query)], + ) + .unwrap() + .iter() + .map(|r| r.get(0)) + .collect() + }; + assert_eq!(ids(7), [2, 4]); + assert_eq!(ids(i16::MIN), [1]); + assert_eq!(ids(i16::MAX), [3]); + assert_eq!(ids(8), Vec::::new()); + + let back: String = db + .query_one("SELECT plain::text FROM v4_smallint WHERE id = 1", &[]) + .unwrap() + .get(0); + let opened: i16 = runtime + .block_on(async { + cipher + .decrypt_as( + serde_json::from_str::(&back).unwrap(), + column().into(), + ) + .await + }) + .unwrap(); + assert_eq!(opened, i16::MIN); + + // The storage-only column has no equality operator. + let err = db + .query("SELECT id FROM v4_smallint WHERE plain = plain", &[]) + .unwrap_err(); + let message = err.as_db_error().map(|e| e.message()).unwrap_or_default(); + assert!( + message.contains("is not supported for public.eql_v4_smallint"), + "{message}" + ); +} + +/// `fixtures/v4_smallint_rows.json`: `Tally` rows the Go SDK's generated +/// code sealed over the deterministic EQL guest +/// (`TestV4SmallintRowsMatchTheCommittedFixture` writes it). +mod go_tally { + use super::*; + use std::collections::BTreeMap; + + #[derive(serde::Deserialize)] + pub struct Fixture { + pub seed: String, + pub table: String, + pub rows: Vec, + } + #[derive(serde::Deserialize)] + pub struct Row { + pub id: i32, + pub plaintext: Plain, + pub stored: BTreeMap, + } + #[derive(serde::Deserialize)] + pub struct Plain { + pub small: i16, + pub tally: i16, + pub wide: i32, + } + + /// The committed rows, or the file `EQL_V4_SMALLINT_ROWS` names: CI + /// points it at rows the Go SDK sealed in the same job, so today's Go + /// ciphertexts reach Rust, not only the committed ones. + pub fn fixture() -> Fixture { + let path = std::env::var_os("EQL_V4_SMALLINT_ROWS").map_or_else( + || { + std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("fixtures/v4_smallint_rows.json") + }, + std::path::PathBuf::from, + ); + let raw = std::fs::read_to_string(path).expect( + "fixtures/v4_smallint_rows.json is written by the Go SDK's \ + TestV4SmallintRowsMatchTheCommittedFixture", + ); + serde_json::from_str(&raw).unwrap() + } + + /// Open every field of `row` as its v4 type and check it against what + /// Go sealed. The `int32` field `wide` was sealed at 16 bits, so it + /// opens as an `i16` here. + pub async fn open_row( + cipher: &stack_encrypt::StackCipher, + row: &Row, + ) { + let column = |name: &str| Identifier::for_column("profiles", name).unwrap(); + let parsed = |name: &str| row.stored[name].clone(); + let small: i16 = cipher + .decrypt_as( + serde_json::from_value::(parsed("small")).unwrap(), + column("small").into(), + ) + .await + .unwrap(); + assert_eq!(small, row.plaintext.small, "row {} small", row.id); + let tally: i16 = cipher + .decrypt_as( + serde_json::from_value::(parsed("tally")).unwrap(), + column("tally").into(), + ) + .await + .unwrap(); + assert_eq!(tally, row.plaintext.tally, "row {} tally", row.id); + let wide: i16 = cipher + .decrypt_as( + serde_json::from_value::(parsed("wide")).unwrap(), + column("wide").into(), + ) + .await + .unwrap(); + assert_eq!(i32::from(wide), row.plaintext.wide, "row {} wide", row.id); + } +} + +/// What the Go SDK sealed as `Smallint` and `SmallintEq` parses as each +/// type and opens in Rust, at 16 bits, field by field. +#[tokio::test] +async fn smallint_rows_the_go_sdk_sealed_open_in_rust() { + let fixture = go_tally::fixture(); + assert_eq!(fixture.table, "profiles"); + assert!(fixture.rows.len() > 1); + let cipher = go_rows::cipher(&fixture.seed).await; + for row in &fixture.rows { + go_tally::open_row(&cipher, row).await; + } +} + +/// The Go-sealed smallint rows in PostgreSQL: each value passes its domain +/// check, and `=` with the fixture's `SmallintEq` query (which the Go SDK's +/// test derives byte for byte) finds the rows holding that value. +#[test] +#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v4 database"] +fn postgres_stores_and_queries_smallint_rows_the_go_sdk_sealed() { + let fixture = go_tally::fixture(); + let mut db = postgres::Client::connect( + &std::env::var("EQL_TEST_DATABASE_URL").expect("EQL_TEST_DATABASE_URL"), + postgres::NoTls, + ) + .unwrap(); + db.batch_execute( + "CREATE TEMP TABLE go_tallies ( + id int PRIMARY KEY, + small public.eql_v4_smallint, + tally public.eql_v4_smallint_eq, + wide public.eql_v4_smallint_eq + );", + ) + .unwrap(); + for row in &fixture.rows { + let v = |column: &str| row.stored[column].to_string(); + db.execute( + "INSERT INTO go_tallies VALUES ($1, + $2::text::jsonb::public.eql_v4_smallint, + $3::text::jsonb::public.eql_v4_smallint_eq, + $4::text::jsonb::public.eql_v4_smallint_eq)", + &[&row.id, &v("small"), &v("tally"), &v("wide")], + ) + .unwrap(); + } + let queries: serde_json::Value = serde_json::from_str( + &std::fs::read_to_string( + std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("fixtures/v4_queries.json"), + ) + .unwrap(), + ) + .unwrap(); + let plaintext = queries["tally"]["plaintext"].as_i64().unwrap(); + let expected: Vec = fixture + .rows + .iter() + .filter(|r| i64::from(r.plaintext.tally) == plaintext) + .map(|r| r.id) + .collect(); + assert!( + !expected.is_empty() && expected.len() < fixture.rows.len(), + "the fixture splits the rows" + ); + let ids: Vec = db + .query( + "SELECT id FROM go_tallies WHERE tally = $1::text::jsonb::eql_v4.query_smallint_eq ORDER BY id", + &[&queries["tally"]["query"].as_str().unwrap()], + ) + .unwrap() + .iter() + .map(|r| r.get(0)) + .collect(); + assert_eq!(ids, expected, "= over Go-sealed tally"); +} + +/// A stored value's JSON text, for binding as `$n::text::jsonb`. +mod erased { + pub trait Json { + fn to_json(&self) -> String; + } + impl Json for T { + fn to_json(&self) -> String { + serde_json::to_string(self).unwrap() + } + } +} + +/// `fixtures/v4_queries.json`: the query operands the Rust dispatch derives +/// for one value of each v4 type that answers a query, under the key source +/// every test in the repository derives terms under (`FakeDataKeySource`'s +/// index key, keyset nil). The Go SDK's hermetic test derives the same +/// queries through generated code over the deterministic guest build, whose +/// index key is the same, and asserts the bytes are equal: a Go field typed +/// `encrypt_into=TextMatch` runs this plan and no other. Regenerate with +/// `EQL_UPDATE_FIXTURES=1`; the bytes must not change otherwise. +#[tokio::test] +async fn the_v4_query_fixture_is_what_the_dispatch_derives() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + let query = |name: &'static str, column: &'static str, value: ValueFrame| { + let keyset = &keyset; + async move { + let label = Label::new(["profiles", column]).unwrap(); + let bytes = targets::query(name, keyset, &label, value) + .unwrap() + .await + .unwrap(); + String::from_utf8(bytes).unwrap() + } + }; + let fixture = serde_json::json!({ + "_comment": "The v4 query operands eql-bindings derives for each plaintext under FakeDataKeySource's index key (keyset nil), read by the Go SDK's hermetic test; regenerate with EQL_UPDATE_FIXTURES=1, do not edit.", + "table": "profiles", + "name": { + "plaintext": "alice", + "query": query("TextMatch", "name", frame("alice")).await, + }, + "age": { + "plaintext": 42, + "query": query("IntegerEq", "age", frame::(42)).await, + }, + "rank": { + "plaintext": 7, + "query": query("BigintEq", "rank", frame::(7)).await, + }, + "weight": { + "plaintext": 1.5, + "query": query("RealEq", "weight", frame::(1.5)).await, + }, + "price": { + "plaintext": 9.75, + "query": query("DoubleEq", "price", frame::(9.75)).await, + }, + "email": { + "plaintext": "alice@example.com", + "query": query("TextEq", "email", frame("alice@example.com")).await, + }, + "tally": { + "plaintext": -12, + "query": query("SmallintEq", "tally", frame::(-12)).await, + }, + }); + let path = + std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("fixtures/v4_queries.json"); + let rendered = serde_json::to_string_pretty(&fixture).unwrap() + "\n"; + if std::env::var_os("EQL_UPDATE_FIXTURES").is_some() { + std::fs::write(&path, &rendered).unwrap(); + } + let committed = std::fs::read_to_string(&path) + .expect("fixtures/v4_queries.json is committed; EQL_UPDATE_FIXTURES=1 writes it"); + assert_eq!( + committed, rendered, + "the committed fixture is what the dispatch derives today" + ); +} + +/// `fixtures/v4_rows.json`: `Profile` rows the Go SDK's generated code sealed +/// over the deterministic EQL guest (`TestV4RowsMatchTheCommittedFixture` in +/// languages/golang/encrypt writes it). The guest derives its keys with +/// stack-kms's `DeterministicSource`, so a cipher over the same seed opens +/// what Go sealed. +mod go_rows { + use super::*; + use std::collections::BTreeMap; + + #[derive(serde::Deserialize)] + pub struct Fixture { + pub seed: String, + pub table: String, + pub rows: Vec, + } + #[derive(serde::Deserialize)] + pub struct Row { + pub id: i32, + pub plaintext: Plain, + pub stored: BTreeMap, + } + #[derive(serde::Deserialize, Clone)] + pub struct Plain { + pub visits: i32, + pub balance: i64, + pub active: bool, + pub ratio: f32, + pub score: f64, + pub note: String, + pub name: String, + pub age: i32, + pub rank: i64, + pub weight: f32, + pub price: f64, + pub email: String, + } + + /// The committed rows, or the file `EQL_V4_ROWS` names: CI points it at + /// rows the Go SDK sealed in the same job, so today's Go ciphertexts + /// reach Rust, not only the committed ones. + pub fn fixture() -> Fixture { + let path = std::env::var_os("EQL_V4_ROWS").map_or_else( + || std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("fixtures/v4_rows.json"), + std::path::PathBuf::from, + ); + let raw = std::fs::read_to_string(path).expect( + "fixtures/v4_rows.json is written by the Go SDK's TestV4RowsMatchTheCommittedFixture", + ); + serde_json::from_str(&raw).unwrap() + } + + /// `fixtures/stored_v4_rows_v1.json`: rows the Go SDK stored with the + /// next build. Frozen: nothing writes it, and no variable redirects it. + pub fn frozen() -> Fixture { + let path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("fixtures/stored_v4_rows_v1.json"); + let raw = + std::fs::read_to_string(path).expect("fixtures/stored_v4_rows_v1.json is committed"); + serde_json::from_str(&raw).unwrap() + } + + pub async fn cipher(seed: &str) -> stack_encrypt::StackCipher { + let seed: [u8; 32] = seed.as_bytes().try_into().expect("a 32-byte seed"); + stack_encrypt::StackCipher::builder() + .kms(stack_kms::DeterministicSource::new(seed)) + .init() + .await + .unwrap() + } + + pub fn column(name: &str) -> NonEmpty { + Identifier::for_column("profiles", name).unwrap() + } + + /// The stored value under `column`, parsed as its v4 type: the shape, the + /// version and the terms the Go code wrote. + pub fn parsed(row: &Row, column: &str) -> T { + serde_json::from_value(row.stored[column].clone()) + .unwrap_or_else(|e| panic!("row {} {column}: {e}", row.id)) + } + + /// Open every field of `row` and check it against the plaintext Go + /// sealed. + pub async fn open_row( + cipher: &stack_encrypt::StackCipher, + row: &Row, + ) { + let p = &row.plaintext; + let visits: i32 = cipher + .decrypt_as( + parsed::(row, "visits"), + column("visits").into(), + ) + .await + .unwrap(); + assert_eq!(visits, p.visits); + let balance: i64 = cipher + .decrypt_as( + parsed::(row, "balance"), + column("balance").into(), + ) + .await + .unwrap(); + assert_eq!(balance, p.balance); + let active: bool = cipher + .decrypt_as( + parsed::(row, "active"), + column("active").into(), + ) + .await + .unwrap(); + assert_eq!(active, p.active); + let ratio: f32 = cipher + .decrypt_as(parsed::(row, "ratio"), column("ratio").into()) + .await + .unwrap(); + assert_eq!(ratio.to_bits(), p.ratio.to_bits()); + let score: f64 = cipher + .decrypt_as( + parsed::(row, "score"), + column("score").into(), + ) + .await + .unwrap(); + assert_eq!(score.to_bits(), p.score.to_bits()); + let note: String = cipher + .decrypt_as(parsed::(row, "note"), column("note").into()) + .await + .unwrap(); + assert_eq!(note, p.note); + let name: String = cipher + .decrypt_as( + parsed::(row, "name"), + column("name").into(), + ) + .await + .unwrap(); + assert_eq!(name, p.name); + let age: i32 = cipher + .decrypt_as( + parsed::(row, "age"), + column("age").into(), + ) + .await + .unwrap(); + assert_eq!(age, p.age); + let rank: i64 = cipher + .decrypt_as( + parsed::(row, "rank"), + column("rank").into(), + ) + .await + .unwrap(); + assert_eq!(rank, p.rank); + let weight: f32 = cipher + .decrypt_as( + parsed::(row, "weight"), + column("weight").into(), + ) + .await + .unwrap(); + assert_eq!(weight.to_bits(), p.weight.to_bits()); + let price: f64 = cipher + .decrypt_as( + parsed::(row, "price"), + column("price").into(), + ) + .await + .unwrap(); + assert_eq!(price.to_bits(), p.price.to_bits()); + let email: String = cipher + .decrypt_as(parsed::(row, "email"), column("email").into()) + .await + .unwrap(); + assert_eq!(email, p.email); + } +} + +/// What the Go SDK sealed parses as each v4 type and opens in Rust, field by +/// field, under the column it was stored under. +#[tokio::test] +async fn rows_the_go_sdk_sealed_open_in_rust() { + let fixture = go_rows::fixture(); + assert_eq!(fixture.table, "profiles"); + assert!(!fixture.rows.is_empty()); + let cipher = go_rows::cipher(&fixture.seed).await; + for row in &fixture.rows { + go_rows::open_row(&cipher, row).await; + } +} + +/// The frozen rows the Go SDK stored with the next build still parse as each +/// v4 type and open, field by field. Unlike `v4_rows.json` this file is never +/// regenerated, so a change that breaks stored rows fails here. +#[tokio::test] +async fn frozen_rows_the_go_sdk_stored_still_open() { + let fixture = go_rows::frozen(); + assert_eq!(fixture.table, "profiles"); + assert!(!fixture.rows.is_empty()); + let cipher = go_rows::cipher(&fixture.seed).await; + for row in &fixture.rows { + go_rows::open_row(&cipher, row).await; + } +} + +/// The Go-sealed rows in PostgreSQL: each value passes its `eql_v4_*` domain +/// check, `@@` and `=` find the rows with the fixture's query operands (which +/// the Go SDK's test derives byte for byte), and what comes back out still +/// opens. +#[test] +#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v4 database"] +fn postgres_stores_and_queries_rows_the_go_sdk_sealed() { + let runtime = tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap(); + let fixture = go_rows::fixture(); + let cipher = runtime.block_on(go_rows::cipher(&fixture.seed)); + let mut db = postgres::Client::connect( + &std::env::var("EQL_TEST_DATABASE_URL").expect("EQL_TEST_DATABASE_URL"), + postgres::NoTls, + ) + .unwrap(); + db.batch_execute( + "CREATE TEMP TABLE go_profiles ( + id int PRIMARY KEY, + visits public.eql_v4_integer, + balance public.eql_v4_bigint, + active public.eql_v4_boolean, + ratio public.eql_v4_real, + score public.eql_v4_double, + note public.eql_v4_text, + name public.eql_v4_text_match, + age public.eql_v4_integer_eq, + rank public.eql_v4_bigint_eq, + weight public.eql_v4_real_eq, + price public.eql_v4_double_eq, + email public.eql_v4_text_eq + );", + ) + .unwrap(); + for row in &fixture.rows { + let v = |column: &str| row.stored[column].to_string(); + db.execute( + "INSERT INTO go_profiles VALUES ($1, + $2::text::jsonb::public.eql_v4_integer, + $3::text::jsonb::public.eql_v4_bigint, + $4::text::jsonb::public.eql_v4_boolean, + $5::text::jsonb::public.eql_v4_real, + $6::text::jsonb::public.eql_v4_double, + $7::text::jsonb::public.eql_v4_text, + $8::text::jsonb::public.eql_v4_text_match, + $9::text::jsonb::public.eql_v4_integer_eq, + $10::text::jsonb::public.eql_v4_bigint_eq, + $11::text::jsonb::public.eql_v4_real_eq, + $12::text::jsonb::public.eql_v4_double_eq, + $13::text::jsonb::public.eql_v4_text_eq)", + &[ + &row.id, + &v("visits"), + &v("balance"), + &v("active"), + &v("ratio"), + &v("score"), + &v("note"), + &v("name"), + &v("age"), + &v("rank"), + &v("weight"), + &v("price"), + &v("email"), + ], + ) + .unwrap(); + } + + let queries: serde_json::Value = serde_json::from_str( + &std::fs::read_to_string( + std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("fixtures/v4_queries.json"), + ) + .unwrap(), + ) + .unwrap(); + let needle = queries["name"]["plaintext"].as_str().unwrap(); + let ids: Vec = db + .query( + "SELECT id FROM go_profiles WHERE name @@ $1::text::jsonb::eql_v4.query_text_match ORDER BY id", + &[&queries["name"]["query"].as_str().unwrap()], + ) + .unwrap() + .iter() + .map(|r| r.get(0)) + .collect(); + // `@@` folds case, so the expectation does too. It is exact only because + // no committed row's filter covers the needle's bits by chance: a Bloom + // filter may, and a regenerated fixture that turns one up fails here + // against a correct database. + let needle_folded = needle.to_lowercase(); + let expected: Vec = fixture + .rows + .iter() + .filter(|r| r.plaintext.name.to_lowercase().contains(&needle_folded)) + .map(|r| r.id) + .collect(); + assert!(!expected.is_empty()); + assert_eq!(ids, expected, "@@ {needle:?} over Go-sealed names"); + + // `=` on each equality column, against the rows whose plaintext equals + // the query's. + let equal = |column_name: &str, query_domain: &str, holds: &dyn Fn(&go_rows::Plain) -> bool| { + let expected: Vec = fixture + .rows + .iter() + .filter(|r| holds(&r.plaintext)) + .map(|r| r.id) + .collect(); + assert!(!expected.is_empty(), "{column_name}: a row matches"); + (expected, column_name.to_owned(), query_domain.to_owned()) + }; + let plain = |key: &str| queries[key]["plaintext"].clone(); + let checks = [ + equal("age", "query_integer_eq", &|p| { + serde_json::json!(p.age) == plain("age") + }), + equal("rank", "query_bigint_eq", &|p| { + serde_json::json!(p.rank) == plain("rank") + }), + equal("weight", "query_real_eq", &|p| { + f64::from(p.weight) == plain("weight").as_f64().unwrap() + }), + equal("price", "query_double_eq", &|p| { + p.price == plain("price").as_f64().unwrap() + }), + equal("email", "query_text_eq", &|p| { + serde_json::json!(p.email) == plain("email") + }), + ]; + for (expected, column_name, query_domain) in checks { + let ids: Vec = db + .query( + &format!( + "SELECT id FROM go_profiles WHERE {column_name} = $1::text::jsonb::eql_v4.{query_domain} ORDER BY id" + ), + &[&queries[column_name.as_str()]["query"].as_str().unwrap()], + ) + .unwrap() + .iter() + .map(|r| r.get(0)) + .collect(); + assert_eq!(ids, expected, "= over Go-sealed {column_name}"); + } + + // Read back from the domains and open again. + for row in &fixture.rows { + let back = db + .query_one( + "SELECT (to_jsonb(p) - 'id')::text FROM go_profiles p WHERE id = $1", + &[&row.id], + ) + .unwrap(); + let stored: String = back.get(0); + let round_tripped = go_rows::Row { + id: row.id, + plaintext: row.plaintext.clone(), + stored: serde_json::from_str(&stored).unwrap(), + }; + runtime.block_on(go_rows::open_row(&cipher, &round_tripped)); + } +} diff --git a/packages/eql/tests/sqlx/tests/v3_v4_coexistence_tests.rs b/packages/eql/tests/sqlx/tests/v3_v4_coexistence_tests.rs new file mode 100644 index 000000000..3e93e86d0 --- /dev/null +++ b/packages/eql/tests/sqlx/tests/v3_v4_coexistence_tests.rs @@ -0,0 +1,324 @@ +//! EQL v3 and v4 installed side by side in one database (ADR-0002). +//! +//! The two bundles are the same SQL under two names: `eql_v3` for terms written +//! by cipherstash-client, `eql_v4` for terms written by Stack Encrypt. These +//! tests pin what the separate names do and do not enforce when both are +//! installed: +//! +//! - both install without clashing, each owns its own domains, and each +//! version's `lints()` stays clean with the other installed; +//! - a payload of the wrong version fails the domain CHECK on insert; +//! - the function form across versions (`eql_v3.eq(v3col, v4term)`) is +//! ambiguous, so it errors, and so is `OPERATOR(public.=)` between a v3 and +//! a v4 column; +//! - the operator form across versions (`v3col = v4term`) does NOT error. +//! With no operator defined for the exact pair, Postgres treats both domains +//! as `jsonb` and uses the built-in `jsonb = jsonb`, which returns no rows. +//! That is pinned here so it cannot change unnoticed. ADR-0002 defers the +//! cross-version blocker operators that would make it an error; when they +//! land, those assertions flip to expecting one. +//! - `eql_v3.eq_term(v3col) = eql_v4.eq_term(v4col)` does not error either: it +//! compares two text terms. +//! +//! The payloads are real cipherstash-client ciphertexts from the +//! `eql_v3_integer` fixture. A v4 payload is the same row with its envelope +//! version set to 4: the two bundles share their SQL, so only the version +//! decides which domain admits it. + +use anyhow::Result; +use sqlx::PgPool; + +const V4_INSTALLER: &str = "../../release/cipherstash-encrypt-v4.sql"; + +/// SQLSTATE `check_violation`. +const CHECK_VIOLATION: &str = "23514"; +/// SQLSTATE `ambiguous_function`. +const AMBIGUOUS_FUNCTION: &str = "42725"; + +/// Install the v4 bundle into a test database that the migrations have +/// already given v3. +async fn install_v4(pool: &PgPool) -> Result<()> { + let sql = std::fs::read_to_string(V4_INSTALLER).unwrap_or_else(|e| { + panic!( + "failed to read {V4_INSTALLER}: {e} — run `mise run build` \ + (or, in CI, ensure the nextest-archive artifact shipped release/*.sql)" + ) + }); + sqlx::raw_sql(&sql).execute(pool).await?; + Ok(()) +} + +/// One `integer_eq` column per version, each holding the fixture row for 42, +/// written as that version's payload. +async fn tables_with_one_row(pool: &PgPool) -> Result<()> { + sqlx::raw_sql( + "CREATE TABLE t3 (c public.eql_v3_integer_eq); + CREATE TABLE t4 (c public.eql_v4_integer_eq); + INSERT INTO t3 SELECT payload::public.eql_v3_integer_eq + FROM fixtures.eql_v3_integer WHERE plaintext = 42; + INSERT INTO t4 SELECT jsonb_set(payload, '{v}', '4')::public.eql_v4_integer_eq + FROM fixtures.eql_v3_integer WHERE plaintext = 42;", + ) + .execute(pool) + .await?; + Ok(()) +} + +/// The term-only query operand for 42 (no ciphertext `c`), as `version`. +fn query_term(version: u8) -> String { + format!( + "(SELECT jsonb_set(payload - 'c', '{{v}}', '{version}') \ + FROM fixtures.eql_v3_integer WHERE plaintext = 42)::eql_v{version}.query_integer_eq" + ) +} + +/// Which equality `{table}.c = ` binds, read from the +/// catalog rather than from EXPLAIN text, whose deparse can change between +/// Postgres majors. The comparison is stored as a view: a user-defined operator +/// it binds is recorded in `pg_depend`, and a built-in one, which is pinned and +/// so has no dependency row, is the `opno` in the view's stored query tree. +/// Returns the EQL (non-built-in) operators bound, and whether `jsonb = jsonb` +/// is. +async fn bound_equality(pool: &PgPool, table: &str, term: u8) -> Result<(Vec, bool)> { + let term_json: String = + sqlx::query_scalar(&format!("SELECT ({})::jsonb::text", query_term(term))) + .fetch_one(pool) + .await?; + let view = format!("{table}_v{term}_probe"); + sqlx::raw_sql(&format!( + "CREATE OR REPLACE VIEW {view} AS SELECT * FROM {table} \ + WHERE c = '{}'::eql_v{term}.query_integer_eq", + term_json.replace('\'', "''") + )) + .execute(pool) + .await?; + let eql_operators: Vec = sqlx::query_scalar( + "SELECT d.refobjid::regoperator::text + FROM pg_depend d + JOIN pg_rewrite r ON r.oid = d.objid + WHERE d.classid = 'pg_rewrite'::regclass + AND d.refclassid = 'pg_operator'::regclass + AND r.ev_class = $1::regclass + ORDER BY 1", + ) + .bind(&view) + .fetch_all(pool) + .await?; + let jsonb_eq: bool = sqlx::query_scalar( + "SELECT ev_action::text ~ (':opno ' || '=(jsonb,jsonb)'::regoperator::oid || ' ') + FROM pg_rewrite + WHERE ev_class = $1::regclass", + ) + .bind(&view) + .fetch_one(pool) + .await?; + Ok((eql_operators, jsonb_eq)) +} + +fn sqlstate(err: &sqlx::Error) -> Option { + match err { + sqlx::Error::Database(e) => e.code().map(|c| c.into_owned()), + _ => None, + } +} + +#[sqlx::test(fixtures(path = "../fixtures", scripts("eql_v3_integer")))] +async fn v3_and_v4_install_side_by_side(pool: PgPool) -> Result<()> { + install_v4(&pool).await?; + + let schemas: Vec = sqlx::query_scalar( + "SELECT nspname::text FROM pg_namespace WHERE nspname LIKE 'eql\\_v_%' ORDER BY 1", + ) + .fetch_all(&pool) + .await?; + assert_eq!( + schemas, + ["eql_v3", "eql_v3_internal", "eql_v4", "eql_v4_internal"] + ); + + let (v3, v4): (i64, i64) = sqlx::query_as( + "SELECT count(*) FILTER (WHERE typname LIKE 'eql\\_v3\\_%'), + count(*) FILTER (WHERE typname LIKE 'eql\\_v4\\_%') + FROM pg_type WHERE typnamespace = 'public'::regnamespace AND typtype = 'd'", + ) + .fetch_one(&pool) + .await?; + assert!(v3 > 0, "v3 installed no public domains"); + assert_eq!(v3, v4, "each version owns the same set of public domains"); + + let (a, b): (String, String) = sqlx::query_as("SELECT eql_v3.version(), eql_v4.version()") + .fetch_one(&pool) + .await?; + assert_eq!(a, b, "both bundles come from one build"); + + // Each lint judges only its own version's public domains. Before that was + // scoped, each version reported thousands of errors about the other's + // blocker operators. + for schema in ["eql_v3", "eql_v4"] { + let errors: Vec = sqlx::query_scalar(&format!( + "SELECT category || ': ' || object_name FROM {schema}.lints() \ + WHERE severity = 'error' ORDER BY 1 LIMIT 5" + )) + .fetch_all(&pool) + .await?; + assert!( + errors.is_empty(), + "{schema}.lints() reports errors with both versions installed: {errors:#?}" + ); + } + Ok(()) +} + +#[sqlx::test(fixtures(path = "../fixtures", scripts("eql_v3_integer")))] +async fn each_version_matches_its_own_terms(pool: PgPool) -> Result<()> { + install_v4(&pool).await?; + tables_with_one_row(&pool).await?; + + for (table, version) in [("t3", 3), ("t4", 4)] { + let n: i64 = sqlx::query_scalar(&format!( + "SELECT count(*) FROM {table} WHERE c = {}", + query_term(version) + )) + .fetch_one(&pool) + .await?; + assert_eq!(n, 1, "{table} = its own version's term must match"); + } + Ok(()) +} + +#[sqlx::test(fixtures(path = "../fixtures", scripts("eql_v3_integer")))] +async fn wrong_version_insert_fails_the_domain_check(pool: PgPool) -> Result<()> { + install_v4(&pool).await?; + + for (domain, version) in [ + ("public.eql_v3_integer_eq", 4), + ("public.eql_v4_integer_eq", 3), + ] { + let err = sqlx::query(&format!( + "SELECT jsonb_set(payload, '{{v}}', '{version}')::{domain} \ + FROM fixtures.eql_v3_integer WHERE plaintext = 42" + )) + .execute(&pool) + .await + .expect_err("a payload of the other version must not fit the domain"); + assert_eq!( + sqlstate(&err).as_deref(), + Some(CHECK_VIOLATION), + "a version-{version} payload cast to {domain}: {err}" + ); + } + Ok(()) +} + +#[sqlx::test(fixtures(path = "../fixtures", scripts("eql_v3_integer")))] +async fn function_form_across_versions_is_ambiguous(pool: PgPool) -> Result<()> { + install_v4(&pool).await?; + tables_with_one_row(&pool).await?; + + for (table, function, term) in [("t3", "eql_v3.eq", 4), ("t4", "eql_v4.eq", 3)] { + let err = sqlx::query(&format!( + "SELECT count(*) FROM {table} WHERE {function}(c, {})", + query_term(term) + )) + .execute(&pool) + .await + .expect_err("a cross-version function call must not resolve"); + assert_eq!( + sqlstate(&err).as_deref(), + Some(AMBIGUOUS_FUNCTION), + "{function}({table}.c, v{term} term): {err}" + ); + } + Ok(()) +} + +/// Pins a known gap: see the module docs. When cross-version blocker operators +/// exist, these comparisons raise instead, and this test changes with them. +#[sqlx::test(fixtures(path = "../fixtures", scripts("eql_v3_integer")))] +async fn operator_across_versions_returns_no_rows(pool: PgPool) -> Result<()> { + install_v4(&pool).await?; + tables_with_one_row(&pool).await?; + + for (table, term) in [("t3", 4), ("t4", 3)] { + let n: i64 = sqlx::query_scalar(&format!( + "SELECT count(*) FROM {table} WHERE c = {}", + query_term(term) + )) + .fetch_one(&pool) + .await?; + assert_eq!(n, 0, "{table}.c = v{term} term runs, and finds nothing"); + + // Why: no EQL operator takes this pair, so the parser bound the + // built-in jsonb equality on the two domains' base type. + let (eql_operators, jsonb_eq) = bound_equality(&pool, table, term).await?; + assert!( + eql_operators.is_empty(), + "{table}.c = v{term} term should bind no EQL operator, got {eql_operators:?}" + ); + assert!( + jsonb_eq, + "{table}.c = v{term} term should fall back to jsonb = jsonb" + ); + } + + // Control: the same-version comparison binds the EQL operator, so the + // empty list above is a finding, not a probe that sees nothing. + for (table, version) in [("t3", 3), ("t4", 4)] { + let (eql_operators, jsonb_eq) = bound_equality(&pool, table, version).await?; + assert_eq!( + eql_operators, + [format!( + "=(eql_v{version}_integer_eq,eql_v{version}.query_integer_eq)" + )], + "{table}.c = v{version} term" + ); + assert!( + !jsonb_eq, + "{table}.c = v{version} term does not use jsonb = jsonb" + ); + } + + let joined: i64 = sqlx::query_scalar("SELECT count(*) FROM t3 JOIN t4 ON t3.c = t4.c") + .fetch_one(&pool) + .await?; + assert_eq!(joined, 0, "a v3 column joined to a v4 column finds nothing"); + Ok(()) +} + +#[sqlx::test(fixtures(path = "../fixtures", scripts("eql_v3_integer")))] +async fn qualified_operator_across_versions_is_ambiguous(pool: PgPool) -> Result<()> { + install_v4(&pool).await?; + tables_with_one_row(&pool).await?; + + let err = sqlx::query("SELECT count(*) FROM t3 JOIN t4 ON t3.c OPERATOR(public.=) t4.c") + .execute(&pool) + .await + .expect_err("OPERATOR(public.=) between a v3 and a v4 column must not resolve"); + assert_eq!( + sqlstate(&err).as_deref(), + Some(AMBIGUOUS_FUNCTION), + "t3.c OPERATOR(public.=) t4.c: {err}" + ); + Ok(()) +} + +/// Pins a second silent path: see the module docs. The terms are text, so +/// comparing them across versions is ordinary text equality. The fixture's v4 +/// row reuses the v3 row's terms, so here it even matches; with real Stack +/// Encrypt terms it finds nothing. Either way nothing refuses it. +#[sqlx::test(fixtures(path = "../fixtures", scripts("eql_v3_integer")))] +async fn eq_term_across_versions_compares_text(pool: PgPool) -> Result<()> { + install_v4(&pool).await?; + tables_with_one_row(&pool).await?; + + let n: i64 = sqlx::query_scalar( + "SELECT count(*) FROM t3 JOIN t4 ON eql_v3.eq_term(t3.c) = eql_v4.eq_term(t4.c)", + ) + .fetch_one(&pool) + .await?; + assert_eq!( + n, 1, + "the cross-version term comparison runs as text equality" + ); + Ok(()) +} diff --git a/packages/stack-auth/fuzz/Cargo.lock b/packages/stack-auth/fuzz/Cargo.lock index f9a7dd7df..fbe6e602e 100644 --- a/packages/stack-auth/fuzz/Cargo.lock +++ b/packages/stack-auth/fuzz/Cargo.lock @@ -353,9 +353,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chacha20" -version = "0.10.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" +checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" dependencies = [ "cfg-if", "cpufeatures 0.3.0", diff --git a/packages/stack-encrypt-derive/Cargo.toml b/packages/stack-encrypt-derive/Cargo.toml index 223cd01bc..0e90b04d0 100644 --- a/packages/stack-encrypt-derive/Cargo.toml +++ b/packages/stack-encrypt-derive/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "stack-encrypt-derive" description = "Derive macros for stack-encrypt's target-directed encryption" -version = "0.2.0" +version = "0.3.0" edition.workspace = true authors.workspace = true repository.workspace = true diff --git a/packages/stack-encrypt-derive/src/lib.rs b/packages/stack-encrypt-derive/src/lib.rs index 99018bf47..7861385d4 100644 --- a/packages/stack-encrypt-derive/src/lib.rs +++ b/packages/stack-encrypt-derive/src/lib.rs @@ -108,8 +108,8 @@ //! use stack_encrypt::target::transcode::{Transcode, Visitor}; //! use stack_encrypt::target::{self, CallerContext}; //! use stack_encrypt::{ -//! CipherText, Decryptable, Encrypt, EncryptFrom, Encryption, Error, SealedValue, StackCipher, -//! nonempty, +//! CipherText, Decryptable, EncryptFrom, Encryption, Error, Encrypt, SealedValue, +//! StackCipher, nonempty, //! }; //! use stack_encrypt::kms::FakeDataKeySource; //! diff --git a/packages/stack-encrypt/CHANGELOG.md b/packages/stack-encrypt/CHANGELOG.md index e3396812a..9040b6e70 100644 --- a/packages/stack-encrypt/CHANGELOG.md +++ b/packages/stack-encrypt/CHANGELOG.md @@ -9,6 +9,138 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- **Every integer width, 128-bit integers, dates, timestamps and decimals + as dynamic values** (`dynamic` feature; #1144, ADR-0002). They are + vitaminc leaves in a `ValueFrame`, with no new `FfiValue` variant: + `ValueKind` gains `Int8`, `Int16`, `Int128`, `UInt8`, `UInt16`, + `UInt128`, `Decimal`, `Date` and `Timestamp` (named `int8`, `int16`, + `int128`, `uint8`, `uint16`, `uint128`, `decimal`, `date`, `timestamp` + in a plan's `type`), and the value model keeps each integer at its own + width (8- and 16-bit integers are no longer widened to 32 bits). A + timestamp is held at nanosecond precision. Equality applies to all of + them, through vitaminc-normalize: one term per integer value at every + width, decimals at any scale, timestamps to the microsecond. ORE and OPE + apply to every integer width, each passed to cllw-ore as its own type. + An ORE or OPE index on a decimal, date or timestamp is refused with the + new `Reason::OrderTermPending`, which names #1236: those order terms wait + for new cllw-ore and ore-rs releases. `dynamic::not_admitted` says why a + kind does not admit an index. `dynamic::read` converts between the new + kinds where a value fits (an integer into any width that holds it, a + whole integer into a decimal at scale 0). `tests/value_kinds.rs` and its + fixture hold the record path, the data query path and the typed path to + the same bytes, and the Go SDK reads the fixture too. +- **A binding queries by operator** (`dynamic` feature; ADR-0009, ADR-0007 + amended 2026-10-16). `dynamic::query_term(keyset, &plan, field, op, + input, &resolver)` derives the query term for a field of a data plan, an + operator (`dynamic::OpSpec`, named `eq`, `lt`, `lte`, `gt`, `gte`, + `between` or `matches`) and its input, reading the input as the field's + declared type first. The index that answers is the typed path's default + (`OpSpec::answered_by`), and the term is the bytes the typed query chain + derives for the same query. A field that names an EQL type answers through + the type's query twin. An operator the field does not answer is refused + as a mistyped value is, `dynamic::Error::Source` naming the field with + `Reason::OperatorNotAnswered`; `check_query` refuses the same without a + cipher. `dynamic::verify` checks a page of decrypted values against a + probabilistic query and `dynamic::target_limit` sizes its fetch from the + term's bytes and `Stats` (`Stats::from_frame` reads their wire form), by + the code the typed `MatchQuery` runs, with the field's own match options; + neither uses a key. The catalog entry of an EQL type + (a serialized `TargetDescriptor`) lists the operators the engine answers for + it, each with its fidelity (`dynamic::Fidelity`), arity and index + (`TargetDescriptor::operators`). +- **An EQL type with a match index answers `matches` through its twin.** + `TargetDescriptor::with_match_options` gives the engine the options a + type's match index is built under (`TargetDescriptor::match_options`, not + on the wire), and such a type answers `matches` (probabilistic) as well as + its exact operators: `query_term` derives the type's query twin, and + `verify` and `target_limit` run under the type's options, the latter + reading the twin's `bf`. A type with a match index and no options still + answers no probabilistic operator. The Go guest gives `TextMatch` EQL's + match options, so it answers `matches` through `TextMatchQuery`. +- **A binding asks which operators a field answers.** + `dynamic::field_operators(&plan, field, &resolver)` lists the operators a + field of a data plan answers, each with the index that answers it: what + `query_term` derives a term for on that field and nothing else, for a + field declared with indexes as for one that names an EQL type. + `dynamic::OperatorEntry` is one entry in the catalog's wire form. + A generator asks this before the program runs, so it writes one query + method per operator and holds no copy of the table. +- **A query names an operator, not an index.** + `cipher.query(op::Eq, "bob@example.com").on(&plan)` and + `cipher.query(op::Matches, "ali").on(&plan)`: the operator comes first, as + a value, and the plan named by `on` finds the index that answers it + (ADR-0009). An index declares the operators it answers (`op::Supports`), a + target type names the index that answers each one for it (`op::Answers`), + and a plan that declares indexes uses the operator's default index + (`op::DefaultIndex`); both name the index by its type, whose `Default` is + the index. `.via(index)` before `.on(&plan)` names another index the plan + declares, such as a match index with its own configuration. + `op::Matches` is the case-insensitive operator, as a value; + `op::Matches.case_sensitive()` is the other, and the case types are + `op::CaseInsensitive` and `op::CaseSensitive`. What the plan's type shows + is checked at compile time: a match query on an integer, an operator a + target does not answer, and on a one-value plan an index it does not hold + or a case-sensitive `Matches` against a case-folding index. On a field of + a fields plan those are refused when the query is awaited, before any key + is requested, as is a match configuration whose `op::MatchCase` disagrees + with its options (`PlanError::MatchCase`). +- **A match query has its own type, `sem::MatchQuery`.** It is the filter over + the query's value; test a stored filter against it with + `MatchTerms::matches(&query)`. It comes only from a query chain: + `op::Supports::query` takes an `op::QueryToken` that only this crate can + make. +- **`Match` is a value.** `.with((Equality, Match))` declares the match index + under the default configuration, as `Equality` declares equality; + `Match::::new()` is another configuration. +- **`verify` drops a match query's false positives after decrypt.** A + `MatchQuery` is `op::Probabilistic`: `query.verify(&value)` is `true` when + every token of the query's value, cut by the index's own tokenizer and + case folding, is a token of the decrypted value. Filter decrypted rows + with it. The query keeps its value's tokens to do this; they are zeroized + on drop and never shown by `Debug`, and the tokenizer now zeroizes its own + copies of the text. An exact term has no `verify`, and none of this + crate's indexes can answer `op::Matches` but with a probabilistic term + (`op::TermFor`). +- **The ordering operators, and `Between` as one term.** `op::Lt`, `Lte`, + `Gt` and `Gte` take one value and `op::Between` a pair of bounds, + `cipher.query(op::Between, &(18, 65)).on(&age_plan)`, inclusive at both + ends. They are answered over the integer types, the floats and text + (`op::Ordered`) by the `Ore` index by default and by `Ope` through + `.via(Ope)`; an ordering on bytes does not compile. A comparison's query term is the index's own term + for the value (`OreTerm`, `OpeTerm`); a range's is one `sem::RangeQuery` + carrying both bounds' terms, read with `lo()` and `hi()`, so no statement + can pair the low bound of one query with the high bound of another. A + range whose low bound is above its high bound is not refused: as SQL's + `BETWEEN`, it matches nothing. + What a query takes is the operator's `op::Arity` (`op::One` or + `op::Pair`), and `op::Input` relates the value given to the plaintext the + plan is checked against (ADR-0009, decision 7). +- **The JSON operators are declared.** `op::Contains` and `op::ContainedBy` + (`@>` and `<@`) and the accessor `op::AtPath`, `op::AtPath(op::Eq)`, + which applies another operator at a JSON path and inherits its fidelity + (`op::TermFor`): `AtPath` and `AtPath` are exact. No index + answers them yet, since this crate has no JSON index, so a query with + them does not compile until one exists. `AtPath` takes a leaf + operator (`op::Leaf`: `Eq`, `Lt`, `Lte`, `Gt`, `Gte`, `Between`, + `Matches`), so `AtPath` and a nested `AtPath>` do not + compile, and its arity, `op::Pathed`, carries the leaf's (`Pathed` + for `AtPath`, `Pathed` for `AtPath`); it has no + `op::Input` until the JSON index exists (ADR-0009, decision 1). +- **`target_limit` says how many rows a match query should fetch.** + `query.target_limit(want, &stats)` is `want` plus the false positives + expected at the confidence `stats` names (99% by default), as an + `op::Limit`. `op::Stats::declared(rows)` uses the new + `MatchConfig::expected_tokens()` prior; `op::Stats::measured(rows, + histogram)` uses a histogram of the stored filters' set-bit counts. With + neither, the limit is `Limit::Unbounded`, and the caller pages with a + cursor. A `want` of 0 is `Limit::Rows(0)`. A limit, and `fetch_or`'s + page, never exceeds `op::MAX_ROWS` (`i64::MAX`), the largest SQL `LIMIT`. + `rows` counts the non-NULL rows; a table never analysed has an unknown + count, not 0, and gets no `Stats` (the docs give the catalog read). The + bound assumes a non-matching row shares no token with + the query, so on natural text its confidence is nominal; `verify` still + decides every row. + - **Errors now expose stable codes, help text, and structured details.** All error types implement `miette::Diagnostic` with codes such as `stack_encrypt::foreign_keyset`. Help text explains how to resolve @@ -28,8 +160,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 output form, `dynamic::record::plan_with` reads `{"context": [...], "target": "TextEq", "type"?: ...}` — the two forms are exclusive — and resolves the name through a `dynamic::TargetResolver` the host installs: - the EQL types a build holds (`targets()`, serializable as - `TargetDescriptor::to_value()` for a guest's `se_targets` export) and how + the EQL types a build holds (`targets()`, each a `Serialize` + `TargetDescriptor` for a guest's `se_targets` export) and how to run one. `encrypt_with` zips the type's own `Pending` into the record's, so a record with target fields is still one ZeroKMS request, and stores the EQL value's JSON bytes under the field's `"eql"` key @@ -47,6 +179,323 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Breaking +- **A ciphertext that opens as the wrong type is `Error::OpenedType`, not + `Error::Aead`** (#1118). A typed decrypt of a leaf that authenticates but + holds another type (an integer opened as `String`, a value too wide for + the target) was reported as `Aead`, the error for a wrong key or a + tampered ciphertext, and the Go guest reported it as `STATUS_AUTH`. The new + variant names only the type the target reads (`expected`). The Go guest + maps it to `STATUS_ENCODING`, as it does a typed record field that opens to + another kind. A wrong key, a wrong context and a tampered ciphertext are + still `Aead`. A container whose shape the target refuses (a map missing a + field) is `OpenedType` too: a container's membership and order are not + authenticated, by design, since stored values map to rows and columns a + database returns in any order and a query selects in part. +- **An 8- or 16-bit integer in a dynamic value keeps its width** (`dynamic` + feature; #1144). The value model used to widen it to 32 bits before it + was sealed; now it is sealed as itself, so a field declared `int16` seals + an int16 leaf. A record sealed before under a 32-bit `type` does not open + under a plan that declares the narrower kind (`Plan(FieldType)`): the + typed decrypt checks the leaf's kind against the plan's. The seal side + breaks the same way: a host that sends an 8- or 16-bit leaf for a field + whose plan declares a 32-bit `type` is refused (`Reason::FieldType`, naming + the field), where the leaf used to be widened. Send the declared width, or + declare the narrower kind. The Go SDK converts to the declared width itself, + so Go code generated before this change still seals. + +- **A dynamic plaintext is a frame, not a value tree** (`dynamic` feature; + #1232, vitaminc ADR 0001). vitaminc 0.6 has no shared value type: a value + describes itself once, and sinks consume it. `dynamic::ValueFrame` is now + the engine's plaintext for a value whose type is known only at run time: + one value as its transport frame, in the engine's value model (an 8- or + 16-bit integer read as the 32-bit integer of its sign, as before; a + 128-bit integer or a date refused, as before), in a `Protected` buffer + wiped when it drops. It walks its own bytes into any sink (`Encrypt`) and + is a decrypt target that writes what it opens straight into a frame + (`Decrypt`). The plaintext paths walk frames: + - `record::encrypt`, `encrypt_with` and `check_source` take the source as + any `Encrypt` (a `ValueFrame`, a `vitaminc_aead::Frame`, or a Rust value + a test spells), walk it once and write each field's value into a + `ValueFrame` of its own, which is all the engine keeps of it. A value + refused while the source is split names its field, with the reasons it + had (`RepeatedKey`, `Unframeable`, `FieldType`; a value the value model + does not hold is `FieldType` inside a passthrough subtree too). + - Two refusals changed. The split is one walk of the source that stops + at its first fault, so of several faults in one row, those the split + finds (a repeated key, a value outside the model) are reported in + source order rather than plan order: the walk does not copy the rest of + a source it has already refused. And a passthrough value in a field + that seals a ciphertext and derives a term is now `Source { reason: + Passthrough }` whatever order the field lists its outputs in. It was + `Term` when a term output came before `c` in the plan and `Source` + otherwise, so the answer depended on how the outputs were spelled. + - `record::decrypt` and `decrypt_with` resolve to one `ValueFrame` (the + record, or the batch) instead of an `FfiValue`: each field opens into a + frame, which is walked into its entry of the record's frame and wiped. + - `read`, `query_term`, `check_query` and `verify` take their input as any + `Encrypt`, and `read` returns a `ValueFrame`; `verify` takes the page of + values as any iterator of sources (`ValueFrame::elements` splits a list + a binding handed over). + - `ValueFrame::check` checks frame bytes as `ValueFrame::from_bytes` does + and hands them back as a `Frame` to walk in place, with no copy: the Go + guest encrypts and checks a record source, and reads a query's input, + that way, so the only copies of a source's plaintext are the per-field + frames the split writes. + - `IndexSpec` is an `Index` of `ValueFrame` (it was of `FfiValue`), so a + Rust chain over dynamic fields names `ValueFrame` fields. + - `TargetResolver::encrypt` and `query` take a `ValueFrame`, and + `decrypt` resolves to one. + + `FfiValue` is gone (see the entry after next). + Ciphertexts, terms and the cross-language fixtures are byte for byte what + they were. The Go guest decodes plaintext as `ValueFrame`s and returns an + opened record's frame as it is. Copies of an opened string that remain in + the guest's memory after a decrypt were traced to the plaintext output of + AES-256-GCM's keystream XOR, left in the unwiped stack temporaries of the + RustCrypto crates behind vitaminc-encrypt's wasm32 backend (their number varies + with the leaf's length), not to this crate, and + `TestPlaintextDoesNotRemainInGuestMemoryAfterDecrypt` stays skipped with + that reason (cipherstash/vitaminc#370). The heap is guarded separately: + `tests/heap_hygiene.rs` runs the record encrypt (from a `ValueFrame` and + from a raw frame), the record decrypt (with a nested field), `query_term` + and `verify` under an allocator that fails the test on any freed block + still holding plaintext. +- **Order terms encrypt through cllw-ore's vitaminc schemes, and text is + ordered.** An ORE or OPE term is now cllw-ore 0.5.2-rc.1's + `vitaminc::Ore`/`vitaminc::Ope` encryption of the value's `vitaminc-ore` + order encoding: the engine passes the value through and names its type's + target (`sem::Orderable`: integers at their own width, `f32`/`f64` as + `F64`, text as `Text`, bytes as `Bytes`), and cllw-ore does the encoding. + Text is ordered by the system ADR-0002's fold (Unicode 16 NFC with case + and accents folded), so `Café`, `cafe`, `CAFÉ` and `cafe` with a + combining accent are one term and tie, `alice` orders before `Zoe`, and + `é` orders with `e`, not after `z`. Every order term changes bytes: the + key labels move to `/v2`, the column salt binds the scheme and the + target, and text and bytes go in behind cllw-ore's marker byte. An order + term written by 0.1.0 or 0.2.0 (or by the Go module's v0.1.0-alpha.1) + does not compare with one this release derives, and nothing refuses it: + a `<`, `BETWEEN` or `ORDER BY` over a column holding the old terms + silently misses or misplaces rows. Re-derive a column's ORE and OPE terms + (encrypt its rows again) before querying it with this release. Every source type's term is one ciphertext type, + `OreCllw8VariableV1` or `OpeCllw8VariableV1`; `OreTerm` and + `OpeTerm` keep `T` to name the source, and `new`, `inner` and + `into_inner`, `KeysetCipher::ore_term` and `ope_term` take or return those + types. `sem::CllwOreEncrypt` and `sem::CllwOpeEncrypt` are no longer + re-exported, and the term bounds are `sem::Orderable`: a sealed trait + with one item, `const TARGET: OrderTarget`, the `vitaminc-ore` target a + type's values are encoded as. The value goes to the scheme as the + `vitaminc-aead` `Encrypt` source it is, by reference, and the engine + holds the one copy in a `Zeroizing` and wipes it; so an order term's + source is an owned `String` or `Vec`, and `&'static str`, + `&'static [u8]`, `Zeroizing` and `Zeroizing>` are no + longer sources. Text holding a code point Unicode 16 does not assign has + no order term (`TermError::Normalize`), on write and on query. The + ordering operators are answered on text, on the typed path + (`op::Ordered` for `String`) and on the data-plan path, so a binding + generates them too. +- **A `u8` and an `i8` have no order term, as a `bool` has none.** An order + term over 256 values ranks every row among 256, which a few known rows + resolve to the values, the leak the crate already refuses for a boolean's + two. `u8` and `i8` leave `op::Ordered` and `sem::Orderable`, so + `OreTerm`, `OpeTerm` and an `Ore` or `Ope` index on either do not + compile; `dynamic::admits` refuses ORE and OPE on `int8` and `uint8` + (`Reason::IndexNotAdmitted`, as for a boolean), and a data plan naming + one is refused when it is built. Both keep their equality term. The + refusal is a compile error now, so `TermError::NoOrderTerm` (code + `stack_encrypt::no_order_term`), which `bool` raised at run time, is + gone. The `value_kinds.json` fixture's `i8` and `u8` fields carry + equality alone, and the frozen `stored_rows_v1.json` loses its four + 8-bit order terms under the order-term exception; every other stored + byte is as it was. +- **Floats are ordered.** An `f32` or `f64` is encoded at the `F64` + target, whose encoding folds `-0.0` into `0.0` and every NaN into one + value above `+Infinity`: Postgres's `float8` order. So the ordering + operators are answered over `f32` and `f64` (`op::Ordered`) and over a + data plan's `float32` and `float64` fields, which they were not. An `f32` + is ordered as the `f64` it widens to: vitaminc widens it exactly, so an + `f32` and its `f64` are one term. Float order terms change bytes with + every other order term (above). + +- **A binding's control data is read from its frame with serde, not + decoded into an `FfiValue`** (`dynamic` feature). Each message is a typed + value read straight from the frame bytes by `vitaminc_aead_frame::serde`, + so no tree is built and every message refuses an unknown key, a repeated + key or a wrong type the same way: + - `dynamic::context` takes the context's frame bytes. An integer is read + at the width the frame carries, and only `i32`, `i64`, `u32` and `u64` + are contexts: an 8- or 16-bit integer, which was widened to 32 bits + before, and a 128-bit one are `Reason::ContextKind`, as are bytes that + are not one frame. + - `record::plan` and `record::plan_with` take the plan's frame bytes. + `IndexSpec::from_frame` replaces `IndexSpec::from_value`, and + `Output::from_value` is gone. Each `Reason` a plan was refused with is + unchanged, with two exceptions: a key, a field or a match option given + twice is refused by the frame before the plan is read, as + `Reason::NotAnObject` naming no field (it was `RepeatedKey` or + `DuplicateField`), and so are bytes that are not one frame. An index's + payload may be missing or null alike: `{"match": null}` is a bare + `"match"`, and `{"eq": null}` a bare `"eq"`. + - `Stats::from_frame` replaces `Stats::from_value`. + - The engine's answers are `Serialize`, written to a frame by serde, + byte for byte what the `FfiValue` encoders wrote (pinned in the tests): + `QueryTerm`, `TargetDescriptor` and `IndexSpec` replace their + `to_value`, `OperatorEntry::new` replaces `operator_to_value`, and + `Limit::rows` replaces `limit_to_value` (`None` writes null). + +- **`dynamic::FfiValue` is removed** (`dynamic` feature, #1252). Nothing + takes a value tree any more: a plaintext is a `ValueFrame`, and control + data is read from its frame by serde (above). Gone with it are + `Utf8String`, the tree's sink types (`ValueSink`, `ValueSeq`, `ValueMap`, + `Put`, `Root`, `Element`, `Entry`), `ValueKind::holds` and + `FfiValue::kind`. `ValueKind` and `ParseValueKindError` are unchanged and + still exported from `dynamic`, as is `FromFrameError`, now the error of + `ValueFrame::from_bytes` and `ValueFrame::check` alone. A value a test or + a caller spelled as an `FfiValue` is a Rust value instead + (`ValueFrame::of(34u32)`, `ValueFrame::of(&map)`), or the frame bytes a + binding sends. Stored records, terms and the frozen fixtures are byte for + byte what they were. + +- **A match value with no tokens is stored as the empty filter, so + `KeysetCipher::match_terms` is no longer a query.** In 0.2.0 the same call + served write time and query time, and refused text that cuts no token + under the match index's tokenizer (empty or separator-only text, or text + shorter than the n-gram length) with `TermError::EmptyTermText`. Now it + derives the stored filter only, and returns the empty filter (`bf: []`) + for such text with no error. **Do not send the output of `match_terms` as + a query:** EQL treats an empty filter as contained by every stored filter, + and its query domains do not refuse one, so that query returns every row + with no error anywhere. A query comes from `cipher.query(op::Matches, ..)`, + which still refuses such text with `TermError::EmptyTermText`, when the + query is awaited, before a term exists and before any keyset is loaded + (`op::Supports::check` now takes the query's value); `dynamic::term` + refuses it for a match kind the same way. The stored side is the change a + caller sees: one two-letter name no longer fails a whole row, the value + seals and opens as any other, and the `dynamic` record path stores it the + same way. Storing the empty filter tells a reader of the database that the + value is empty, separator-only or shorter than the n-gram length + (ADR-0009). +- **stack-encrypt requires the vitaminc 0.6 crates.** They are the first + release of vitaminc ADR 0001, which the entries below build on. A crate + that names a vitaminc type stack-encrypt takes or returns (`Encrypt`, + `Decrypt`, `Protected`) moves to 0.6 with it. +- **Equality terms derive through `vitaminc-normalize`, so `TextEq` compares + text in Unicode 16 NFC.** An equality term is the PRF over the value's + normalized bytes under vitaminc's domain for its kind: `café` written with + a precomposed `é` and with `e` and a combining accent is one term, every + integer width of one number is one term (`34u32` and `34i64` match), both + float widths of one number are one term, and a date, timestamp, decimal + or uuid derives in a domain of its own. `KeysetCipher::equality_term`, + `target::equality`, the `Equality` index and `op::Eq` take an `Encrypt` + that is one scalar where they took a `PrfValue`. A boolean, a null or a + container has no equality term (`TermError::NoEqualityTerm`); a `bool` + satisfies the new bound, so equality on one now fails when the term is + derived where it used to fail to compile. Text holding a code point + unassigned in Unicode 16 (an emoji newer than it, say) is refused + (`TermError::Normalize`), when it is written to an equality or match + column as well as when it is queried: the whole record's encrypt fails. + Match text is tokenized in the same normal form, and refused the same + way. Every equality and match term changes + bytes (the domains move to `/v2`); ORE and OPE terms do not. No stored + term existed to keep; the record fixture is regenerated. Text order + terms are encoded in the same normal form, folded further (see "Order + terms encrypt through cllw-ore's vitaminc schemes" above), so equality + and ordering agree on two forms of `café`. +- **`dynamic::Value` and `dynamic::Scalar` are gone.** A field lowered from + data holds an `FfiValue`, which is now `Clone` (a deep copy into fresh + `Protected` payloads, as `Value`'s was) and reads as a context label. + `dynamic::term` takes any `Encrypt` (an `&FfiValue`, a transport frame + walked in place, a Rust value) and derives at the one scalar it holds; + `IndexSpec::defines(value)` replaces `IndexSpec::supports(&scalar)`, and + `IndexSpec` is an `Index`. +- **A boolean has no order term**, on the typed path and through a plan or + `dynamic::term`: with two values, an ORE or OPE term would tell anyone + holding the column which rows are `true`. An ORE or OPE term of a `bool` + (`KeysetCipher::ore_term`, the `Ore` and `Ope` indexes) is refused with + the new `TermError::NoOrderTerm`, before any key is minted, where cllw-ore + used to order one. `dynamic::admits` now refuses ORE and OPE on `bool`, and + admits equality on `float32` and `float64`, which vitaminc gives an + equality domain. A 128-bit integer has an equality term and no order + term. + +- **Values describe themselves with vitaminc's new `Encrypt` and read back + with `Decrypt` (vitaminc ADR 0001).** `KeysetCipher::encrypt`, + `StackCipher::decrypt` and every target take the new `Encrypt`, a source + that describes its value to a sink, where they took the old + visitor-driven `Encrypt`, and `Decrypt` where they took + `Decrypt<'static>`; derive both with `vitaminc_aead::{Encrypt, Decrypt}` + (`stack_encrypt::{Encrypt, Decrypt}` re-exports them). The name is the + same and the trait is not: a hand-written impl of the old one does not + compile against the new one. `Decipher`, `Element` and `Cipher` are no + longer re-exported, and `StackDecipher` and `BoxedPassthrough` are gone. + A pending tree is planned rather than driven: + `PendingStackCipherText::plan(value, aad)`, then `seal` or + `into_pending` as before. The key fetch is unchanged: one batched + `generate_keys` per assembly to seal, one `retrieve_keys` per keyset to + open. +- **Every leaf records its type, so a Rust field and a data-plan field + share leaves.** A Rust `u32` and a data plan's `uint32` field seal the + same leaf under the same context, and each opens the other's; a reader of + another kind (text for an integer, an integer for bytes) is refused rather + than handed changed plaintext, as a bare `String` reader used to read a + binding's leaf as `"\nalice"` (#1118). An integer reader accepts an integer + leaf of any width whose value fits, and an `f64` reader an `f32` leaf, + which change no value. + Leaves are vitaminc's wire version 2, so a ciphertext sealed by an + earlier build does not open. +- **An absent value is a sealed null leaf**, a `Single` like any other + value: the absent marker (`CipherText::None`) and + `transcode::Visitor::absent` are gone. +- **A passthrough travels as its frame.** `StackCipherText` is vitaminc's + `Node`: a passthrough subtree is a `PassthroughFrame`, the + transport frame of its value, in place of a boxed value, and + `transcode::Visitor::passthrough` takes one. + A dynamic passthrough value the frame cannot carry is refused when the + source is read, before any key is requested, as `Error::Source` naming + the field: a repeated key as `Reason::RepeatedKey`, and a value nested + deeper, or holding text, bytes or a key longer, than a frame carries as + the new `Reason::Unframeable` (`"unframeable"`). +- **`dynamic::FfiValue` and `dynamic::ValueKind` are this crate's own**, + with the same variants and kind names, since vitaminc no longer has a + value tree. A value crosses a binding's boundary as a transport frame + (`FfiValue::to_frame`, `FfiValue::from_frame`), and is read through its + `Decrypt` sink: an 8- or 16-bit integer in a frame reads as the 32-bit + variant of its sign, and a scalar no variant holds is refused. + +- **`StackCipher::query_index` is gone**, with `QueryIndexBuilder` and + `QueryIndex`. Every query names an operator now that the orderings have + arrived: + - `query_index(Ore, &v)` over an integer is `query(op::Lt, &v)` (or any + ordering; the term is the same `OreTerm`). + - `query_index(Match, text)` is `query(op::Matches, text)`, which is not + the same call. It returns a `MatchQuery`, not the stored `MatchTerms`; + it refuses text that cuts no token (`TermError::EmptyTermText`); and it + compiles only for a configuration that implements `op::MatchCase`. A + configuration without one needs that one-line impl to be queried. + - `query_index(Ore, text)` and `query_index(Ope, text)` are + `query(op::Lt, text)` and `query(op::Lt, text).via(Ope)` (or any + ordering), whose term is the text's folded order term (see "Order terms + encrypt through cllw-ore's vitaminc schemes" above). +- **`op::Supports`, `op::Answers` and `op::DefaultIndex` are keyed by the + query's input**, `Supports` with `In: Input`, in + place of the plaintext; for every operator but `Between` the input is + the plaintext, so `Supports` reads as before. `Supports::check` + takes the input and returns `Error`, and `Supports::query` takes the + input's terms (`In::Terms`: one term, or a pair for a + range). `plan::Resolves::resolve` takes the index and the call's context + and returns the index and the label. +- **The query chain starts with the operator.** `cipher.query(op, v)` + replaces `cipher.query(v)`: `cipher.query(op::Eq, v).on(&plan)` replaces + `cipher.query(v).using(&plan).equality()`, and `on` replaces `using` for + queries only (a write still runs `using` a plan). An index's own term, for + an index no operator answers yet (`Ore`, `Ope`), is + `cipher.query_index(Ore, v).on(&plan)`, which goes when the ordering + operators arrive. `QueryUsing` is gone; the chain's types are `QueryBuilder`, `QueryVia`, + `QueryIndexBuilder`, `QueryIndex` and `QueryOp`, and the plan shapes + implement `plan::Chooses` and `plan::Resolves`. +- **`Match::default()` is `Match`.** The match index under the default + configuration is the value `Match`, and `Default` is now implemented for + every `Match`, so `Match::default()` no longer infers the configuration. + - **Update pattern matches for `dynamic::Error`.** `Context`, `Plan`, `Source`, and `Record` now carry `{ field: Option, reason: Reason }`; `Term` also gains diff --git a/packages/stack-encrypt/CONTEXT.md b/packages/stack-encrypt/CONTEXT.md index 06e677f72..ee3130de6 100644 --- a/packages/stack-encrypt/CONTEXT.md +++ b/packages/stack-encrypt/CONTEXT.md @@ -8,8 +8,9 @@ derivation of searchable index terms from the same values. Covers ## Language **Cipher-directed**: -Encryption driven by the value's shape: the value's `Encrypt` implementation -walks the cipher and the caller decides the context, which may be absent. +Encryption driven by the value's shape: the value describes itself once +(vitaminc's `Encrypt`), vitaminc walks it into sealed leaves, and the +caller decides the context, which may be absent. Nothing declares an index and no output type is involved. One of the two preferred entry points for a native Rust caller. A language SDK may leave it out: the Go SDK seals a whole value through a plan, so that every sealed @@ -223,12 +224,29 @@ _Avoid_: index (that is the declaration; a term is what it produces), token, hash **Query**: -Deriving the terms for a plaintext under a field's plan, with no ciphertext, -to match terms already stored. A query against an index the plan never +Deriving the query term for a plaintext under a field's plan, with no +ciphertext, to match terms already stored. A query names an operator, and the +plan finds the index that answers it. A query against an index the plan never declared is refused, so a query cannot silently match nothing. _Avoid_: probe, search term, lookup, encrypt query (that is the TypeScript package's method name, not the concept) +**Operator**: +What a query asks of the server — equality, text match — as a unit type +(`op::Eq`, `op::Matches`). An index declares the operators it answers and the +query term it sends for each; a target type names the index that answers each +operator for it. An operator nothing answers is refused before any key is +requested: at compile time where the plan's type shows it, when the query is +awaited where the plan is data (ADR-0009). +_Avoid_: query type, index (that is what answers the operator) + +**Query term**: +The value a query sends to the server. It is not the stored term: equality +sends the same HMAC it stores, but a match query is a filter over the query's +value, where the stored term is a filter over the whole stored value. A query term is never +stored, and a query chain never sends a stored term as a query. +_Avoid_: probe, stored term (that is what a write keeps) + **Open**: Decrypting through a plan: reading back every field of a record that can come back (sealed and passthrough fields, not index-only ones), each under diff --git a/packages/stack-encrypt/Cargo.toml b/packages/stack-encrypt/Cargo.toml index d62c87f47..858816166 100644 --- a/packages/stack-encrypt/Cargo.toml +++ b/packages/stack-encrypt/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "stack-encrypt" description = "Encrypt Rust values under per-value ZeroKMS data keys via the vitaminc cipher traits" -version = "0.2.0" +version = "0.3.0" edition.workspace = true authors.workspace = true repository.workspace = true @@ -22,20 +22,29 @@ stack-kms = { path = "../stack-kms", version = "0.1.0", default-features = false # return type names the auto-detected auth strategy. Only needed with `http`. stack-auth = { workspace = true, optional = true } # `#[derive(EncryptFrom)]` / `#[derive(DecryptInto)]`, re-exported from `target`. -stack-encrypt-derive = { path = "../stack-encrypt-derive", version = "0.2.0" } +stack-encrypt-derive = { path = "../stack-encrypt-derive", version = "0.3.0" } -# The workspace vitaminc (0.5.1): one canonical context encoding shared by +# The workspace vitaminc (0.6.0): one canonical context encoding shared by # the AEAD and PRF derivations (`IntoContext`, cipherstash/vitaminc#339), # `NonEmpty::with`, `From for NonEmpty` (#314) and the parts view # (#318), all of which this crate relies on. All five must share one # version or the aead crate is duplicated. vitaminc-aead = { workspace = true } -# `dynamic`: the runtime value model every language binding funnels through. -vitaminc-aead-value = { workspace = true, optional = true } vitaminc-encrypt = { workspace = true } vitaminc-hmac = { workspace = true } +# Equality terms derive over `vitaminc-normalize`'s encoding of a value +# (the workspace turns on vitaminc-prf's `normalize` feature): one term per +# number whatever its width, text in Unicode 16 NFC. Match text is +# normalized by the same crate before it is tokenized. +vitaminc-normalize = { workspace = true } +# The order targets (`OrderTarget`) and the scheme traits cllw-ore's +# `vitaminc` feature implements, which order terms encrypt through. +vitaminc-ore = { workspace = true } vitaminc-prf = { workspace = true } vitaminc-protected = { workspace = true } +# `dynamic` only: serde over the transport frame, which reads a binding's +# control data (statistics, options, a plan) into typed messages. +vitaminc-aead-frame = { workspace = true, optional = true, features = ["serde"] } serde = { workspace = true } # `Descriptor`: the base64 rendering of a non-textual context for ZeroKMS. base64ct = { version = "1.7", features = ["alloc"] } @@ -60,8 +69,8 @@ default = ["http"] http = ["dep:stack-auth", "stack-auth/http", "stack-kms/http"] # `stack_encrypt::dynamic`: encrypt and decrypt values whose types are known # only at runtime, as an FFI binding's are. Off by default — it is only of -# use to a binding author, and it pulls `vitaminc-aead-value` in. -dynamic = ["dep:vitaminc-aead-value"] +# use to a binding author. Its transport frames are vitaminc-aead's own. +dynamic = ["dep:vitaminc-aead-frame"] # `stack_encrypt::kms::FakeDataKeySource`: the in-memory key source for tests # with no ZeroKMS, so a caller's dev-dependency on stack-encrypt is enough and # no direct stack-kms dependency has to agree with this crate's. @@ -83,10 +92,10 @@ tokio = { workspace = true, features = ["rt", "macros"] } trybuild = "1" # The derive diagnostics are recorded with every feature on, as `test:unit` -# and CI run them. They cannot hold under both feature sets — rustc lists a -# trait's other implementors in its help, and the `dynamic` feature's -# `FfiValue` joins one such list and pushes another entry off it — so the -# test is only built with that feature rather than skipped at runtime. +# and CI run them. They cannot be relied on to hold under both feature sets +# — rustc lists a trait's other implementors in its help, and the `dynamic` +# feature adds implementors (`ValueFrame`) that can join such a list — so +# the test is only built with that feature rather than skipped at runtime. [[test]] name = "ui" required-features = ["dynamic"] diff --git a/packages/stack-encrypt/docs/adr/0004-one-context-per-target-threaded-through-the-declaration-tree.md b/packages/stack-encrypt/docs/adr/0004-one-context-per-target-threaded-through-the-declaration-tree.md index 19056b7ae..111da4472 100644 --- a/packages/stack-encrypt/docs/adr/0004-one-context-per-target-threaded-through-the-declaration-tree.md +++ b/packages/stack-encrypt/docs/adr/0004-one-context-per-target-threaded-through-the-declaration-tree.md @@ -3,6 +3,7 @@ status: accepted date: 2026-09-13 revised: 2026-10-04 extends: ADR-0003 +superseded-in-part-by: ADR-0009 (decision 5) --- # One context per target, threaded through the declaration tree @@ -197,6 +198,13 @@ documentation" option below, applied to the one place the type system cannot reach: a probe and a stored term are the same bytes, and the term methods cannot tell which they are producing. +> **Superseded by [ADR-0009](0009-operators-select-the-index-and-a-query-term-is-not-the-stored-term.md) +> (2026-10-13).** The rule stands; the justification does not. A query term +> and a stored term are the same bytes for HMAC equality, and for OPE only +> when its order encoding is lossless; for every other index the query term +> differs from the stored term, and ADR-0009 makes the operator, not the +> index, the thing a caller names. + ### 6. Targets declare their sources; `FfiValue` is not one A target names the plaintext it accepts (`TextEq` from `Protected`), and diff --git a/packages/stack-encrypt/docs/adr/0007-bindings-enter-through-a-plan-never-a-second-executor.md b/packages/stack-encrypt/docs/adr/0007-bindings-enter-through-a-plan-never-a-second-executor.md index 36ed1f64d..cea58c3d2 100644 --- a/packages/stack-encrypt/docs/adr/0007-bindings-enter-through-a-plan-never-a-second-executor.md +++ b/packages/stack-encrypt/docs/adr/0007-bindings-enter-through-a-plan-never-a-second-executor.md @@ -2,6 +2,7 @@ status: accepted date: 2026-10-04 extends: ADR-0003, ADR-0004 +amended: 2026-10-16, proposed with ADR-0009 and in effect when ADR-0009 is accepted --- # Bindings enter the engine through a plan lowered from data, never through a second executor @@ -29,6 +30,14 @@ extends: ADR-0003, ADR-0004 > Go SDK, as the `context_field` tag word. The typed parts that stay > Rust-only are the typed verb `encrypt_into`, the picker and the one-value > start. +> +> **Amended 2026-10-16**, by #1188, **proposed**. This amendment depends on +> ADR-0009, which is proposed, and takes effect when ADR-0009 is accepted; +> until then it is proposed with it, and changes with it. The decision is +> unchanged. Added, under its last bullet: the operator and its input in the +> data grammar, the query term and its query domain back, `verify` and +> `target_limit` as engine exports, and the operators each EQL type answers, +> with their fidelity, in the catalog. Stack Encrypt has one execution engine: the `Encryption` and `Decryption` descriptions in `target/` and the batched `Pending` they produce. ADR-0003 @@ -188,3 +197,117 @@ to Go (G1: one engine). The reasons recorded against this on 2026-10-04 were guest size and an EQL-free guest for programs that never store into EQL. Two guest builds answer the second, and the first is measured before the SDK ships one build or two (G7). + +## Amended 2026-10-16 (#1188), proposed with ADR-0009 + +**Status: proposed.** ADR-0009 is proposed, and this amendment rests on it: +it takes effect when ADR-0009 is accepted, and is revised or withdrawn with +it. The code it describes lands first, as ADR-0009's Rust side has +(#1182 to #1186), because Stack Encrypt has no stored data and no released +binding a change could break. + +ADR-0009 makes the operator, not the index, what a query names, and gives a +probabilistic term `verify` and `target_limit`. The data grammar a binding +lowered named a field and, for a query, took the term the field's EQL type +chose. It had no operator and no operator input, and no export could verify +a decrypted value or size a fetch. The last bullet of the decision says what +to do with a capability the grammar cannot express: add it to the grammar, +once, so every author has it. This amendment does that for the query side. +ADR-0009's appendix B is the sketch it was amended from. + +**A query names a field, an operator and the operator's input.** The +operator crosses as its name: `eq`, `lt`, `lte`, `gt`, `gte`, `between` or +`matches`. The input is one value, or for `between` a list of two, low then +high. The engine reads the input as the field's declared type first +(`dynamic::read`), so a host's float `34.0` queries a `uint64` field as the +`u64` the field stored. It then finds the index that answers the operator by +the table the typed path's `DefaultIndex` impls state, written over a type +and the indexes a field declares (`dynamic::OpSpec::answered_by`): `eq` +through an equality index, `matches` through a match index over text, the +orderings through an ORE index over an integer, or OPE when the field +declares no ORE. A field that does not answer the operator is refused with +the same shape of error as a mistyped field: an input error naming the field, +with the reason `operator_not_answered` (or `unknown_operator`, +`not_a_range`). The refusal the typed path makes before a term exists, +match text that cuts no token, is made the same way here, before the cipher +is consulted. A range the wrong way round is not refused on either path: it +matches no row, as SQL's `BETWEEN` does. + +**The term comes back with its query domain.** The guest's +`se_query_term(input, plan, field, operator, options)` returns one object: +the operator, its fidelity, the index that answered, the PostgreSQL domain +the term is cast to, and the term. A field with indexes derives that index's +term under the field's context, by the derivation its stored terms came +from, as bytes, and `between` derives one term per bound under the one +context, as a list of two. A field that names an EQL type runs the type's +query twin, and the term is the twin's JSON and the domain its +`query_sql_domain`. One query domain per operator is EQL v4's (ADR-0009, +decision 8); until that lands in the catalog a type's twin carries every term +of the type. + +**`verify` and `target_limit` are engine exports.** `se_verify(input, values, +plan, field, operator)` answers one boolean per decrypted value, a page in +one call. `se_target_limit(term, stats, plan, field, operator, want)` answers +the rows to fetch, or null for no finite fetch. Neither uses a key, so each +runs in a guest that holds no cipher, as `se_plan_check` does. `verify` names +the query as it was derived, by the field, the operator and the input, and +the engine cuts the input's tokens again with the field's own tokenizer and +options. The tokens are plaintext, so no term carries them across the +binding. Sending the input and a page of decrypted values back in is no new +exposure: the input came from the host, and the values came out of the +guest as a decrypt. The alternative, a tokenizer in each language, is the +"lives twice" cost this ADR accepts only for an encoder, and a tokenizer that +drifts from the one that built the stored filter verifies the wrong thing. +`target_limit` takes the term's bytes, because the number of bits the query +sets is a property of the term the engine built, and the fill formula +belongs beside the index configuration. Both refuse an exact operator, which +has nothing to verify and no fetch to size, as the typed path does not +compile the call. + +**The catalog reports the operators each EQL type answers, and their +fidelity.** Each `se_targets` entry gains `operators`: one object per +operator the engine answers for a field that names the type, with its name, +its fidelity (`exact` or `probabilistic`), its arity (`one` or `pair`) and +the type's index that answers it. The engine computes the list from the +type's row by the same table every plan field is held to, so a generator +asks the engine it embeds rather than holding a copy of the rules, as the +2026-10-06 amendment asks of every rule. ADR-0009 rejects a fidelity value +on a term, because Rust says it with a trait. A generator asks before the +program runs, so it needs the answer as data, and the code it generates +carries `Verify` only where the answer is `probabilistic`, which rebuilds +decision 4 of ADR-0009 in a language without traits. Today `TextEq` answers +`eq`, `TextMatch` answers `matches`, and the storage-only types have no twin, +so answer nothing. A type answers `matches` through its twin only when the +engine knows the options its match index is built under, since `verify` +must cut the query's tokens as the stored filter was cut: `eql-bindings` +gives them for each type with a match index (`Target::match_options`, EQL's +one match configuration), and the guest hands them to the engine with the +type's descriptor. They are not on the wire, because a host has no use for +them. `verify` and `target_limit` then run under those options, reading the +twin's `bf`. No type answers `between` yet: a twin is one value, not a +range. + +What does not change: a binding still reaches the engine through a plan, and +nothing here derives a term outside the engine's own derivation, so a query +from Go and the typed query chain derive the same bytes. A cross-language +fixture holds them together (`tests/fixtures/query_operators.json`): the Rust +side checks each recorded term against the typed chain, and the Go SDK's +tests derive, verify and size the same queries through the guest. +The catalog answers for an EQL type; a field declared with indexes has no +type to look up, so `se_operators` answers for any field of a plan: the +plan and the field's name in, the same operator objects out, computed by the +one table `se_query_term` reads (`dynamic::field_operators`). The Go +generator asks it for every sealed field, `encrypt_into` fields included, +and writes one method per operator (#1189). + +`se_query`, which derived a target field's twin with no operator, is +removed: the generated Go code names operators (#1189), and `eq` on a target +field is the twin. `se_term`, a term by index under an explicit context, no +longer serves a query. It stays for one host need: a record call's term +failure does not say which row and field it came from, and the Go SDK asks +`se_term` again for each term to name them. When the record exports name the +field themselves, it goes too. + +A data plan's match index declares no `expected_tokens` prior, so +`target_limit` on a field declared as data is unbounded without a measured +histogram. A data form for the prior is later work. diff --git a/packages/stack-encrypt/docs/adr/0009-operators-select-the-index-and-a-query-term-is-not-the-stored-term.md b/packages/stack-encrypt/docs/adr/0009-operators-select-the-index-and-a-query-term-is-not-the-stored-term.md new file mode 100644 index 000000000..d5df44462 --- /dev/null +++ b/packages/stack-encrypt/docs/adr/0009-operators-select-the-index-and-a-query-term-is-not-the-stored-term.md @@ -0,0 +1,1194 @@ +--- +status: proposed +date: 2026-10-13 +supersedes: ADR-0004 (decision 5) +extends: ADR-0003, ADR-0007 +--- + +# Operators select the index, and a query term is not the stored term + +[ADR-0004](0004-one-context-per-target-threaded-through-the-declaration-tree.md) +decision 5 kept the standalone term methods as the query path on the grounds +that "a probe and a stored term are the same bytes, and the term methods +cannot tell which they are producing". That premise is wrong, and the API +built on it has the caller name an *index* when what they mean is an +*operator*. + +This ADR records the query-side model for the Rust Stack Encrypt library: +what a caller asks for, how the library chooses the index that answers it, +what it hands back, and how far that answer can be trusted. It is a design +record. No code changes with it. + +Scope is the Rust library. The decisions bind the Rust API; the bindings and +the language SDKs are governed by ADR-0007, which will need an amendment once +this ADR is accepted, because the data grammar a binding lowers has no +operator in it today. [Appendix B](#appendix-b-the-model-in-go-and-typescript) +sketches what that amendment would carry, so the model can be checked against +two more languages before it is built. + +Two words, so they are not re-litigated. The value a caller sends to the +server to be compared against stored values is a **query term**, or a query. +ADR-0004 called it a probe; "probe" is not used below except when quoting +that ADR. The value a write puts in the column is the **stored term**. + +## The problem + +### A query term and a stored term are not the same bytes + +Decision 5 of ADR-0004 assumed they were. In general they are not: + +| index | stored term | query term | +| --- | --- | --- | +| HMAC | the HMAC | the same HMAC | +| ORE | left and right ciphertext | the left ciphertext only | +| OPE | the OPE value of the order key | the same value; equal terms mean equal order keys, which is plaintext equality only when the key is lossless (it is for integers, and not for text after the column's declared transform) | +| Bloom match | one filter over every n-gram of the value | a filter over the n-grams of the needle: a subset, or bits the stored filter lacks | +| Bloom prefix (planned) | an HMAC per edge n-gram | one HMAC | +| JSON path | a selector and, per leaf, that leaf's term | a selector, or a selector plus a leaf query term | +| similarity (research preview) | `[u64; BANDS]` tokens per row | a query set of `BANDS × PROBES` tokens | + +HMAC equality is the one index whose query term is byte-for-byte the stored +term, and whose comparison means plaintext equality. OPE comes close only when +its order key is lossless, as it is for integers. The others differ in kind. +The order key is `orderable-bytes`' order-preserving encoding of the value, +applied after whatever transform the column declares for the kind (the +system +[ADR-0002](../../../../docs/adr/0002-one-value-model-three-encodings-and-eql-v4-by-producer.md), +not this directory's, defines a text fold; the encoding is pluggable, and +what the term means follows it). The Rust library does not use cllw-ore's +`orderize_string`, which an earlier draft of this ADR named. + +The term is a function of the index *and the operator*, not of the index +alone. An ORE index answers `=`, `<` and a range with different query shapes; +a Bloom index answers `Matches` and (if used for ranked search) `Nearest` with +the same stored filter and different queries. + +### The caller names an index, not what they want + +Today the query chain is +`cipher.query(value).using(&plan).index(Match(..))`: the caller picks the +index, and the operator is implied. That has three costs. + +- A domain type with two indexes that both answer an operator leaves the choice + to the caller, who has to know that HMAC is the better equality than ORE. + The original CipherStash client made the choice for them, by operator — and + took the *first* index after an alphabetical sort, so `Eq` went to ORE when + both were present. +- An operator an index cannot answer is not a compile error. Nothing in the + types says which operators `Match(..)` supports. +- There is no place to put operator-specific input. `Between` takes two + values; `Nearest` takes an embedding and a fetch size; a JSON path operator + takes a path. + +### The server's answer is sometimes approximate, and the library says nothing + +A Bloom filter is probabilistic. A row whose filter happens to contain every +bit of the query passes `@@` without containing the needle. A similarity index +returns candidates by construction. + +The library has never said which terms are exact. A caller who wants ten real +matches has no way to know how many rows to fetch, and no help deciding, after +decrypting, which rows to keep. "We have never implemented client-side +filtering for Bloom filters" is a gap the API should at least leave room for. + +### What the library is + +Stack Encrypt is not a query interface. It produces query terms that a caller +binds into SQL through sqlx, Diesel or (through the bindings) Drizzle and +Prisma, and it decrypts what comes back. It never runs a query. Every decision +below respects that line: the library can tell you how many rows to ask for +and whether a decrypted row is a real match, but the SQL, the `LIMIT` and the +loop are yours. + +## Decision + +### 1. The caller names an operator; the operator is a type + +```rust +use stack_encrypt::op; + +let term = cipher.query(op::Eq, "bob@example.com").on(&users::email).await?; +let term = cipher.query(op::Lt, 40).on(&users::age).await?; +let term = cipher.query(op::Between, (18, 65)).on(&users::age).await?; +let term = cipher.query(op::Matches, "ali").on(&users::name).await?; +let term = cipher.query(op::AtPath(op::Eq), ("$.address.city", "Sydney")).on(&users::profile).await?; +``` + +Operators are unit types, as in the original client, not a runtime enum, and +a query passes one by value, as a plan passes an index (`.via(Ore)`). They are +used by path (`op::Eq`), because an imported `Eq` would shadow the prelude's +`Eq` trait. An operator carries its own input type: `Eq` takes one value, +`Between` a pair, `Nearest` an embedding, `AtPath` a path and `Op`'s +input. The query is awaited because deriving the term can retrieve a key. + +Operators come in three kinds. A **predicate** (`Eq`, `Lt`, `Lte`, `Gt`, +`Gte`, `Between`, `Matches`, `StartsWith`, JSON `Contains`, `ContainedBy`) +filters rows. An **accessor** (`AtPath`) applies another operator at a +JSON path. A **ranking** (`Nearest`) orders rows and takes a fetch size +rather than filtering. + +Two naming points, so they are not re-litigated. `Contains` and `ContainedBy` +are JSON containment (`@>` / `<@`); text search is `Matches`, because a Bloom +match is not a containment. The accessor is `AtPath`, not `At`, because `At` +alone does not say what it is at. + +Case is a parameter of the text operators, defaulting to the common case: +`Matches`, `StartsWith`, with +`op::Matches.case_sensitive()` for the other. A Bloom index implements the +variant its configuration fixes (`downcase` on or off), so a case-sensitive +query against a case-folding index is a type error, not an empty result. + +### 2. An index declares the operators it supports, and the query term for each + +```rust +pub trait Operator: Copy + 'static { type Arity: Arity; } // `One` plaintext, or a `Pair` + +pub trait Supports>: Index { + type Query: TermFor; // what this index sends for `Op` + type Verifier; // what the query keeps to check a row + fn check(&self, input: &In) -> Result<(), Error>; // a refusal, before any term exists + fn verifier(&self, input: &In) -> Self::Verifier; + fn query(verifier: Self::Verifier, terms: In::Terms, token: QueryToken) -> Self::Query; +} +``` + +`In::Plaintext` is the plaintext type the index is over, and its +`Index::Term` is the stored term it derives. `Query` is the query term, and +`query` makes it from the verifier and the terms the index derived for the +query's input. `QueryToken` can be made only inside the crate, so only a +query chain calls `query`, and no caller can turn a stored term into a query +term by hand. + +`QueryTerm` and the two traits that refine it are defined in decision 4. +`Query` is not `Term`. An ORE index's `Supports::Query` is the left +ciphertext; its `Term` is left and right. (This crate's ORE is CLLW today, +whose ciphertext has no left half to send alone, so until block ORE lands, +#1140, the query term is the ciphertext itself, as an HMAC's is; `Supports` +is where the left-only term goes when it arrives.) A Bloom index's +`Supports::Query` is a filter over the query's value +(`MatchQuery`); its `Term` is a filter over the value (`MatchTerms`). There is +no other path from a derived term to the server: +`cipher.query_index(index, v).on(&plan)`, which returned an index's own term, +went with the ordering operators (#1186). + +An operator says what a query takes through its arity. `Eq`, the orderings +and `Matches` take the plaintext the index is declared over +(`Supports`); `Between` takes a pair of them +(`Supports`); `Input` relates the input to that plaintext, +so the plan is checked against `S` either way, and the chain derives one +term per plaintext under the one label. `check` is where a query is refused +before any term exists: a match index whose declared case disagrees with its +`downcase` option, a match query with no tokens. A `Between` whose bounds +are the wrong way round is not refused: it matches no row, as SQL's does. `AtPath` takes a path and `Op`'s input, and gains +its shape with the JSON index. + +The bound tightens per operator, through `TermFor`: any `QueryTerm` +answers `Eq`, but only a `Probabilistic` one answers `Matches`, and only a +`Ranked` one will answer `Nearest`. None of this crate's indexes can claim +an inexact operator without saying how its answer is checked. The rule binds +this crate's terms through blanket impls; a term in another crate can opt +into `TermFor` by hand, so there it is a guide rather than a proof. + +`Verifier` is what the query term keeps of the query's plaintext so it can +check a decrypted row later, and `verifier` takes it before the plaintext is +consumed. An exact term checks nothing, so an equality index's verifier is +`()`. A match index's is the query's tokens (`QueryTokens`), which `verify` +needs and the filter cannot give back: + +```rust +impl, O: MatchCase> Supports, S> for Match { + type Query = MatchQuery; + type Verifier = QueryTokens; // "alice" -> ali, lic, ice + fn verifier(&self, value: &S) -> QueryTokens { QueryTokens::of::(value.as_ref()) } + fn query(tokens: QueryTokens, term: MatchTerms, _: QueryToken) -> MatchQuery { + MatchQuery::new(term, tokens) // filter for the server, tokens for verify + } + // check elided +} +``` + +A row the server returns for `alice` passes `verify` only if its decrypted +text holds `ali`, `lic` and `ice`, so a Bloom false positive never reaches +the caller. + +### 3. The domain type chooses the best index for an operator + +```rust +pub trait Answers { + type Via: Supports + Default; // an index is a unit type, so its Default is the index +} + +impl Answers for TextSearch { type Via = Equality; } +impl Answers for TextSearch { type Via = Ore; } +impl Answers for TextSearch { type Via = Match; } +``` + +"Best" is defined per domain type, by hand, and means the most efficient or +the most secure index that answers the operator, as the index types in play +dictate. A domain with both HMAC and ORE answers `Eq` with HMAC: cheaper to +compare, and the ORE term reveals order. This is the decision the original +client made by accident (first after a sort) and this ADR makes on purpose. + +A domain that does not answer an operator has no `Answers` impl, and +the query is a compile error. + +A plan that declares its indexes rather than a domain type (a field of a +fields plan, or a one-value plan built `with` indexes) has no type to hold +`Answers`, so the operator names its own default, and a plan that declared +another index for it names that one with `.via(index)`: + +```rust +pub trait DefaultIndex: Operator { + type Via: Supports + Default; +} +``` + +### 4. A query term is one of three things, and the trait it implements is its fidelity + +```rust +pub trait QueryTerm {} + +pub trait Probabilistic: QueryTerm { + type Plaintext; + fn verify(&self, value: &Self::Plaintext) -> bool; + fn target_limit(&self, want: u64, stats: &Stats) -> Limit; +} + +pub trait Ranked: QueryTerm { + type Plaintext; + fn score(&self, value: &Self::Plaintext) -> Score; + fn target_limit(&self, want: u64) -> u64; +} +``` + +- A term that implements `QueryTerm` only is **exact**. The server's answer + is the answer. HMAC `Eq`, ORE and OPE (`Lt`, `Between`) on numbers, JSON + `AtPath`, and ORE and OPE on text (see "Text ordering" below). +- A `Probabilistic` term can return **false positives and no false + negatives**. `verify` is the operator's own meaning, run on a decrypted + value: it decides whether a row the server returned is a real match. Bloom + `Matches` and `StartsWith`. Bloom filters are the only index this applies + to today, and the trait is not a home for an order term: an order term + over text compares order keys, and two values with one key tie by the + term's definition, not by error, so there is nothing a decrypted value + could be checked against. +- A `Ranked` term returns **candidates in approximate order**. `score` is the + exact score on a decrypted value, for re-ranking. `Nearest` over a + similarity index, and `Nearest` over a Bloom index if used for ranked text + search. + +`target_limit` has one meaning on both traits: *fetch this many candidate +rows so that, at the stated confidence, `want` of them survive*. On a +`Probabilistic` term the survivors are the rows `verify` keeps, and the +number depends on the table, so it takes `Stats` and may answer +`Limit::Unbounded`. On a `Ranked` term the survivors are the top `want` after +`score` re-ranks, and the number is the index's configured recall factor +times `want`, so it takes nothing else. + +`verify` is infallible. It runs on a value that is already decrypted and +already the type the index was declared over, so the only question it can +answer is "does this row match", and every other outcome is "no": a JSON +path absent from the document, text too short to hold the query's tokens. +A `bool` is what `Iterator::filter` takes; an error would have no recovery +except dropping the row, which is `false` by another name. The one input the +library refuses, a query value too short to tokenise, is refused when the query +is awaited, before a term exists. The stored side refuses nothing: a value +too short to tokenise is stored as the empty filter, which no query matches, +so a two-letter name is a valid value in a match column and `verify` is +never asked about it. The empty filter is visible to anyone who can read the +column: it tells them the value is empty, separator-only or shorter than the +n-gram length. A filter's fill already leaks its value's approximate length; +this is an exact class, and the price of storing such values at all. + +`Plaintext` is the decrypted value the term is defined over, and that +is not always the value the user wrote. For `Matches` it is the text. For +`Nearest` over a similarity index it is the stored embedding, or the LSH +sketch when only the sketch is stored; `score` is exact with respect to what +was stored, not to a document the row never held. For `AtPath` it is the +JSON document, and `verify` applies `Op` at the path. A query has to select +whatever `Plaintext` is, which decision 5 and the consequences return to. + +There is no `Fidelity` enum and no `verify` on exact terms. A caller cannot +write `term.verify(..)` for an HMAC term: verification would pass for every +row the server returned, so the method would say nothing, and the compiler +says so. + +`AtPath` inherits the fidelity of `Op` on the leaf: `AtPath` and +`AtPath` are exact, as `Eq` and `Lt` are, and an accessor over a +probabilistic leaf operator, should one be added, is `Probabilistic`. + +`QueryTerm` is a marker today, and the two refinements are added to it as +the indexes that need them land. A term serialises to the JSON its query +domain takes (decision 8), which is a property of each term type rather than +of the trait. + +### 5. Verification is the caller's, after decrypt; the library supplies the predicate and the bound + +The library never runs a query, so it cannot filter the result. What it gives +a caller of a `Probabilistic` term is two things. + +`verify` is the predicate. For `Matches`, it folds case, +tokenises both sides with the index's own tokenizer and checks that the +needle's n-grams occur in the value. Whether that check is n-gram containment +or a substring test (they differ once the query is longer than one n-gram) +is the implementation's choice; both are sound against a Bloom match, and +the ADR fixes neither. It lives on the term because the term already carries +the operator's input and the index's configuration, so it cannot disagree +with what was stored. + +`target_limit` is how many rows to ask for to expect `want` real matches. +For a Bloom filter it is computable from what the client knows, plus what +the server has to tell it: + +- `m` bits and `k` hashes: the index configuration. +- `b`: the distinct bits set in the *query* filter. The client built it, so + this is exact, not `k × n-grams`. +- `f_i`: the fill of the stored filter in row `i`, `1 − e^(−k·n_i/m)` for + `n_i` stored tokens. It is per row, because values differ in length. +- `N`: the rows the predicate scans. + +A non-matching row `i` passes when every one of the `b` query bits is set in +its filter, with probability about `f_i^b`. Over the table the pass rate is +the *mean of* `f_i^b`, which is not the mean fill raised to `b`: for `b > 1` +the mean of a power exceeds the power of the mean, and a column of mixed +lengths makes the gap large. Half a million rows of 20 tokens and half a +million of 200, with `b = 6`, pass at a mean rate of 3.8e-3 (3,800 false +positives); the mean fill, 0.25, raised to 6 predicts 245. The number the +bound needs is therefore `p = mean(f_i^b)`, and the statistics the client +holds must let it compute that for the `b` of each query. + +The model assumes a non-matching row shares no token with the query. The +same token sets the same bits in every filter, so a row holding part of the +query has fewer bits left to chance: "police" already holds two of +"alice"'s three 3-grams, and passes at `f^6` rather than `f^18`. On natural +text the stated confidence is therefore nominal, and a measured histogram +cannot correct it, because it measures fill, not overlap. Correctness does +not depend on it: `verify` decides every row, and the candidate count says +whether a fetch was complete. + +False positives are then `Poisson(λ = p·N)`, and the worst case that still +satisfies the caller is exactly `want` true matches preceded by every false +positive, so + +``` +target_limit(want, N) = want + Poisson_quantile(λ = p·N, confidence) +``` + +This is a probabilistic bound, and the ADR does not pretend otherwise. At 99% +confidence one query in a hundred draws more false positives than the +quantile, and if those rows sort before a real match under the query's +`ORDER BY`, the fetch holds fewer than `want` real rows while more exist. The +caller can tell the two apart from one number it already has: if the server +returned *fewer candidates than the limit*, the predicate is exhausted, and +fewer than `want` verified rows means there were fewer than `want` matches. +If it returned exactly the limit, the result is a page, not an answer, and +the cursor loop in decision 6 continues from it. `verify` makes every +returned row correct; only the candidate count makes the result complete. + +#### Declared and measured statistics + +Measured statistics come from the server; the declared prior comes from the +index declaration. The library takes either as numbers in `Stats` and does +not care which it was given. A column has the prior from the day it is +declared. + +**Declared.** A match configuration declares `expected_tokens()`, the typical +token count of the values it will hold, beside the `m` and `k` of its +options: 20 for a name column, 200 for a notes column. It is not part of the +index's identity and changes no term. From it `Stats::declared(rows)` takes +`f = 1 − e^(−k·expected_tokens/m)` and `p = f^b`. This is a prior, and +`rows` is a planning estimate too. It is enough to warn before a query runs +(a three-letter needle against a notes column) and to size a first fetch; it +knows nothing about the spread of lengths, so it carries the mean-fill error +above. + +**Measured.** The fill of a stored filter is `cardinality(bf) / m`, and `bf` +is the set-bit positions, so a histogram of set-bit counts is a histogram of +fills. One aggregate gives it, at most `m` buckets: + +```sql +SELECT cardinality(eql_v4.match_term(name)) AS bits, count(*) +FROM users TABLESAMPLE SYSTEM (1) +WHERE name IS NOT NULL +GROUP BY 1 +``` + +`Stats::measured(rows, histogram)` keeps the buckets, and `target_limit` +computes `p = Σ count_i · (bits_i / m)^b / Σ count_i` for whatever `b` the +query has. The sample bounds the cost on a large table; `TABLESAMPLE` is a +page sample, which is fine for a distribution and unsuited to an exact count. +It is also a sample of pages, so on a table of a few thousand rows a 1% +sample can select none; below that size the clause is dropped and the whole +table is read, which costs nothing worth saving. `rows` counts the rows the +predicate can match, the non-NULL ones, since the histogram's pass rate is +over those and a NULL never passes. One catalog read gives it: + +```sql +SELECT (c.reltuples * (1 - coalesce(s.null_frac, 0)))::bigint +FROM pg_class c +LEFT JOIN pg_stats s + ON s.schemaname = 'public' AND s.tablename = 'users' AND s.attname = 'name' +WHERE c.oid = 'users'::regclass AND c.reltuples >= 0 +``` + +`reltuples` is −1 for a table that has never been vacuumed or analysed, +such as one just bulk-loaded. That is an unknown count, not an empty +table, so the statement returns no row and the application builds no +`Stats`: it pages with a cursor, as for `Unbounded`, or runs `ANALYZE`. +Clamping −1 to 0 would give λ = 0 and a confident fetch of exactly `want`. +A `Limit` never exceeds `i64::MAX`, the largest `LIMIT` PostgreSQL takes. +An empty histogram falls back to the declared prior. + +`target_limit` returns a `Limit`: `Rows(n)`, or `Unbounded` when the +statistics say nothing about the stored filters (no prior and no +histogram) or the confidence is not below 1. A `want` of 0 is `Rows(0)`. +`fetch_or(page)` reads either as a fetch size, for a caller that pages +anyway, and cuts `page` to `i64::MAX`. Past ten million expected false +positives the quantile is the conservative `λ + 8√λ`, since the query is +hopeless at that point; it covers a confidence up to `1 − 1e-15`, and a +higher one there is `Unbounded`. + +Where the numbers live and who keeps them in step was asked on the review, +so it is written down. They are read from the server by the application, at +startup or on a timer, and cached in the client as plain numbers. Nothing +about them is secret: the set-bit count of a stored filter is visible to the +server already, since the server holds the filter, and the row count is in +the catalog. Several clients of one database each read the same table and +need no coordination; two that disagree are both approximately right. A +stale `Stats` moves the confidence, never the correctness, because `verify` +still decides every row. A column that has never been measured uses the +declared prior. + +A third statistic answers a different question. `SELECT count(*) FROM users +WHERE name @@ $1` is the candidate count `C = T + FP`, index-only. `C` is the +true minimum: fetch `C` rows and every real match is among them. It is a +count per query rather than a cached statistic, and `p·N` then says how much +of `C` is noise. + +#### Worked numbers + +With the EQL v4 defaults (3-grams, `k = 6`, `m = 2048`), a million rows, every +row at the stated length and 99% confidence: + +| stored tokens | needle | `b` | `p` | `λ` | `LIMIT` | +| --- | --- | --- | --- | --- | --- | +| 20 (a name) | `ali` | 6 | 3.4e-8 | 0.03 | `want + 1` | +| 200 (a paragraph) | `ali` | 6 | 7.6e-3 | 7,600 | `want + ~7,800` | +| 200 | `alice` | 18 | 4.4e-7 | 0.44 | `want + 3` | + +The bad case is a short needle against long stored text, and the library can +say so before the query runs. `λ` is also the number of decrypts a query will +waste, which gives the Bloom parameters a number to be tuned against. Taking +the bad row: a needle one character longer (`alic`, two 3-grams, `b = 12`) +brings `λ` to 58; doubling `m` to 4,096 brings it to 268 at `b = 6`, and +`m = 8,192` to 6. A smaller `k` makes it worse, not better: at `k = 3` the +needle `ali` sets 3 bits, so `b = 3`, and although the fill falls to +`1 − e^(−3·200/2048) = 0.254`, `p = 0.254³ = 0.016` and `λ` is about 16,400, +twice the `k = 6` figure. For one-gram needles the best `k` is near +`(m/n)·ln 2 ≈ 7`, so `k = 6` is close to it already. The cheapest lever is +often a minimum needle length for long-text columns, which a `Probabilistic` +term can report from `target_limit` alone. + +#### Text ordering + +`Lt` on text is exact, decision 4, so none of the above applies to it: no `p`, +no `verify`, no `target_limit`. The term is an order term over the column's +order key, which is `orderable-bytes`' encoding of the value after the text +transform the column declares (the system ADR-0002's fold, or another, since +the encoding is pluggable), and the server compares keys. Two values with one +key tie; that is what the column declared, and an earlier draft of this ADR +was wrong to call it a false positive and put the term under `Probabilistic`. +Its use is ordering and cursor paging on names (`ORDER BY name`, "the page +after Nguyen"), and EQL v4 carries `query_text_ord` and `query_text_ord_ore` +for it. Stack Encrypt produces the term: it hands the text to cllw-ore's +vitaminc schemes as the `Text` target, whose order key is vitaminc-ore's +text order encoding, the system ADR-0002's fold pinned to Unicode 16, and +the ORE and OPE indexes answer the orderings on text over it. `TextOrdOre` and `TextSearchOre` also need the block ORE scheme EQL +stores (#1132). + +A `Ranked` term's `target_limit` applies the index's configured recall +factor and needs no `Stats`. + +### 6. The loop is a documented pattern, not a library helper + +A `Probabilistic` term composes with the caller's query library like this. One +shot, with a bound, and the completeness check from decision 5: + +```rust +let term = cipher.query(op::Matches, "ali").on(&users::name).await?; +let fetch = term.target_limit(10, &stats).fetch_or(50); + +let rows: Vec = sqlx::query_as( + "SELECT id, name FROM users WHERE name @@ $1 ORDER BY id LIMIT $2", +) +.bind(sqlx::types::Json(&term)) +.bind(fetch as i64) +.fetch_all(&pool).await?; + +let exhausted = (rows.len() as u64) < fetch; +let users = cipher.open(rows).using(&users_plan).await?; +let hits: Vec = users.into_iter().filter(|u| term.verify(&u.name)).take(10).collect(); +// hits.len() < 10 && exhausted: there are no more matches. +// hits.len() < 10 && !exhausted: page on from the last id. +``` + +Cursor paging, which needs no `Stats`, works for `Limit::Unbounded`, and is +the form that is complete by construction. A cursor is the last row's value of +an exactly ordered column, carried into the next page as `WHERE id > $cursor` +instead of an `OFFSET`: + +```rust +let term = cipher.query(op::Matches, "ali").on(&users::name).await?; +let (mut hits, mut after, page) = (Vec::new(), 0_i64, 50_i64); + +while hits.len() < 10 { + let rows: Vec = sqlx::query_as( + "SELECT id, name FROM users WHERE name @@ $1 AND id > $2 ORDER BY id LIMIT $3", + ) + .bind(sqlx::types::Json(&term)).bind(after).bind(page) + .fetch_all(&pool).await?; + if rows.is_empty() { break; } + after = rows.last().unwrap().id; + hits.extend(cipher.open(rows).using(&users_plan).await?.into_iter().filter(|u| term.verify(&u.name))); +} +hits.truncate(10); +``` + +On paging generally. `LIMIT` and `OFFSET` are not going anywhere: every SQL +library emits them and legacy applications page with them. The one that is +unsound over a `Probabilistic` predicate is `OFFSET`, because the false +positives shift it, and a page of real rows is not a fixed distance into the +candidates. `LIMIT` with the bound is sound for one page; a cursor is sound +for every page. Two further options are on the EQL side and listed under +deferred: ordering candidates by fill, so the least likely false positives +come first, and the candidate count `C`, which turns "how far through" into +a number. + +The library ships `verify` and `target_limit`. It does not ship the loop, +because the loop runs queries. That may change when Stack Similarity lands and +the ranked loop is worth packaging; it is deferred, not refused. + +### 7. `Between` is one term and one operand + +`cipher.query(op::Between, &(lo, hi)).on(&plan)` produces one term, +`sem::RangeQuery`, carrying the index's term for each bound (the ORE left +ciphertexts, once block ORE lands), inclusive at both ends; `(v, v)` is one +value. The client does not refuse `lo > hi`: as SQL's `BETWEEN`, such a +range matches nothing. Judging it would mean reproducing, before +encryption, the order the index compares in (text by its fold, floats by +their canonical encoding), which belongs to the ORE crates. One call +derives both bounds, under one +context, so a caller cannot pair a bound from one column with a bound from +another. The ordering operators are answered over the integer types, the +floats and text (`op::Ordered`), by the ORE index by default and by OPE +through `.via(Ope)`. Each term is cllw-ore's encryption of the value's +ADR-0002 order key at its type's target, so a float orders as Postgres's +`float8` does (`-0.0` ties `0.0`, NaN sorts last), and an `f32` is ordered +as the `f64` it widens to. + +In SQL the term stays one operand. EQL v4 gains a function that takes the +column and the range, and a range query domain beside each ordered query +domain to carry it, for OPE as well as ORE: `query_integer_ord_ore` gains +`query_integer_range_ore` and `query_integer_ord_ope` gains +`query_integer_range_ope`, one per (family, term) as decision 8 has it. The +example uses the ORE one; the catalog names them: + +```sql +WHERE eql_v4.between(age, $1::eql_v4.query_integer_range_ore) +``` + +The term is as indivisible in SQL as it is in Rust: one placeholder, so no +statement can bind the low bound of one term with the high bound of another +or bind them in the wrong order, and a binding hands back one value for the +term as it does for every other (appendix B). An earlier draft spelled the +range as the native `BETWEEN` with the term's two halves as two parameters; +this one withdraws it, because it split in SQL the one thing the Rust side +had just joined, and every SDK had to grow a `bounds()` to feed it. + +What the one-operand form asks of EQL is that the planner still see a range. +`eql_v4.between` must be a SQL function PostgreSQL inlines at planning time +(`LANGUAGE sql`, one expression, `$1 >= lo($2) AND $1 <= hi($2)` with +immutable accessors, and not `STRICT`), so that a btree over the ORE term +serves it as one range scan. `STRICT` matters: PostgreSQL inlines a `STRICT` +SQL function only when its body is strict too, and `a >= x AND b <= y` is not +(`NULL AND false` is `false`), so a `STRICT` declaration would pass a test +that only calls the function and then not be inlined. A function the planner cannot inline is a call per row on a +sequential scan, which no index can rescue. That is an EQL-side requirement +with an EQL-side test, and it is why the function and the domain arrive +together. + +### 8. One query operand domain per (family, term) in EQL v4 + +The EQL v4 side carries one query domain per (type family, term), such as +`eql_v4.query_text_match` and `eql_v4.query_integer_ord_ore`, rather than one +per operator or one per stored domain. This is the "option B" of the design +discussion and is recorded here so the Rust side's `Supports::Query` +has a fixed target: the query term for an (index, operator) serialises to +exactly one of those domains. `Between` serialises to one value of the +family's range domain, which carries both bounds (decision 7). + +## Considered options + +**Keep the index as the thing the caller names** (status quo). Rejected for +the three costs in the problem statement. It is also what the review of +#1164 ran into: storing short `TextMatch` text needs the stored term and the +query term for a Bloom filter to differ, and the API had no place to say so. + +**Operators as a runtime enum**, as `cipherstash-client` did. Rejected: an +unsupported operator becomes a runtime error, and operator-specific input has +to be a tagged union. Rust can carry both in the type. + +**First index that supports the operator**, as `cipherstash-client` did. +Rejected: the choice is per domain type and must be deliberate, because it +decides what the query term reveals. + +**A `Fidelity` enum on every term, and `verify` that returns `true` for exact +terms**. Considered and dropped: a method that is a no-op on most terms is +noise, and a runtime enum says at runtime what the trait says at compile +time. + +**A fallible `verify`.** Considered and dropped, decision 4: every failure +is a non-match. + +**The library returns candidates and verifies them itself** +(`cipher.query(..).fetch(&pool)`). Rejected: the library would run queries, +own `LIMIT` and paging, and need a driver. That is a query interface, which +this library is not. + +**A range as two terms**, `query(op::Gte, lo)` and `query(op::Lte, hi)` bound +as two predicates. Rejected in favour of one `Between` term, decision 7. `Gte` +and `Lte` themselves stay; they are the open-ended comparisons, and a range +is not two of them. + +**Native `BETWEEN` with the term's halves as two parameters.** The previous +draft of decision 7. Dropped: it splits one operand across two placeholders, +and every binding has to hand back halves to feed it. + +**`expected_tokens` deferred until the stats query exists.** Dropped: the +declared prior is what makes `target_limit` usable on a column nobody has +measured, and it costs one number in the index declaration. Decision 5. + +## Consequences + +ADR-0004 decision 5 is superseded. Its rule — a stored term goes through a +target, a query term comes from the query path — stands, but its +justification was wrong and is replaced: the two differ for every index but +HMAC and lossless OPE, and the query path is `cipher.query(op, ..)`, which +produces a term the stored side never would. + +ADR-0007 needs an amendment once this ADR is accepted. The plan a binding +lowers names a field and, for a query, an index; it has no operator and no +operator input, and the generated code of a language SDK has no `verify`. +Appendix B is the sketch to amend from. + +A caller who wants a real-match count or offset paging on a `Probabilistic` +term cannot have either from the server. `COUNT(*)` is an upper bound, and +`OFFSET` shifts with the false positives. Cursor paging only. This is the +most visible change for users and is the reason to settle it now. + +Only the inexact terms in a `WHERE` need verifying. `age > $2 AND name @@ $1` +verifies `name` and not `age`. + +Verification costs decrypts, not database work, and tells the server nothing +it does not already know. The cost is `λ` wasted rows per query: `λ` more +rows on the wire and `λ` more entries in the batched key retrieval the real +rows ride in anyway, one request per 500 values per keyset. The network call +count is set by the batch size and the number of keysets, not by `λ`; the +decrypt work and the wire bytes are. That is the number the Bloom parameters +are tuned against. + +A verified row needs its `Plaintext`, which decision 4 says is not always +the user's value. EQL v4 values carry `c` beside their terms, so a text or +JSON column's query already selects it. A similarity index stores its vector +separately, so a `Nearest` query must select the embedding, or the sketch, +as well. + +Text ordering needs no special case: `Lt` on text is an exact term over the +order key, and what that key folds is the system +ADR-0002's decision (the value model, linked above), which keeps equality off +the order term for the same reason. + +EQL v4 gains `eql_v4.between(column, range)` and a range query domain per +ordered query domain, ORE and OPE, under the inlining requirement of decision 7. That is +EQL-side work this ADR asks for, not a deferral. + +It is a breaking change to the query chain. `cipher.query(v).using(&plan)` +with `.equality()` becomes `cipher.query(op::Eq, v).on(&plan)`: the operator +first, and `on` for a query where a write says `using`. +`cipher.query_index(index, v).on(&plan)`, the index's own term, is gone: +every index a plan can declare is reachable through an operator, ORE and OPE +through the ordering operators (#1186). The write side (`encrypt`, targets, +plans) does not change. + +## Deferred + +- Whether `Nearest` is `cipher.query(op::Nearest, ..)` or a separate + `cipher.nearest(..)` entry, and whether a ranked query can carry further + predicates. The latter is possible only when the server can join candidates + to rows (the `ByRow` similarity mode), not in the per-band pseudonymous mode. +- `ORDER BY cardinality(eql_v4.match_term(col))` on the EQL side, so + low-fill rows — the least likely false positives — come first. It reveals + nothing `bf` does not. +- Whether `Nearest` over Bloom scores by bit overlap or needs token-level + terms. An index-design question, not an API one. +- Packaging the cursor and ranked loops once Stack Similarity exists. + +## Appendix A: the terms in sqlx + +Each operator below is shown as the Rust call that produces the term, the +SQL it binds into, and what the caller does with the rows. The casts name +EQL v4's query domains (decision 8), as the v4 tests bind them today: +`$1::eql_v4.query_text_eq`, with the JSON text of the term as the parameter. +The JSON operators are spelled as EQL v3 ships them, since v4 does not carry +`json` yet. `UserRow` is the row as the driver returns it, with the EQL +columns as `sqlx::types::Json`, and `cipher.open(rows).using(&users_plan)` +opens every row under the plan the table was written with, in one key +request, and yields `User`s. + +**`Eq`, exact.** The term is an HMAC; the operator is `=`. Nothing to verify. + +```rust +let term = cipher.query(op::Eq, "bob@example.com").on(&users::email).await?; + +let rows: Vec = sqlx::query_as( + "SELECT id, email, name FROM users WHERE email = $1::eql_v4.query_text_eq", +) +.bind(sqlx::types::Json(&term)) +.fetch_all(&pool).await?; +let users = cipher.open(rows).using(&users_plan).await?; +``` + +**`Lt` on an integer, exact.** The term is the ORE left ciphertext; the +operator is `<`. `Lte`, `Gt` and `Gte` are the same shape. + +```rust +let term = cipher.query(op::Lt, 40).on(&users::age).await?; + +let rows: Vec = sqlx::query_as( + "SELECT id, email, name, age FROM users WHERE age < $1::eql_v4.query_integer_ord_ore ORDER BY age", +) +.bind(sqlx::types::Json(&term)) +.fetch_all(&pool).await?; +``` + +**`Between`, exact, one term and one parameter** (decision 7). + +```rust +let term = cipher.query(op::Between, (18, 65)).on(&users::age).await?; + +let rows: Vec = sqlx::query_as( + "SELECT id, email, name, age FROM users + WHERE eql_v4.between(age, $1::eql_v4.query_integer_range_ore)", +) +.bind(sqlx::types::Json(&term)) +.fetch_all(&pool).await?; +``` + +**`Matches`, probabilistic.** The term is a Bloom filter over the needle's +3-grams, as `{"bf": [59, 96, …]}` in the fixture the Go SDK tests against; +the operator is `@@`, column on the left. The query selects the ciphertext +(`name` carries `c`) because `verify` needs the decrypted text, and the +`LIMIT` comes from `target_limit`: + +```rust +let term = cipher.query(op::Matches, "ali").on(&users::name).await?; +let fetch = term.target_limit(10, &stats).fetch_or(50); + +let rows: Vec = sqlx::query_as( + "SELECT id, name FROM users WHERE name @@ $1::eql_v4.query_text_match ORDER BY id LIMIT $2", +) +.bind(sqlx::types::Json(&term)) +.bind(fetch as i64) +.fetch_all(&pool).await?; + +let exhausted = (rows.len() as u64) < fetch; +let hits: Vec = cipher.open(rows).using(&users_plan).await? + .into_iter() + .filter(|u| term.verify(&u.name)) + .take(10) + .collect(); +``` + +The `Stats` it used were read once, at startup, by the application: + +```rust +// No row while `users` has never been analysed: the count is unknown. +let rows: Option = sqlx::query_scalar( + "SELECT (c.reltuples * (1 - coalesce(s.null_frac, 0)))::bigint + FROM pg_class c + LEFT JOIN pg_stats s + ON s.schemaname = 'public' AND s.tablename = 'users' AND s.attname = 'name' + WHERE c.oid = 'users'::regclass AND c.reltuples >= 0", +) +.fetch_optional(&pool).await?; +let histogram: Vec<(i32, i64)> = sqlx::query_as( + "SELECT cardinality(eql_v4.match_term(name)) AS bits, count(*) + FROM users TABLESAMPLE SYSTEM (1) WHERE name IS NOT NULL GROUP BY 1", +) +.fetch_all(&pool).await?; +let stats = rows.map(|rows| { + Stats::measured(rows as u64, histogram.into_iter().map(|(b, n)| (b as u32, n as u64))) +}); +``` + +or, before anyone has measured, `Stats::declared(1_000_000)`, which uses the +`expected_tokens` the index declares. + +**`Matches` with another predicate.** Only the probabilistic term is +verified; `age` is exact and the server's answer stands: + +```rust +let name = cipher.query(op::Matches, "ali").on(&users::name).await?; +let age = cipher.query(op::Gt, 30).on(&users::age).await?; + +let rows: Vec = sqlx::query_as( + "SELECT id, name, age FROM users + WHERE name @@ $1::eql_v4.query_text_match AND age > $2::eql_v4.query_integer_ord_ore + ORDER BY id LIMIT $3", +) +.bind(sqlx::types::Json(&name)) +.bind(sqlx::types::Json(&age)) +.bind(name.target_limit(10, &stats).fetch_or(50) as i64) +.fetch_all(&pool).await?; +let hits: Vec = cipher.open(rows).using(&users_plan).await? + .into_iter().filter(|u| name.verify(&u.name)).take(10).collect(); +``` + +**`AtPath`, exact.** The term is a value-selector: the MAC of the path +and the leaf's equality term, as one `query_json` operand; the operator is +containment, `@>`, which a GIN index serves. The row is a match when the +document holds that value at that path, and nothing is verified. + +```rust +let term = cipher.query(op::AtPath(op::Eq), ("$.address.city", "Sydney")).on(&users::profile).await?; + +let rows: Vec = sqlx::query_as( + "SELECT id, profile FROM users WHERE profile @> $1::eql_v3.query_json", +) +.bind(sqlx::types::Json(&term)) +.fetch_all(&pool).await?; +``` + +**`AtPath` on a number, exact.** Ordering at a path takes two parts, a +selector and a leaf term, because the SQL is `col -> selector >= term`. The +accessor term exposes both: + +```rust +let term = cipher.query(op::AtPath(op::Gte), ("$.score", 80)).on(&users::profile).await?; + +let rows: Vec = sqlx::query_as( + "SELECT id, profile FROM users WHERE profile -> $1::text >= $2::eql_v3.query_double_ord", +) +.bind(term.selector()) +.bind(sqlx::types::Json(term.leaf())) +.fetch_all(&pool).await?; +``` + +`AtPath` on a text leaf is exact, as `Lt` on a text column is: the leaf's order term compares order +keys, and there is nothing to verify. + +**`Nearest`, ranked.** Stack Similarity has no EQL spelling yet, so this is +the shape and not a statement that runs. The term is a set of band tokens; +the server returns candidates by token overlap; `score` re-ranks on the +decrypted embedding, which the query must select: + +```rust +let term = cipher.query(op::Nearest, embedding).on(&docs::vector).await?; +let fetch = term.target_limit(10); + +let rows: Vec = sqlx::query_as( + "SELECT id, vector FROM docs WHERE vector ~~ $1 LIMIT $2", // operator not yet defined +) +.bind(sqlx::types::Json(&term)).bind(fetch as i64) +.fetch_all(&pool).await?; + +let mut docs = cipher.open(rows).using(&docs_plan).await?; +docs.sort_by_key(|d| std::cmp::Reverse(term.score(&d.vector))); +docs.truncate(10); +``` + +What the appendix shows, read across: an exact term is one `bind` and +nothing after the query; a probabilistic term is one `bind`, a `LIMIT` from +the term, and a `filter` after decrypt; a ranked term is one `bind`, a +`LIMIT` from the term, and a sort after decrypt. No SQL library has to know +which is which, and the Rust types make it impossible to forget. + +## Appendix B: the model in Go and TypeScript + +ADR-0007 says a binding reaches the engine through a plan lowered from data, +and ADR-0008 says a language SDK is what users of that language touch, which +is never the plan. This appendix asks what each of those gains from the +model above, in two languages: Go, which has a Stack Encrypt SDK today, and +TypeScript, which does not. The TypeScript half is a sketch of a binding and +an SDK built on Stack Encrypt and EQL v4, written to check that the Rust +model will support them well. That SDK will be the next major version of +`@cipherstash/stack`; the current major runs on cipherstash-client through +`@cipherstash/protect-ffi` and writes EQL v3, and nothing below describes +it. It is a check on the model, not a decision; the decisions for the +bindings come with the ADR-0007 amendment. + +### What crosses the binding + +Today the Go guest has one query export: `Cipher.Query(plan, field, value)` +returns the JSON of the field's query operand, and the engine picks the term +by the field's EQL type. The existing TypeScript binding, for comparison, +has `encryptQuery(value, { table, column, queryType })`, where `queryType` +names an index flavour (`equality`, `freeTextSearch`, `orderAndRange`). Both +name an index, which is the problem statement. + +A Stack Encrypt binding for TypeScript would be the guest the Go SDK embeds, +or a napi build of the same crate, and would take the same plan the Go SDK +lowers (ADR-0007). Under this ADR four more things cross it, all as data, +and each is a capability the data grammar does not have yet, added once +(ADR-0007, last bullet of the decision): + +1. **An operator name with its input**, in place of the index: + `{"op": "matches", "input": "ali"}`, `{"op": "between", "input": [18, 65]}`, + `{"op": "at_path", "path": "$.score", "inner": {"op": "gte", "input": 80}}`. + The engine resolves `Answers` for the field's type and refuses an + operator the type does not answer, with the same shape of error a + mistyped field gets today. +2. **The term back**, as the JSON its query domain takes, plus which domain + that is. A `Between` term is one value like any other. +3. **`verify`** as an export: `(term, decrypted value) → bool`, batched as + `(term, [values]) → [bool]` so a page costs one crossing. The value has + already come out of the guest as a decrypt, so sending it back in is no + new exposure. The alternative, a tokenizer in each language, is the + "lives twice" cost ADR-0007 accepts only for an encoder, and a tokenizer + that drifts from the one that stored the filter verifies the wrong thing. +4. **`target_limit`** as an export, `(term, want, stats) → limit`, for the + same reason: the arithmetic is small, but `b` is a property of the term the + engine built, and the fill formula belongs beside the index configuration. + +What does *not* cross is the fidelity as a runtime value. Something on the +language side asks the engine, before the program runs, which operators each +EQL type answers and whether each is exact, probabilistic or ranked, the way +`stashgen` already asks `eql.Types` whether a type is producible. In Go that +something is the generator; in TypeScript it can be the type system, as the +TypeScript section shows. Either way the code a user writes has `verify` +only where there is something to verify, which is the compile-time property +decision 4 wants, reconstructed in a language without traits. + +### Go + +The generated field surface grows from one `Query` to one method per +operator the type answers, with the operator's input in the signature: + +```go +q, err := users.Fields.Email.Eq(ctx, cipher, "bob@example.com") // eql.TextEqQuery +q, err := users.Fields.Age.Lt(ctx, cipher, int32(40)) // eql.IntegerOrdOreQuery +q, err := users.Fields.Age.Between(ctx, cipher, int32(18), int32(65)) // eql.IntegerRangeOreQuery, one value +q, err := users.Fields.Name.Matches(ctx, cipher, "ali") // eql.TextMatchQuery +``` + +A field whose type does not answer an operator has no such method, so the +call does not compile. `eql.TextMatchQuery` carries `Verify(value string) +bool` and `TargetLimit(want uint64, stats eql.Stats) eql.Limit`; +`eql.TextEqQuery` carries neither. Each query type keeps `driver.Valuer`, so +it binds as a parameter in any library built on `database/sql` or pgx: + +```go +q, _ := users.Fields.Name.Matches(ctx, cipher, "ali") +limit := q.TargetLimit(10, stats).FetchOr(50) + +rows, err := db.QueryContext(ctx, + `SELECT id, name FROM users WHERE name @@ $1::eql_v4.query_text_match ORDER BY id LIMIT $2`, + q, limit) +// scan into []users.Encrypted, then +people, err := users.Decrypt(ctx, cipher, encrypted) +hits := people[:0] +for _, p := range people { + if q.Verify(p.Name) { + hits = append(hits, p) + } +} +``` + +The same statement in the libraries Go programs use: + +- **sqlc** keeps the SQL in a `.sql` file with the cast written out, and a + type override maps `eql_v4.query_text_match` to `eql.TextMatchQuery`, so + the generated `ListUsersByName(ctx, q, limit)` takes the term as a typed + argument. +- **pgx** binds it the same way as `database/sql`; `pgx.CollectRows` into + the generated struct, then `Decrypt` and `Verify`. +- **GORM**: `db.Where("name @@ ?::eql_v4.query_text_match", q).Order("id").Limit(limit).Find(&encrypted)`. +- **Bun** and **sqlx** (the Go one): the same `?` placeholder with the cast. + +`Verify` runs in the guest, batched. A page of fifty rows is one call after +the one `Decrypt` call, which is in keeping with the batching the Go SDK +already does for seal and open. The cursor loop is the Rust one with +`WHERE id > $2`, and `TargetLimit` is read once per query. The width rules +hold: `Age.Lt` takes an `int32` because `Integer` does, so a widened `int` +is refused at compile time, as it is at generate time for the field. + +### TypeScript + +Go needs a generator because its type system cannot derive a field's +methods from a declaration. TypeScript can, so the sketch below has no +generate step: the schema is a value, its type is the plan, and the +operators a column answers are read off that type. The function and type +names are illustrative; the package is `@cipherstash/stack` at its next +major, and the shapes are the point. + +**The schema is the plan.** A table is declared with the EQL v4 types, which +is the data grammar of ADR-0007 written as TypeScript, and the match index +carries its `expectedTokens` prior from decision 5: + +```ts +import { table, passthrough, eql } from '@cipherstash/stack' // the next major + +const users = table('users', { + id: passthrough(), + email: eql.TextEq(), + name: eql.TextMatch({ expectedTokens: 20 }), + age: eql.IntegerOrdOre(), + profile: eql.Json(), +}) + +const client = await Encryption.connect() // the Stack Encrypt guest, through napi or wasm +const cipher = client.keyset('tenant-42') +``` + +**An operator is a method on the column, and only the answered ones exist.** +`cipher.query(column)` returns an object whose methods are the operators the +column's EQL type answers, each taking that operator's input: + +```ts +const email = await cipher.query(users.email).eq('bob@example.com') // EqTerm +const age = await cipher.query(users.age).lt(40) // LtTerm +const range = await cipher.query(users.age).between(18, 65) // BetweenTerm, one value +const name = await cipher.query(users.name).matches('ali') // MatchesTerm +const city = await cipher.query(users.profile).atPath('$.address.city').eq('Sydney') + +cipher.query(users.email).matches('bob') // type error: TextEq answers eq and neq +cipher.query(users.age).lt('40') // type error: IntegerOrdOre takes a number +``` + +The type behind it is the `Answers` table of decision 3, as a mapped +type over the column's EQL type: + +```ts +type Query = { + [Op in AnswersOf]: (input: InputOf) => Promise> +} +``` + +and `TermOf` carries the fidelity of decision 4 as the presence of methods, +not as a flag: + +```ts +interface Term

{ readonly domain: string; toJSON(): unknown } // exact: nothing else +interface Probabilistic

extends Term

{ verify(value: P): boolean; targetLimit(want: number, stats: Stats): Limit } +interface Ranked

extends Term

{ score(value: P): number; targetLimit(want: number): number } +``` + +`name.verify('Alice')` type-checks; `email.verify(..)` does not exist. The +engine does the verifying through the binding, batched per page, for the +reason given above; the method on the term is a thin call. `verify` returns +`boolean`, never throws, as decision 4 says. + +**The term binds as a parameter, and the cast is in the SQL.** A term +serialises to the JSON its query domain takes (`toJSON`), so every PostgreSQL +driver binds it unchanged. The statement from decision 6, in the drivers +TypeScript programs use: + +```ts +// pg +const limit = name.targetLimit(10, stats).fetchOr(50) +const { rows } = await pool.query( + 'SELECT id, name FROM users WHERE name @@ $1::eql_v4.query_text_match ORDER BY id LIMIT $2', + [name, limit], +) + +// postgres.js +const rows = await sql` + SELECT id, name FROM users + WHERE name @@ ${name}::eql_v4.query_text_match ORDER BY id LIMIT ${limit}` + +// Kysely +const rows = await db.selectFrom('users').select(['id', 'name']) + .where(sql`name @@ ${name}::eql_v4.query_text_match`) + .orderBy('id').limit(limit).execute() +``` + +Decrypt and verify are the same two steps in each: + +```ts +const people = await cipher.decrypt(users, rows) // typed by the schema: name is a string +const hits = people.filter((p) => name.verify(p.name)).slice(0, 10) +const exhausted = rows.length < limit +``` + +`Between` is one call and one parameter, like every other term: + +```ts +await pool.query( + 'SELECT id, age FROM users WHERE eql_v4.between(age, $1::eql_v4.query_integer_range_ore)', + [range], +) +``` + +**The ORM integrations are the same terms with the SQL written for them.** +A Drizzle integration maps the schema to `customType` columns and gives each +operator a helper that returns the SQL fragment and the term together, so the +application never handles the term itself: + +```ts +const q = await ops.matches(users.name, 'ali') // { sql, verify, targetLimit } +const rows = await db.select().from(users) + .where(q.sql) // name @@ '…'::eql_v4.query_text_match + .orderBy(users.id) + .limit(q.targetLimit(10, stats).fetchOr(50)) +const hits = (await cipher.decrypt(users, rows)).filter((u) => q.verify(u.name)).slice(0, 10) +``` + +`ops.eq` returns `{ sql }` and no `verify`, by the same types. A Prisma +integration spells the operator on the field (`u.name.eqlMatches('ali')`) +and returns the term beside the query the same way. In both, `between` is +one helper that binds one parameter. + +**Stats** come from the two statements of decision 5, run by the +application, or from the declared prior: + +```ts +// ROWS_SQL is decision 5's rows statement: no row while the count is unknown +const [count] = (await pool.query(ROWS_SQL)).rows +const stats = count && Stats.measured( + count.rows, + (await pool.query('SELECT cardinality(eql_v4.match_term(name)) AS bits, count(*) FROM users TABLESAMPLE SYSTEM (1) WHERE name IS NOT NULL GROUP BY 1')).rows, +) +const prior = Stats.declared(1_000_000) // uses users.name's expectedTokens +``` + +**The runtime-schema case.** The `wasm-inline` path today takes a schema +loaded at runtime, with no TypeScript type behind it. There `cipher.query` +cannot narrow, every operator method exists, and the engine's refusal of an +unsupported operator is the check, on the first query rather than at build +time. That is where the Go SDK was before `stashgen`, and the same fix +applies if it matters: a generator that reads the schema and emits the +declaration above. + +### What the two languages say about the model + +Four things survive the translation, and one does not. + +The operator-not-index call survives, and the existing TypeScript SDK +already spells its queries that way (`ops.matches`, `eqlBetween`, +`eqlJsonPathGte`): the Rust API is catching up to its own bindings. + +The split between an exact and a probabilistic term survives as the presence +or absence of `verify`, decided by a generator in Go and by a mapped type in +TypeScript, both fed by the engine's catalog. Neither language needs a +`Fidelity` enum either. + +The one-operand `Between` survives unchanged: one term, one placeholder, in +every driver and every ORM. + +The declared prior survives as one field in the schema (`expectedTokens`), +which is where a TypeScript user would expect to write it. + +What does not translate is the compile error for an unsupported operator +when the schema is only known at runtime. There the engine's refusal is the +check, and nothing about the Rust model makes it fire earlier; only a +generator does. diff --git a/packages/stack-encrypt/docs/adr/0010-what-a-stored-value-authenticates.md b/packages/stack-encrypt/docs/adr/0010-what-a-stored-value-authenticates.md new file mode 100644 index 000000000..b53aed707 --- /dev/null +++ b/packages/stack-encrypt/docs/adr/0010-what-a-stored-value-authenticates.md @@ -0,0 +1,59 @@ +--- +status: accepted +date: 2026-10-18 +extends: vitaminc ADR 0002 +--- + +# What a stored value authenticates + +Automated reviews of Stack Encrypt keep reporting the same properties as +vulnerabilities. They are deliberate. This ADR says what a value Stack +Encrypt stores does and does not authenticate, so a reviewer can check a +finding against it. The sealing itself is vitaminc's, and the underlying +decision is vitaminc's ADR 0002 ("Leaves are authenticated; a container's +membership and order are not"). This applies it to what Stack Encrypt +stores. + +## Decision + +**Authenticated**, for every sealed leaf (`"c"`, and each leaf inside a +nested value): its bytes and type tag, the context it was sealed under +(including any extension parts and a record's context field), its map key +or its role as a sequence element, and the wire version. A leaf that opens +was sealed exactly so, under exactly that context. + +**Not authenticated, by design:** + +- **A container's membership, order and length.** Which entries a stored + map holds, and a stored sequence's order, length and duplicates. A + sequence of records is a set of rows, which a database returns in any + order and in part. A record's fields are a row's columns, which a query + selects in part. +- **A passthrough field.** It is stored in the clear so the record stays + whole, and comes back exactly as the store holds it. Anyone who can write + to the store can change it. The exception is a plan's context field: it + is stored as a passthrough, but every other field was sealed under it, so + a changed context field fails the expected-context check or leaves the + sealed fields unable to open. +- **Which row a leaf belongs to**, unless the context names the row. Two + leaves sealed under the same column context are interchangeable between + rows. A caller who needs a value bound to its row puts the row's identity + (or a tenant) in the context. + +## Consequences + +- **A typed open separates a failed leaf from a refused shape.** A leaf + that does not open (wrong key, wrong context, altered bytes) is + `Error::Aead`. A value whose every leaf opened but whose type or shape the + target refuses, including a container missing a field the target needs, + is a shape mismatch: `Error::OpenedType`, not `Aead`. The Go guest maps + them to `STATUS_AUTH` and `STATUS_ENCODING`. +- **Review findings of these kinds are not defects.** `AGENTS.md` lists + them under "Review guidelines", and `.github/copilot-instructions.md` + repeats them. A finding that a *leaf* is not bound to its context, key, + role, type or version is still a defect. +- **Stricter authentication is opt-in, by type.** A caller who needs a + sequence's positions or a record's field set authenticated will ask for it + by naming a type that carries that rule, the way `serde_bytes` selects a + different encoding by type (vitaminc ADR 0002). It is not a default and + not a flag, and it does not exist yet. diff --git a/packages/stack-encrypt/examples/mixed_user.rs b/packages/stack-encrypt/examples/mixed_user.rs index bb64bd84b..48e3e43ba 100644 --- a/packages/stack-encrypt/examples/mixed_user.rs +++ b/packages/stack-encrypt/examples/mixed_user.rs @@ -9,9 +9,8 @@ //! derivation chain. //! //! Element *positions* are not. Every element of a sequence is sealed under -//! the same derived AAD — deliberately, since that is what lets a single row -//! of a batch decrypt on its own as `Element` — so reordering the elements -//! of a stored sequence still verifies. Order and length are the caller's +//! the same derived AAD, so reordering the elements of a stored sequence +//! still verifies. Order and length are the caller's //! obligation; if they matter, bind them into the AAD yourself or store the //! index alongside the row. //! @@ -19,7 +18,8 @@ //! use them for non-sensitive routing/display data only. //! //! This is the *cipher-directed* layer — vitaminc's `Encrypt` / `Decrypt` -//! driven by hand — one level below `#[derive(EncryptFrom)]`, which the +//! derives, sealed through the keyset directly — one level below +//! `#[derive(EncryptFrom)]`, which the //! `encrypted_record` example uses. Reach for this layer when a value needs //! what the derive does not express: fields stored in the clear beside //! sealed ones, or a single ciphertext whose internal shape (this @@ -37,84 +37,23 @@ //! `CS_WORKSPACE_CRN` and `CS_CLIENT_ID` / `CS_CLIENT_KEY` instead (see the //! `zerokms_auth` example for the lookup order). -use stack_encrypt::{ - Cipher, CipherText, Decipher, Decrypt, Encrypt, IntoAad, Label, StackCipher, StackCipherText, - Unspecified, -}; -use vitaminc_aead::{DecipherVisitor, MapAccess, MapCipher, Passthrough}; +use stack_encrypt::{CipherText, Label, StackCipher, StackCipherText}; +use vitaminc_aead::{Decrypt, Encrypt}; // --- The record type --------------------------------------------------------- -#[derive(Debug, PartialEq)] +// The derives walk the struct as a map keyed by field name. Keys travel in +// the clear; each *encrypted* value is sealed against an AAD derived from the +// map's AAD + its key, so entries cannot be renamed or swapped. Passthrough +// entries carry no such binding. +#[derive(Debug, PartialEq, Encrypt, Decrypt)] struct User { - id: u32, // passthrough: visible in the stored ciphertext - display_name: String, // passthrough - email: String, // encrypted - age: u32, // encrypted -} - -impl Encrypt for User { - fn encrypt_with_aad<'a, C, A>(self, cipher: C, aad: A) -> Result - where - C: Cipher, - A: IntoAad<'a>, - { - // Keys travel in the clear; each *encrypted* value is sealed against - // an AAD derived from the map's AAD + its key, so entries cannot be - // renamed or swapped. Passthrough entries carry no such binding. - cipher - .encrypt_map(aad) - .encrypt_entry("id", Passthrough(self.id))? - .encrypt_entry("display_name", Passthrough(self.display_name))? - .encrypt_entry("email", self.email)? - .encrypt_entry("age", self.age)? - .end() - } -} - -impl<'c> Decrypt<'c> for User { - fn decrypt_with_aad<'a, D, A>(decipher: D, aad: A) -> D::Ok - where - D: Decipher<'c>, - A: IntoAad<'a>, - { - struct UserVisitor; - impl<'c> DecipherVisitor<'c> for UserVisitor { - type Value = User; - - fn visit_map>(self, mut map: M) -> Result { - // Entries arrive in encryption order; each is pulled with its - // expected type and its key is checked. - fn entry<'c, M: MapAccess<'c>, T: Decrypt<'c> + 'c>( - map: &mut M, - key: &str, - ) -> Result { - let (k, value) = map - .next_entry::() - .map_err(|_| Unspecified)? - .ok_or(Unspecified)?; - if k == key { - Ok(value) - } else { - Err(Unspecified) - } - } - - let Passthrough(id) = entry::<_, Passthrough>(&mut map, "id")?; - let Passthrough(display_name) = - entry::<_, Passthrough>(&mut map, "display_name")?; - let email: String = entry(&mut map, "email")?; - let age: u32 = entry(&mut map, "age")?; - Ok(User { - id, - display_name, - email, - age, - }) - } - } - decipher.decrypt_map(UserVisitor, aad) - } + #[aead(passthrough)] + id: u32, // visible in the stored ciphertext + #[aead(passthrough)] + display_name: String, + email: String, // encrypted + age: u32, // encrypted } // --- Inspect what a server would see ----------------------------------------- @@ -131,11 +70,13 @@ fn describe(ciphertext: &StackCipherText, indent: usize) { CipherText::Map(entries) => { for (key, value) in entries { match value { - CipherText::Passthrough(boxed) => { - // Passthrough values are readable without any key. - if let Some(v) = boxed.downcast_ref::() { + CipherText::Passthrough(frame) => { + // Passthrough values are readable without any key: + // the frame of the value, in the clear. + let Ok(frame) = frame.parse() else { continue }; + if let Ok(v) = frame.visit(u32::sink()) { println!("{pad}{key}: {v} (passthrough, in the clear)"); - } else if let Some(v) = boxed.downcast_ref::() { + } else if let Ok(v) = frame.visit(String::sink()) { println!("{pad}{key}: {v:?} (passthrough, in the clear)"); } } diff --git a/packages/stack-encrypt/examples/search_terms.rs b/packages/stack-encrypt/examples/search_terms.rs index 514cca254..e6de54335 100644 --- a/packages/stack-encrypt/examples/search_terms.rs +++ b/packages/stack-encrypt/examples/search_terms.rs @@ -112,10 +112,12 @@ async fn main() -> Result<(), Box> { println!(" age 45 > 40 => {}", age_45 > query_40); // Strings order lexicographically. - let apple: OreTerm<&str> = "apple" + let apple: OreTerm = "apple" + .to_string() .encrypt_into_with_context(&terms, nonempty!("users").with("name")) .await?; - let banana: OreTerm<&str> = "banana" + let banana: OreTerm = "banana" + .to_string() .encrypt_into_with_context(&terms, nonempty!("users").with("name")) .await?; println!(" \"apple\" < \"banana\" => {}", apple < banana); diff --git a/packages/stack-encrypt/fuzz/Cargo.lock b/packages/stack-encrypt/fuzz/Cargo.lock index 3eaca509f..e1111571c 100644 --- a/packages/stack-encrypt/fuzz/Cargo.lock +++ b/packages/stack-encrypt/fuzz/Cargo.lock @@ -301,9 +301,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "chacha20" -version = "0.10.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" +checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" dependencies = [ "cfg-if", "cpufeatures 0.3.0", @@ -347,15 +347,17 @@ dependencies = [ [[package]] name = "cllw-ore" -version = "0.5.0" +version = "0.5.2-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "476f300d37a5029d3d9dd57145d4db50a23f40ae9b4d1374c44543978b906191" +checksum = "24eb4a774d070a6c2b52175b98273cd7193c61e1bda39c1a98b50b7a2d91375a" dependencies = [ "blake3", "hex", "subtle", "thiserror 1.0.69", "unicode-normalization", + "vitaminc-ore", + "vitaminc-protected 0.6.1", "zeroize", ] @@ -499,7 +501,7 @@ dependencies = [ "url", "utoipa", "uuid", - "vitaminc", + "vitaminc 0.5.1", ] [[package]] @@ -1506,6 +1508,15 @@ dependencies = [ "syn 2.0.119", ] +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -1970,8 +1981,8 @@ dependencies = [ "tracing", "url", "uuid", - "vitaminc", - "vitaminc-protected", + "vitaminc 0.6.1", + "vitaminc-protected 0.6.1", "web-time", "zeroize", "zerokms-protocol", @@ -1979,7 +1990,7 @@ dependencies = [ [[package]] name = "stack-encrypt" -version = "0.2.0" +version = "0.3.0" dependencies = [ "base64ct", "cllw-ore", @@ -1990,18 +2001,20 @@ dependencies = [ "stack-kms", "thiserror 1.0.69", "uuid", - "vitaminc-aead", - "vitaminc-aead-value", - "vitaminc-encrypt", + "vitaminc-aead 0.6.1", + "vitaminc-aead-frame", + "vitaminc-encrypt 0.6.1", "vitaminc-hmac", + "vitaminc-normalize", + "vitaminc-ore", "vitaminc-prf", - "vitaminc-protected", + "vitaminc-protected 0.6.1", "zeroize", ] [[package]] name = "stack-encrypt-derive" -version = "0.2.0" +version = "0.3.0" dependencies = [ "proc-macro2", "quote", @@ -2016,7 +2029,8 @@ dependencies = [ "libfuzzer-sys", "stack-encrypt", "uuid", - "vitaminc-protected", + "vitaminc-aead 0.6.1", + "vitaminc-protected 0.6.1", ] [[package]] @@ -2041,8 +2055,8 @@ dependencies = [ "tracing", "url", "uuid", - "vitaminc", - "vitaminc-protected", + "vitaminc 0.6.1", + "vitaminc-protected 0.6.1", "zeroize", "zerokms-protocol", ] @@ -2241,6 +2255,36 @@ dependencies = [ "syn 2.0.119", ] +[[package]] +name = "toml_datetime" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.25.17+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3641d5bbb5349a79e1020a242d251efbc546ad8048d133958323ce9c40a9c9c" +dependencies = [ + "indexmap", + "toml_datetime", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.1.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c" +dependencies = [ + "winnow", +] + [[package]] name = "tracing" version = "0.1.44" @@ -2285,6 +2329,12 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +[[package]] +name = "unicode-general-category" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b993bddc193ae5bd0d623b49ec06ac3e9312875fdae725a975c51db1cc1677f" + [[package]] name = "unicode-ident" version = "1.0.23" @@ -2435,12 +2485,26 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35042fb7a81d72dc43c53fec835e61027f18b4d01cc0f7e12d6c6a6ffbf3bfb9" dependencies = [ - "vitaminc-aead", - "vitaminc-context", - "vitaminc-encrypt", - "vitaminc-protected", - "vitaminc-random", - "vitaminc-traits", + "vitaminc-aead 0.5.1", + "vitaminc-context 0.5.1", + "vitaminc-encrypt 0.5.1", + "vitaminc-protected 0.5.1", + "vitaminc-random 0.5.1", + "vitaminc-traits 0.5.1", +] + +[[package]] +name = "vitaminc" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac5c15b6c25efcb9a6111f7108ab8101947a7bf7e9af3ff6d6a73358a1ace0da" +dependencies = [ + "vitaminc-aead 0.6.1", + "vitaminc-context 0.6.1", + "vitaminc-encrypt 0.6.1", + "vitaminc-protected 0.6.1", + "vitaminc-random 0.6.1", + "vitaminc-traits 0.6.1", ] [[package]] @@ -2451,10 +2515,27 @@ checksum = "62cacd4dae485e98cfe5407e919187a8468dd933ea4234be5115b7d13a30f3c6" dependencies = [ "bytes", "serde", - "vitaminc-aead-derive", - "vitaminc-context", - "vitaminc-protected", - "vitaminc-random", + "vitaminc-aead-derive 0.5.1", + "vitaminc-context 0.5.1", + "vitaminc-protected 0.5.1", + "vitaminc-random 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-aead" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71b8c5c4ced92545dce5fd7cf04581d08210def174cc81475cf227fa2506c5b7" +dependencies = [ + "bytes", + "futures-util", + "serde", + "thiserror 2.0.18", + "vitaminc-aead-derive 0.6.1", + "vitaminc-context 0.6.1", + "vitaminc-protected 0.6.1", + "vitaminc-random 0.6.1", "zeroize", ] @@ -2470,13 +2551,24 @@ dependencies = [ ] [[package]] -name = "vitaminc-aead-value" -version = "0.5.1" +name = "vitaminc-aead-derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c546497a972d0f0498f2f8d5f537c514bad82df8662951c63d0c80023808900" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "vitaminc-aead-frame" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d78cdadbc6374c3bd7c19fb4d99abca693b96953b18fef8c608efbe092cf3ea" +checksum = "e35992a269bcaa5b201f1938e54bfbf167bfa6fe975d83cbdbdb54c2a363c5ef" dependencies = [ - "vitaminc-aead", - "vitaminc-protected", + "serde", + "vitaminc-aead 0.6.1", "zeroize", ] @@ -2487,7 +2579,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7df52501fe33cdb3ee9e155b5242fac184c037d147e58c96e5143ed011252a8" dependencies = [ "mutants", - "vitaminc-protected", + "vitaminc-protected 0.5.1", +] + +[[package]] +name = "vitaminc-context" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4c4bc2bd9811253eb427657565a45bd4826e2379e93ee1c4d00c808a769882" +dependencies = [ + "mutants", + "vitaminc-protected 0.6.1", ] [[package]] @@ -2498,35 +2600,79 @@ checksum = "9fbd0e1748055e381e02033e08af385de879c4dcf32e0f6739ac0c0cf0c6f13d" dependencies = [ "aes-gcm", "aws-lc-rs", - "vitaminc-aead", - "vitaminc-protected", - "vitaminc-random", + "vitaminc-aead 0.5.1", + "vitaminc-protected 0.5.1", + "vitaminc-random 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-encrypt" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0923694602855b33a296d9af473e282e8096c1cfe1b30b8695d3b6651717fc5" +dependencies = [ + "aes-gcm", + "aws-lc-rs", + "vitaminc-aead 0.6.1", + "vitaminc-protected 0.6.1", + "vitaminc-random 0.6.1", "zeroize", ] [[package]] name = "vitaminc-hmac" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15fe558a5e92d4f2b3f811c5b67d863d9255da5f66d08a71d4f0dd3d0011c563" +checksum = "bd361f626e95cbe770b9d012e4a86c43cfefe4aefb3d5b3ed9339a83085bdc53" dependencies = [ "hmac", "sha2 0.11.0", "vitaminc-prf", - "vitaminc-protected", + "vitaminc-protected 0.6.1", "zeroize", ] +[[package]] +name = "vitaminc-normalize" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "214b2a9d085924c3bc3c91f3ba74238e8848bf54990e5f48f170c71fbacea07a" +dependencies = [ + "thiserror 2.0.18", + "unicode-general-category", + "unicode-normalization", + "vitaminc-aead 0.6.1", + "vitaminc-protected 0.6.1", +] + +[[package]] +name = "vitaminc-ore" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed88c54b5f06f2177ecbfb7666812adf645406f6fb555f4e2f0fd7fa218e71c4" +dependencies = [ + "thiserror 2.0.18", + "unicode-general-category", + "unicode-normalization", + "vitaminc-aead 0.6.1", + "vitaminc-context 0.6.1", + "vitaminc-normalize", + "vitaminc-protected 0.6.1", +] + [[package]] name = "vitaminc-prf" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712d31d46d76b38c6b62deb35f516fc5636a35f90f39c0213d0ca9a052b4400b" +checksum = "c2715cca25006b4656223bc932ab4fd7f70d387aa4ec63a4e2ef33aa8cd2b3a5" dependencies = [ "mutants", "thiserror 2.0.18", - "vitaminc-context", - "vitaminc-protected", + "vitaminc-aead 0.6.1", + "vitaminc-context 0.6.1", + "vitaminc-normalize", + "vitaminc-protected 0.6.1", ] [[package]] @@ -2542,7 +2688,24 @@ dependencies = [ "serde_bytes", "subtle", "thiserror 2.0.18", - "vitaminc-protected-derive", + "vitaminc-protected-derive 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-protected" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1bb76dd473f5aa89b844f92018ebe3041deb8e5390e7061cca4283d959ff855" +dependencies = [ + "bitvec", + "digest 0.11.3", + "libc", + "serde", + "serde_bytes", + "subtle", + "thiserror 2.0.18", + "vitaminc-protected-derive 0.6.1", "zeroize", ] @@ -2557,6 +2720,18 @@ dependencies = [ "syn 3.0.3", ] +[[package]] +name = "vitaminc-protected-derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7478ed160c019059746e75fc613563dcdcd5266d155a34601d29377a1c4afc3" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 3.0.3", +] + [[package]] name = "vitaminc-random" version = "0.5.1" @@ -2567,8 +2742,23 @@ dependencies = [ "getrandom 0.4.2", "rand 0.10.1", "thiserror 2.0.18", - "vitaminc-protected", - "vitaminc-random-derives", + "vitaminc-protected 0.5.1", + "vitaminc-random-derives 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-random" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b477af7c01c3d9ef2647e46952ad3df7f246b3f806b1d4009ee83beecec613a" +dependencies = [ + "chacha20", + "getrandom 0.4.2", + "rand 0.10.1", + "thiserror 2.0.18", + "vitaminc-protected 0.6.1", + "vitaminc-random-derives 0.6.1", "zeroize", ] @@ -2583,6 +2773,17 @@ dependencies = [ "syn 3.0.3", ] +[[package]] +name = "vitaminc-random-derives" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5a0de8da428c6789dc067a578a0462e411099721d616736cf29e1622230c35" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + [[package]] name = "vitaminc-traits" version = "0.5.1" @@ -2594,8 +2795,24 @@ dependencies = [ "rmp-serde", "serde", "thiserror 2.0.18", - "vitaminc-protected", - "vitaminc-random", + "vitaminc-protected 0.5.1", + "vitaminc-random 0.5.1", + "zeroize", +] + +[[package]] +name = "vitaminc-traits" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a900f0edcacd49c8557ab54722175869fec66926054a6fbdc53a05069db3c922" +dependencies = [ + "anyhow", + "bytes", + "rmp-serde", + "serde", + "thiserror 2.0.18", + "vitaminc-protected 0.6.1", + "vitaminc-random 0.6.1", "zeroize", ] @@ -2949,6 +3166,15 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" +[[package]] +name = "winnow" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" +dependencies = [ + "memchr", +] + [[package]] name = "wit-bindgen" version = "0.51.0" diff --git a/packages/stack-encrypt/fuzz/Cargo.toml b/packages/stack-encrypt/fuzz/Cargo.toml index 5a3bca512..90a6eaebc 100644 --- a/packages/stack-encrypt/fuzz/Cargo.toml +++ b/packages/stack-encrypt/fuzz/Cargo.toml @@ -15,9 +15,11 @@ edition = "2021" cargo-fuzz = true [dependencies] -# `Protected`, for the check_record model's passthrough-of-bytes node: the +# `Controlled`, to take a passthrough node's frame out of its wrapper: the # same line stack-encrypt builds on. -vitaminc-protected = "0.5.1" +vitaminc-protected = "0.6.1" +# The sinks the record harness writes its plans and passthroughs through. +vitaminc-aead = "0.6.1" libfuzzer-sys = "0.4" # Structure-aware inputs for `check_record` and `plan_build`: the mirror # types derive `Arbitrary`, so the fuzzer mutates trees and plans, not bytes. diff --git a/packages/stack-encrypt/fuzz/fuzz_targets/check_record.rs b/packages/stack-encrypt/fuzz/fuzz_targets/check_record.rs index 39e2a375d..ad9265db0 100644 --- a/packages/stack-encrypt/fuzz/fuzz_targets/check_record.rs +++ b/packages/stack-encrypt/fuzz/fuzz_targets/check_record.rs @@ -33,11 +33,36 @@ use arbitrary::Arbitrary; use libfuzzer_sys::fuzz_target; use stack_encrypt::dynamic::record::{check_record, plan_with, Plan}; use stack_encrypt::dynamic::{ - FfiValue, Output, TargetDescriptor, TargetError, TargetResolver, ValueKind, + Output, TargetDescriptor, TargetError, TargetResolver, ValueFrame, ValueKind, +}; +use stack_encrypt::{ + Encrypt, KeysetCipher, Label, PassthroughFrame, Pending, SealedValue, StackCipher, + StackCipherText, }; -use stack_encrypt::{KeysetCipher, Label, Pending, SealedValue, StackCipher, StackCipherText}; use uuid::Uuid; -use vitaminc_protected::Protected; +use vitaminc_aead::plaintext::{visit_map, Physical, Raw, Sink}; +use vitaminc_protected::Controlled; + +/// A value as a binding sends it: its frame. `None` for a value no frame +/// carries (an object with a key given twice, or one nested too deep), +/// which a binding could not send either. +fn frame(value: T) -> Option { + ValueFrame::of(value).ok() +} + +/// An object of `entries`, in order. +fn object(entries: Vec<(&'static str, ValueFrame)>) -> Option { + frame(Object(entries)) +} + +struct Object(Vec<(&'static str, ValueFrame)>); + +impl Encrypt for Object { + fn visit(self, sink: S) -> Result { + let len = Some(self.0.len()); + visit_map(sink, len, self.0.iter().map(|(key, value)| (*key, value))) + } +} /// The resolver plans parse under: one producible type, `TextEq` over /// strings, and nothing that runs — `check_record` never reaches a cipher. @@ -50,10 +75,10 @@ impl TargetResolver for Fixed { "text", "Eq", Some(ValueKind::String), - "public.eql_v3_text_eq", + "public.eql_v4_text_eq", vec!["eq".to_string()], Some("TextEqQuery".to_string()), - Some("eql_v3.query_text_eq".to_string()), + Some("eql_v4.query_text_eq".to_string()), true, None, )] @@ -63,7 +88,7 @@ impl TargetResolver for Fixed { _: &str, _: &'a KeysetCipher<'_, K>, _: &Label, - _: FfiValue, + _: ValueFrame, ) -> Result, K>, TargetError> { unreachable!("check_record runs no cipher") } @@ -73,7 +98,7 @@ impl TargetResolver for Fixed { _: &'a StackCipher, _: &Label, _: &[u8], - ) -> Result, TargetError> { + ) -> Result, TargetError> { unreachable!("check_record runs no cipher") } fn query<'a, K: 'static>( @@ -81,7 +106,7 @@ impl TargetResolver for Fixed { _: &str, _: &'a KeysetCipher<'_, K>, _: &Label, - _: FfiValue, + _: ValueFrame, ) -> Result, K>, TargetError> { unreachable!("check_record runs no cipher") } @@ -139,19 +164,22 @@ enum Ctx { } impl Ctx { - fn into_value(self) -> FfiValue { - let text = |name: Name| FfiValue::String(name.as_str().into()); + fn into_value(self) -> Option { match self { - Ctx::Label(a, b) => FfiValue::Array(vec![text(a), text(b)]), - Ctx::Extended(a, b, part) => FfiValue::Array(vec![ - FfiValue::Array(vec![text(a), text(b)]), - FfiValue::UInt32(part), - ]), - Ctx::Text(name) => text(name), - Ctx::I64(v) => FfiValue::Int64(v), - Ctx::U32(v) => FfiValue::UInt32(v), - Ctx::List(items) => FfiValue::Array(items.into_iter().map(Ctx::into_value).collect()), - Ctx::Bool(v) => FfiValue::Bool(v), + Ctx::Label(a, b) => frame(vec![a.as_str(), b.as_str()]), + Ctx::Extended(a, b, part) => { + frame(vec![frame(vec![a.as_str(), b.as_str()])?, frame(part)?]) + } + Ctx::Text(name) => frame(name.as_str()), + Ctx::I64(v) => frame(v), + Ctx::U32(v) => frame(v), + Ctx::List(items) => frame( + items + .into_iter() + .map(Ctx::into_value) + .collect::>>()?, + ), + Ctx::Bool(v) => frame(v), } } } @@ -212,27 +240,20 @@ impl Kind { } impl SpecEntry { - fn into_entry(self) -> (String, FfiValue) { - match self { - SpecEntry::Context(ctx) => ("context".to_string(), ctx.into_value()), + fn into_entry(self) -> Option<(&'static str, ValueFrame)> { + Some(match self { + SpecEntry::Context(ctx) => ("context", ctx.into_value()?), SpecEntry::Outputs(names) => ( - "outputs".to_string(), - FfiValue::Array( - names - .into_iter() - .map(|n| FfiValue::String(n.as_str().into())) - .collect(), - ), + "outputs", + frame(names.into_iter().map(Name::as_str).collect::>())?, ), - SpecEntry::Target(name) => { - ("target".to_string(), FfiValue::String(name.as_str().into())) - } - SpecEntry::Type(kind) => ("type".to_string(), FfiValue::String(kind.as_str().into())), - SpecEntry::ContextWrongShape(v) => ("context".to_string(), FfiValue::UInt32(v)), - SpecEntry::OutputsWrongShape(v) => ("outputs".to_string(), FfiValue::UInt32(v)), - SpecEntry::TargetWrongShape(v) => ("target".to_string(), FfiValue::UInt32(v)), - SpecEntry::Unknown(ctx) => ("bogus".to_string(), ctx.into_value()), - } + SpecEntry::Target(name) => ("target", frame(name.as_str())?), + SpecEntry::Type(kind) => ("type", frame(kind.as_str())?), + SpecEntry::ContextWrongShape(v) => ("context", frame(v)?), + SpecEntry::OutputsWrongShape(v) => ("outputs", frame(v)?), + SpecEntry::TargetWrongShape(v) => ("target", frame(v)?), + SpecEntry::Unknown(ctx) => ("bogus", ctx.into_value()?), + }) } } @@ -243,18 +264,19 @@ struct PlanSpec { } impl PlanSpec { - fn into_value(self) -> FfiValue { - FfiValue::Object( - self.fields - .into_iter() - .map(|(name, entries)| { - ( - name.as_str().to_string(), - FfiValue::Object(entries.into_iter().map(SpecEntry::into_entry).collect()), - ) - }) - .collect(), - ) + fn into_value(self) -> Option { + let fields = self + .fields + .into_iter() + .map(|(name, entries)| { + let spec = entries + .into_iter() + .map(SpecEntry::into_entry) + .collect::>>()?; + Some((name.as_str(), object(spec)?)) + }) + .collect::>>()?; + object(fields) } } @@ -264,7 +286,6 @@ impl PlanSpec { #[derive(Arbitrary, Debug)] enum Tree { Single, - None, EmptySequence, EmptyMap, Passthrough, @@ -284,17 +305,20 @@ fn leaf() -> SealedValue { .clone() } +/// A value as a passthrough node: its frame, in the clear. +fn passthrough(value: T) -> StackCipherText { + let frame = frame(value).expect("a scalar frames"); + StackCipherText::Passthrough(PassthroughFrame(frame.into_inner().risky_unwrap())) +} + impl Tree { fn into_ciphertext(self) -> StackCipherText { match self { Tree::Single => StackCipherText::Single(leaf()), - Tree::None => StackCipherText::None(leaf()), Tree::EmptySequence => StackCipherText::EmptySequence(leaf()), Tree::EmptyMap => StackCipherText::EmptyMap(leaf()), - Tree::Passthrough => StackCipherText::Passthrough(Box::new(FfiValue::Null)), - Tree::PassthroughBytes => StackCipherText::Passthrough(Box::new(FfiValue::Bytes( - Protected::new(b"{}".to_vec()), - ))), + Tree::Passthrough => passthrough(Raw(None, Physical::Null)), + Tree::PassthroughBytes => passthrough(b"{}"), Tree::Sequence(items) => { StackCipherText::Sequence(items.into_iter().map(Tree::into_ciphertext).collect()) } @@ -320,7 +344,7 @@ impl Tree { .all(|(at, (name, _))| !entries[..at].iter().any(|(prior, _)| prior == name)); unique && entries.iter().all(|(_, node)| node.is_clean()) } - Tree::Single | Tree::None | Tree::EmptySequence | Tree::EmptyMap => true, + Tree::Single | Tree::EmptySequence | Tree::EmptyMap => true, } } } @@ -397,7 +421,12 @@ fuzz_target!(|case: Case| { let Case { plan: spec, record } = case; // The plan parser is fuzzed for panics only: its rules are a separate // model, and a plan that does not parse has no record to check. - let Ok(plan) = plan_with(spec.into_value(), &Fixed) else { + // The plan crosses as a binding sends it, as frame bytes; a spec the + // frame cannot carry is no plan. + let Some(frame) = spec.into_value() else { + return; + }; + let Ok(plan) = plan_with(frame.risky_ref(), &Fixed) else { if trace { eprintln!("verdict: plan refused"); } diff --git a/packages/stack-encrypt/src/cipher.rs b/packages/stack-encrypt/src/cipher.rs index 46103500c..092dcf737 100644 --- a/packages/stack-encrypt/src/cipher.rs +++ b/packages/stack-encrypt/src/cipher.rs @@ -2,11 +2,13 @@ //! module documents the internals. //! //! `StackCipher` is scoped to one ZeroKMS client; a [`KeysetCipher`] — the -//! cipher bound to one of that client's keysets — is a vitaminc [`Cipher`] -//! whose per-leaf keys are ZeroKMS data keys, minted under that keyset, -//! rather than one fixed key. Structurally it mirrors -//! `vitaminc_encrypt::Aes256Cipher`: encrypting an [`Encrypt`] value produces -//! a recursive ciphertext tree ([`StackCipherText`], the analog of +//! cipher bound to one of that client's keysets — seals values whose +//! per-leaf keys are ZeroKMS data keys, minted under that keyset, rather +//! than one fixed key. The value side is vitaminc's: a value describes +//! itself once ([`Encrypt`]), vitaminc plans it into a tree of pending +//! leaves, each with its tagged plaintext and the AAD its place derives, +//! and a bytes-only [`Cipher`] seals and opens one leaf at a time. The +//! result is a ciphertext tree ([`StackCipherText`], the analog of //! `AesCipherText`) whose leaves ([`SealedValue`]) each carry the ZeroKMS //! metadata for their own data key — the keyset it was minted under //! included, which is why decrypting needs no keyset named and lives on the @@ -14,41 +16,48 @@ //! //! ## Batching the key fetch //! -//! Data-key generation/retrieval is an async ZeroKMS round-trip, so the key -//! fetch cannot happen inside the synchronous [`Cipher`]/[`Decipher`] trait -//! methods. It is front-loaded on both sides; the AES work stays inside the -//! trait drive: +//! Data-key generation/retrieval is an async ZeroKMS round-trip, and each +//! leaf needs its own key, so the keys are fetched for the whole tree +//! before any leaf is sealed or opened. The AES work stays in vitaminc's +//! synchronous walk: //! -//! * **Encrypt** — driving the [`Cipher`] trait over a `&KeysetCipher` builds -//! a *pending* tree ([`PendingStackCipherText`]) that holds plaintext plus -//! each leaf's fully derived AAD, but does no I/O. A single +//! * **Encrypt** — [`PendingStackCipherText::plan`] walks the value into +//! vitaminc's pending tree and does no I/O. A single //! [`PendingStackCipherText::seal`] (or the [`KeysetCipher::encrypt`] //! convenience) then batches **one** `generate_keys` call for the whole -//! tree, under the handle's keyset, and seals every leaf. +//! tree, under the handle's keyset, and seals every leaf through +//! `MintedKeys`, the sealing half of this crate's [`Cipher`], one key per +//! leaf in walk order. //! * **Decrypt** — [`StackCipher::decrypt`] batches **one** `retrieve_keys` -//! call per keyset the leaves were sealed under and zips each key onto its -//! leaf, building a [`StackDecipher`] it does not hand out. The -//! value's [`Decrypt`] impl then drives that decipher exactly as it would -//! `AesDecipher`: each leaf is opened under the AAD the drive supplies, so -//! the visitor pattern (nested `Vec`/`HashMap`/`Option`/`Protected` values, -//! and AAD-deriving wrappers such as `vitaminc_aead::Element`) works -//! identically to `Aes256Cipher`. +//! call per keyset the leaves were sealed under and zips each key onto +//! its leaf. vitaminc's [`decrypt`](vitaminc_aead::decrypt) then opens +//! every leaf through `BoundKeys`, the opening half, and walks the opened +//! tree into the value's [`Decrypt`] sink. +//! +//! Neither half is vitaminc's `AsyncCipher`. Its `seal_many` batches the +//! leaves of one document, but a ZeroKMS request names the descriptor of +//! the context the whole tree is sealed under, which a leaf's derived AAD +//! does not carry, and the target layer merges the key requests of many +//! documents (the fields of a record, the rows of a column) into one call +//! (RFC 0002). So the fetch is the target layer's +//! [`Pending`](crate::target::Pending), and the cipher vitaminc drives is +//! the synchronous one. //! //! ## AAD derivation //! -//! The caller's AAD is refined per node with the same domain-separated -//! derivations `Aes256Cipher` uses, so the container *shape* is authenticated: +//! vitaminc derives each leaf's AAD from the caller's, on both sides, with +//! the same domain-separated derivations every vitaminc cipher gets, so the +//! container *shape* is authenticated: //! //! * sequence elements are sealed under [`Context::for_sequence_element`]; //! * map values under [`Context::for_map_entry`] of their cleartext key (so //! swapping or renaming keys fails decryption); -//! * authenticated-absent markers under [`Context::for_none`], and empty -//! sequences/maps under [`Context::for_empty_sequence`]/[`Context::for_empty_map`] — -//! each sealing an *empty* plaintext, verified as empty on open. +//! * empty sequences/maps under [`Context::for_empty_sequence`] / +//! [`Context::for_empty_map`], each sealing an *empty* plaintext, +//! verified as empty on open. An absent value (`None`) is a null leaf like +//! any other scalar. //! -//! The decrypt side performs the same derivations inside [`StackDecipher`]'s -//! `decrypt_seq`/`decrypt_map`/`decrypt_option` as the caller's `Decrypt` impl -//! drives it, so there is a single source of truth for the per-node AAD. +//! This crate binds its own envelope on top of that, per leaf (below). //! //! ## Leaf crypto and wire format //! @@ -82,9 +91,7 @@ //! concatenation). A compatibility module can be added later to read existing //! records as customers of `cipherstash-client` migrate. -use std::any::Any; -use std::borrow::Cow; -use std::collections::HashSet; +use std::cell::RefCell; use std::num::NonZeroUsize; use std::sync::{Arc, Mutex, PoisonError}; use std::time::Duration; @@ -96,27 +103,26 @@ use stack_kms::{EnvKeyProvider, StackKms, StackKmsBuilder}; #[cfg(all(feature = "http", not(target_arch = "wasm32")))] use stack_kms::{FallbackKeyProvider, KeyProvider, KeyProviderError, ProfileStore}; use uuid::Uuid; +use vitaminc_aead::seal::seal_all; use vitaminc_aead::{ - Cipher, CipherText, Context, Decipher, DecipherVisitor, Decrypt, Encrypt, IntoAad, IntoContext, - LocalCipherText, MapAccess, MapCipher, SeqAccess, SeqCipher, Unspecified, + Cipher, CipherText, Context, DecodeError, Decrypt, DecryptError, Encrypt, IntoAad, IntoContext, + LocalCipherText, Node, Pending, Unspecified, }; -use vitaminc_encrypt::{Aes256Cipher, AesCipherText, Key as AesKey}; -use vitaminc_protected::{Controlled, Protected}; +use vitaminc_encrypt::{Aes256Cipher, Key as AesKey}; +use vitaminc_protected::Protected; use crate::keyset::{KeysetCache, KeysetCipher, KeysetState, Lookup, DEFAULT_NAME_TTL}; use crate::Descriptor; -/// The passthrough payload type: type-erased, as for Rust-native vitaminc -/// ciphers. Callers box on the way in and downcast on the way out. -pub type BoxedPassthrough = Box; - /// The recursive ciphertext container produced by [`StackCipher`]: vitaminc's -/// generic [`CipherText`] tree over [`SealedValue`] leaves. Its shape -/// mirrors the encrypted plaintext: a scalar yields `Single`, a `Vec` yields -/// `Sequence` (or `EmptySequence`), a `HashMap` or struct yields `Map` (or -/// `EmptyMap`). Map keys are stored in the clear but bound into their value's -/// AAD. -pub type StackCipherText = CipherText; +/// ciphertext tree ([`Node`]) over [`SealedValue`] leaves. Its shape +/// mirrors the encrypted plaintext: a scalar, `None` included, yields +/// `Single`, a `Vec` yields `Sequence` (or `EmptySequence`), a `HashMap` or +/// struct yields `Map` (or `EmptyMap`). Map keys are stored in the clear but +/// bound into their value's AAD. A passthrough subtree travels in the clear +/// as a [`PassthroughFrame`](vitaminc_aead::PassthroughFrame): the subtree's +/// frame bytes. +pub type StackCipherText = Node; /// Errors from sealing or opening a [`StackCipherText`]. /// @@ -135,15 +141,38 @@ pub enum Error { #[error(transparent)] #[diagnostic(transparent)] Kms(#[from] stack_kms::Error), - /// AEAD sealing/opening failed, or the ciphertext shape did not match the - /// requested type. On decrypt this is the expected outcome for a wrong key, - /// wrong AAD, or tampered ciphertext. + /// AEAD sealing/opening failed, or the ciphertext tree is malformed. On + /// decrypt this is the expected outcome for a wrong key, wrong AAD, or + /// tampered ciphertext. A ciphertext that opens but holds a value of + /// another type is [`OpenedType`](Self::OpenedType), not this. #[error("AEAD operation failed (wrong key, AAD mismatch, or malformed ciphertext)")] #[diagnostic( code(stack_encrypt::aead), help("Open the value under the context it was sealed with. If the context is right, the ciphertext is damaged or was altered.") )] Aead, + /// A ciphertext opened, so every leaf in it is authentic and unaltered, + /// but it holds a value of another type or shape than the one it was + /// opened as: text opened as an integer, an integer too wide for the + /// target, a map without a field the target needs. The value was sealed + /// as another type or shape, or arrived as part of one, and is not + /// tampered with. + /// + /// A container's membership and order are not authenticated, by design: + /// a stored sequence is a set of rows and a stored map a row's columns, + /// and a database returns rows in any order and a query selects some + /// columns, not all. So a map missing a field, or a sequence of another + /// length, is a shape the target refuses, not a failed authentication. + /// + /// `expected` names what the target reads (a vitaminc kind such as + /// `i32`, or the Rust type). The message never names what the value + /// held, and never a map key. + #[error("the ciphertext opened, but it does not hold a value of the type {expected}")] + #[diagnostic( + code(stack_encrypt::opened_type), + help("Open the value as the type it was sealed as. The ciphertext is authentic: it was sealed as another type, not altered.") + )] + OpenedType { expected: &'static str }, /// ZeroKMS returned a different number of keys than were requested. #[error("expected {expected} data keys from ZeroKMS but received {received}")] #[diagnostic(code(stack_encrypt::key_count_mismatch))] @@ -314,6 +343,7 @@ impl crate::ErrorPayload for Error { ("expected", (*expected).into()), ("received", (*received).into()), ]), + Self::OpenedType { expected } => payload([("expected", (*expected).into())]), Self::DescriptorTooLong { len } => payload([ ("len", (*len).into()), ("limit", Descriptor::MAX_LEN.into()), @@ -816,7 +846,7 @@ impl KeysetCipher<'_, K> { A: IntoContext<'a>, { let context = aad.into_context(); - let pending = value.encrypt_with_aad(self, context.clone().into_aad())?; + let pending = PendingStackCipherText::plan(value, context.clone())?; pending.seal(self, context).await } @@ -825,61 +855,49 @@ impl KeysetCipher<'_, K> { /// is retrieved. pub async fn decrypt<'a, T, A>(&self, ciphertext: StackCipherText, aad: A) -> Result where - T: Decrypt<'static> + 'static, + T: Decrypt, A: IntoContext<'a>, { decrypt_through(self, ciphertext, aad).await } } -/// Retrieve every leaf's data key under `aad`'s descriptor and bind them -/// onto the ciphertext, for either scope. The work is the same on both — -/// one descriptor, one pending, one settle — and the scope is the whole +/// `decrypt`, for either scope: retrieve every leaf's data key under +/// `aad`'s descriptor, bind them onto the ciphertext, and open it into `T` +/// under the same `aad`. The work is the same on both scopes — one +/// descriptor, one pending, one settle — and the scope is the whole /// difference: a [`KeysetCipher`] constrains the leaves to its keyset, a /// [`StackCipher`] constrains nothing. /// -/// Deliberately private. The returned [`StackDecipher`] is driven with an -/// AAD supplied per call, so exposing this would let a caller retrieve keys -/// under one context and authenticate the ciphertext under an unrelated -/// one. Every leaf's AAD is a derivation of the descriptor its key was -/// minted under — `for_sequence_element`, `for_map_entry`, `for_leaf` — -/// and that derivation is the library's to compute, never the caller's to -/// supply. [`decrypt_through`] is the only way in, and it passes one `aad` -/// to both halves. -async fn decipher_through<'s, 'a, K: DataKeySource + 's>( - scope: impl crate::target::CipherScope<'s, K>, - ciphertext: StackCipherText, - aad: impl IntoContext<'a>, -) -> Result { - crate::target::decipher_pending(scope, ciphertext, Descriptor::of(aad)) - .settle() - .await -} - -/// `decrypt`, for either scope: [`decipher_through`], then the value's own -/// [`Decrypt`] drive under the same `aad`. +/// One `aad` goes to both halves, and that is the point: every leaf's AAD +/// is a derivation of the descriptor its key was minted under — +/// `for_sequence_element`, `for_map_entry`, `for_leaf` — and that +/// derivation is the library's to compute, never the caller's to supply. async fn decrypt_through<'s, 'a, T, K: DataKeySource + 's>( scope: impl crate::target::CipherScope<'s, K>, ciphertext: StackCipherText, aad: impl IntoContext<'a>, ) -> Result where - T: Decrypt<'static> + 'static, + T: Decrypt, { let context = aad.into_context(); - let decipher = decipher_through(scope, ciphertext, context.clone()).await?; - T::decrypt_with_aad(decipher, context.into_aad()).map_err(Error::from) + let keyed = crate::target::bind_pending(scope, ciphertext, Descriptor::of(context.clone())) + .settle() + .await?; + open_keyed(keyed, context) } impl StackCipher { /// Decrypt a [`StackCipherText`] into `T`, authenticating against `aad`. /// /// One batched `retrieve_keys` call per keyset the leaves were sealed - /// under, every key under the [`Descriptor`] of `aad`, then `T`'s - /// [`Decrypt`] impl drives the resulting [`StackDecipher`] with the - /// *same* `aad` — exactly as `Aes256Cipher::decrypt_with_aad` drives - /// `AesDecipher`. One context in, and every leaf's AAD derived from it; - /// there is no form of this call that takes two. + /// under, every key under the [`Descriptor`] of `aad`, then vitaminc + /// opens every leaf under the AAD it derives from the *same* `aad` and + /// walks the result into `T`'s [`Decrypt`] sink — exactly as + /// `vitaminc_aead::decrypt` does over an `Aes256Cipher`. One context in, + /// and every leaf's AAD derived from it; there is no form of this call + /// that takes two. /// /// Not keyset-scoped: each leaf carries the id of the keyset it was /// sealed under, and this opens leaves from any keyset the client is @@ -900,7 +918,7 @@ impl StackCipher { /// a foreign leaf before any. pub async fn decrypt<'a, T, A>(&self, ciphertext: StackCipherText, aad: A) -> Result where - T: Decrypt<'static> + 'static, + T: Decrypt, A: IntoContext<'a>, { decrypt_through(self, ciphertext, aad).await @@ -1208,21 +1226,20 @@ impl TryFrom for SealedValue { } /// A leaf with its retrieved data key bound alongside. Produced by -/// [`bind_keys`] once the batched `retrieve_keys` call has returned; consumed by -/// [`StackDecipher`], which opens it under whatever AAD the driving -/// [`Decrypt`] impl supplies. +/// [`bind_keys`] once the batched `retrieve_keys` call has returned; opened +/// by [`BoundKeys`] under the AAD vitaminc's walk derives for its place. pub(crate) struct KeyedLeaf { leaf: SealedValue, key: DataKey, } /// [`StackCipherText`] with a [`DataKey`] zipped onto every keyed leaf. -pub(crate) type KeyedCipherText = CipherText; +pub(crate) type KeyedCipherText = Node; /// Zip retrieved keys onto the tree in the same depth-first order the -/// target layer requested them (`retrieve_requests`), so each leaf carries its -/// own key and the subsequent [`Decipher`] drive is free of ordering -/// assumptions. +/// target layer requested them (`retrieve_requests`), so each leaf carries +/// its own key and opening it makes no assumption about the order vitaminc +/// visits leaves in. pub(crate) fn bind_keys( ciphertext: StackCipherText, keys: &mut impl Iterator, @@ -1237,7 +1254,6 @@ pub(crate) fn bind_keys( match ciphertext { CipherText::Single(leaf) => Ok(CipherText::Single(bind(leaf, keys)?)), - CipherText::None(leaf) => Ok(CipherText::None(bind(leaf, keys)?)), CipherText::EmptySequence(leaf) => Ok(CipherText::EmptySequence(bind(leaf, keys)?)), CipherText::EmptyMap(leaf) => Ok(CipherText::EmptyMap(bind(leaf, keys)?)), CipherText::Sequence(items) => { @@ -1259,59 +1275,53 @@ pub(crate) fn bind_keys( } // ============================================================================= -// Pending tree (`Cipher::Ok`) — built synchronously, sealed asynchronously +// Pending tree — planned synchronously, sealed asynchronously // ============================================================================= -/// The intermediate result of driving the [`Cipher`] trait: a tree that holds -/// plaintext (and the AAD each leaf will be sealed against, fully derived) but -/// has done no ZeroKMS I/O. [`seal`](Self::seal) turns it into a +/// A value planned for sealing: vitaminc's tree of pending leaves, each +/// holding its tagged plaintext and the AAD its place in the value derives, +/// with no ZeroKMS I/O done yet. [`seal`](Self::seal) turns it into a /// [`StackCipherText`]. -pub enum PendingStackCipherText { - /// A scalar awaiting a data key, with its bound (derived) AAD. - Single { - plaintext: Protected>, - aad: Context<'static>, - }, - /// A pending sequence with at least one element. - Sequence(Vec), - /// A pending empty-sequence marker; `aad` is already the - /// [`Context::for_empty_sequence`] derivation. - EmptySequence { aad: Context<'static> }, - /// A pending map with at least one entry. - Map(Vec<(String, PendingStackCipherText)>), - /// A pending empty-map marker; `aad` is already the [`Context::for_empty_map`] - /// derivation. - EmptyMap { aad: Context<'static> }, - /// A pending authenticated-absent marker; `aad` is already the - /// [`Context::for_none`] derivation. - None { aad: Context<'static> }, - /// A passthrough value (needs no key). - Passthrough(BoxedPassthrough), -} +/// +/// [`plan`](Self::plan) walks the value once, through vitaminc's +/// `EncryptSink`, which owns every container rule (element and entry AAD, +/// the empty markers, duplicate keys, a container with nothing sealed in +/// it). This crate decides only where each leaf's key comes from. +pub struct PendingStackCipherText(Node); impl PendingStackCipherText { - /// Number of leaves that need a ZeroKMS data key (everything but - /// passthrough — markers are sealed leaves too). + /// Plan `value` for sealing under `aad`. No key is requested. + /// + /// A value vitaminc refuses to encrypt as given (a map with a repeated + /// key, a container whose every child is a passthrough, a nesting deeper + /// than the transport carries) is [`Error::Aead`], as it is when the + /// value is sealed in one step. + pub fn plan<'a, P: Encrypt>(value: P, aad: impl IntoAad<'a>) -> Result { + vitaminc_aead::plan::<_, Unspecified, _>(value, aad) + .map(Self) + .map_err(|_| Error::Aead) + } + + /// Number of leaves that need a ZeroKMS data key: every leaf, the empty + /// markers included; a passthrough needs none. pub(crate) fn key_count(&self) -> usize { - match self { - PendingStackCipherText::Single { .. } - | PendingStackCipherText::None { .. } - | PendingStackCipherText::EmptySequence { .. } - | PendingStackCipherText::EmptyMap { .. } => 1, - PendingStackCipherText::Sequence(items) => items.iter().map(Self::key_count).sum(), - PendingStackCipherText::Map(entries) => { - entries.iter().map(|(_, v)| v.key_count()).sum() + fn count(node: &Node) -> usize { + match node { + CipherText::Single(_) | CipherText::EmptySequence(_) | CipherText::EmptyMap(_) => 1, + CipherText::Sequence(items) => items.iter().map(count).sum(), + CipherText::Map(entries) => entries.iter().map(|(_, v)| count(v)).sum(), + CipherText::Passthrough(_) => 0, } - PendingStackCipherText::Passthrough(_) => 0, } + count(&self.0) } /// Generate one data key per keyed leaf (one batched ZeroKMS call — none /// for a passthrough-only tree), every key under the [`Descriptor`] of /// `aad`, and seal the whole tree. /// - /// `aad` is the context the tree was built under — the value passed to - /// `encrypt_with_aad`, in the same shape (see the + /// `aad` is the context the tree was planned under — the value passed to + /// [`plan`](Self::plan), in the same shape (see the /// [descriptor docs](crate::descriptor)). The tree itself only carries /// the *derived* per-leaf AADs, so the root is named here; nothing can /// check that the two agree, which is why [`KeysetCipher::encrypt`], which @@ -1334,8 +1344,8 @@ impl PendingStackCipherText { /// /// [`seal`](Self::seal) is this plus an immediate settle — one ZeroKMS /// call per tree. `into_pending` exists for callers that hold *several* - /// independently built trees (each from its own [`Encrypt`] drive, e.g. - /// one per record field in a language binding) and want them merged with + /// independently planned trees (one per record field in a language + /// binding, say) and want them merged with /// [`Pending::zip`](crate::target::Pending::zip) / /// [`Pending::all`](crate::target::Pending::all) so the whole assembly /// seals in **one** batched `generate_keys` call. Same sealing path @@ -1360,56 +1370,18 @@ impl PendingStackCipherText { crate::target::seal_pending(cipher, self, Descriptor::of(aad)) } - /// Recursively seal under `keyset_id`, drawing one key per leaf from - /// `keys` in traversal order. + /// Seal under `keyset_id`, drawing one key per leaf from `keys` in + /// vitaminc's walk order. A leaf with no key left is refused. pub(crate) fn seal_with( self, keyset_id: Uuid, - keys: &mut impl Iterator, + mut keys: impl Iterator, ) -> Result { - // Markers seal an *empty* plaintext so the AEAD tag still binds their - // (already domain-separated) AAD, mirroring `Aes256Cipher`. - fn seal_marker( - aad: Context<'static>, - keyset_id: Uuid, - keys: &mut impl Iterator, - ) -> Result { - let key = keys.next().ok_or(Unspecified)?; - seal_leaf(Protected::new(Vec::new()), &aad, keyset_id, key) - } - - match self { - PendingStackCipherText::Single { plaintext, aad } => { - let key = keys.next().ok_or(Unspecified)?; - Ok(CipherText::Single(seal_leaf( - plaintext, &aad, keyset_id, key, - )?)) - } - PendingStackCipherText::None { aad } => { - Ok(CipherText::None(seal_marker(aad, keyset_id, keys)?)) - } - PendingStackCipherText::EmptySequence { aad } => Ok(CipherText::EmptySequence( - seal_marker(aad, keyset_id, keys)?, - )), - PendingStackCipherText::EmptyMap { aad } => { - Ok(CipherText::EmptyMap(seal_marker(aad, keyset_id, keys)?)) - } - PendingStackCipherText::Sequence(items) => { - let mut out = Vec::with_capacity(items.len()); - for item in items { - out.push(item.seal_with(keyset_id, keys)?); - } - Ok(CipherText::Sequence(out)) - } - PendingStackCipherText::Map(entries) => { - let mut out = Vec::with_capacity(entries.len()); - for (k, v) in entries { - out.push((k, v.seal_with(keyset_id, keys)?)); - } - Ok(CipherText::Map(out)) - } - PendingStackCipherText::Passthrough(value) => Ok(CipherText::Passthrough(value)), - } + let minted = MintedKeys { + keyset_id, + keys: RefCell::new(&mut keys), + }; + seal_all(&minted, self.0).map_err(|_| Unspecified) } } @@ -1466,11 +1438,12 @@ fn leaf_aad(aad: &Context<'_>, keyset_id: Uuid, tag: &[u8]) -> Context<'static> ]) } -/// Seal one plaintext leaf under a freshly generated data key. +/// Seal one leaf's tagged plaintext under a freshly generated data key. /// -/// The AAD is the [`leaf_aad`] derivation of the caller's (derived) AAD, the -/// keyset the key was minted under, and the key `tag` — `tag` is always -/// bound, so the leaf is cryptographically tied to its ZeroKMS data key. +/// The AAD is the [`leaf_aad`] derivation of the AAD vitaminc derived for +/// the leaf's place, the keyset the key was minted under, and the key +/// `tag` — `tag` is always bound, so the leaf is cryptographically tied to +/// its ZeroKMS data key. fn seal_leaf( plaintext: Protected>, aad: &Context<'_>, @@ -1485,571 +1458,110 @@ fn seal_leaf( SealedValue::tag_fits_length_field(&key.tag).map_err(|_| Unspecified)?; let iv = key.key.iv; let cipher = leaf_cipher(&key.key)?; - match (&cipher).encrypt_bytes_vec(plaintext, leaf_aad(aad, keyset_id, &key.tag))? { - AesCipherText::Single(ciphertext) => Ok(SealedValue { - keyset_id, - iv, - tag: key.tag, - ciphertext, - }), - _ => Err(Unspecified), - } + let ciphertext = cipher.seal(plaintext, &leaf_aad(aad, keyset_id, &key.tag))?; + Ok(SealedValue { + keyset_id, + iv, + tag: key.tag, + ciphertext, + }) } -/// Open one keyed leaf under `aad`, returning the plaintext bytes. +/// Open one keyed leaf under `aad`, returning its tagged plaintext. fn open_leaf(keyed: KeyedLeaf, aad: &Context<'_>) -> Result>, Unspecified> { - /// Keeps the recovered bytes inside `Protected` across the visitor - /// boundary (the blanket `Decrypt for Vec` would unwrap them). - struct ProtectedBytes; - impl<'c> DecipherVisitor<'c> for ProtectedBytes { - type Value = Protected>; - fn visit_bytes_vec(self, data: Protected>) -> Result { - Ok(data) - } - } - let KeyedLeaf { leaf, key } = keyed; let cipher = leaf_cipher(&key)?; - cipher - .decipher(AesCipherText::Single(leaf.ciphertext)) - .decrypt_bytes(ProtectedBytes, leaf_aad(aad, leaf.keyset_id, &leaf.tag)) -} - -/// Open one marker leaf (absent / empty-sequence / empty-map) and require the -/// sealed plaintext to be empty. Without the emptiness check, a `Single` leaf -/// could be re-tagged as a marker of the same AAD derivation. -fn verify_empty_marker(keyed: KeyedLeaf, aad: &Context<'_>) -> Result<(), Unspecified> { - let plaintext = open_leaf(keyed, aad)?; - if plaintext.risky_ref().is_empty() { - Ok(()) - } else { - Err(Unspecified) - } + cipher.open(leaf.ciphertext, &leaf_aad(aad, leaf.keyset_id, &leaf.tag)) } // ============================================================================= -// Encrypt side: `Cipher` impl over a `&KeysetCipher` (builds the pending tree) +// The vitaminc ciphers: one leaf at a time, keys already in hand // ============================================================================= -impl<'c, 'k, K> Cipher for &'c KeysetCipher<'k, K> { - type Ok = PendingStackCipherText; - type Error = Unspecified; - type Passthrough = BoxedPassthrough; - type SeqCipher = PendingSeqCipher<'c, 'k, K>; - type MapCipher = PendingMapCipher<'c, 'k, K>; - - fn encrypt_bytes_vec<'a, A>( - self, - data: Protected>, - aad: A, - ) -> Result - where - A: IntoAad<'a>, - { - Ok(PendingStackCipherText::Single { - plaintext: data, - aad: aad.into_aad().into_owned(), - }) - } - - fn encrypt_seq<'a, A>(self, size_hint: Option, aad: A) -> Self::SeqCipher - where - A: IntoAad<'a>, - { - let aad = aad.into_aad().into_owned(); - PendingSeqCipher { - cipher: self, - items: Vec::with_capacity(size_hint.unwrap_or(0)), - // Both derived once here, then borrowed per element. - element_aad: aad.for_sequence_element(), - aad, - encrypted: false, - } - } - - fn encrypt_map<'a, A>(self, aad: A) -> Self::MapCipher - where - A: IntoAad<'a>, - { - PendingMapCipher { - cipher: self, - entries: Vec::new(), - seen_keys: HashSet::new(), - current_key: None, - aad: aad.into_aad().into_owned(), - encrypted: false, - } - } - - fn encrypt_none<'a, A>(self, aad: A) -> Result - where - A: IntoAad<'a>, - { - // Domain-separated so a `Single` leaf sealed under the bare AAD can - // never be re-tagged as an authenticated absence (and vice versa). - Ok(PendingStackCipherText::None { - aad: aad.into_aad().for_none(), - }) - } - - fn passthrough(self, value: Self::Passthrough) -> Result { - Ok(PendingStackCipherText::Passthrough(value)) - } - - fn passthrough_boxed( - self, - value: Box, - ) -> Result { - // This cipher's passthrough type *is* `Box`, so the - // type-erased box is already the passthrough payload. - self.passthrough(value) - } -} - -/// [`SeqCipher`] driver: accumulates a pending sub-tree per element. Holds the -/// cipher only to re-drive nested [`Encrypt`] values (no I/O happens here). -pub struct PendingSeqCipher<'c, 'k, K> { - cipher: &'c KeysetCipher<'k, K>, - items: Vec, - /// The AAD fixed at [`Cipher::encrypt_seq`]; the empty marker is sealed - /// against its `for_empty_sequence` derivation. - aad: Context<'static>, - /// [`Context::for_sequence_element`] of `aad`, derived once and applied to - /// every element. - element_aad: Context<'static>, - /// Whether at least one element went through the authenticated - /// [`encrypt_next`](SeqCipher::encrypt_next) path *and* produced a sealed - /// node — see [`end`](SeqCipher::end). - encrypted: bool, +/// The sealing half of this crate's vitaminc [`Cipher`]: seals each leaf +/// under the next of a batch of data keys ZeroKMS has already generated, +/// in the order vitaminc's [`seal_all`] visits the leaves. +/// +/// The batch is fetched before the walk, in one `generate_keys` call per +/// pending (see [`PendingStackCipherText::seal`]), so the walk itself is +/// synchronous. A leaf for which no key is left is refused. +struct MintedKeys<'k, I> { + keyset_id: Uuid, + keys: RefCell<&'k mut I>, } -impl SeqCipher for PendingSeqCipher<'_, '_, K> { - type Ok = PendingStackCipherText; +impl> Cipher for MintedKeys<'_, I> { + type Leaf = SealedValue; type Error = Unspecified; - type Passthrough = BoxedPassthrough; - - fn encrypt_next(mut self, data: T) -> Result - where - T: Encrypt, - { - // Borrow the stored derived AAD — no allocation per element. - let pending = data.encrypt_with_aad(self.cipher, self.element_aad.clone())?; - // A nested `Encrypt` impl may route through the passthrough channel; - // only a genuinely pending-sealed node may satisfy `end`'s - // all-passthrough rejection. - self.encrypted |= !matches!(pending, PendingStackCipherText::Passthrough(_)); - self.items.push(pending); - Ok(self) - } - fn passthrough_next(mut self, value: Self::Passthrough) -> Result { - self.items.push(PendingStackCipherText::Passthrough(value)); - Ok(self) + fn seal( + &self, + plaintext: Protected>, + aad: &Context<'_>, + ) -> Result { + let key = self.keys.borrow_mut().next().ok_or(Unspecified)?; + seal_leaf(plaintext, aad, self.keyset_id, key) } - fn end(self) -> Result { - if self.items.is_empty() { - Ok(PendingStackCipherText::EmptySequence { - aad: self.aad.for_empty_sequence(), - }) - } else if !self.encrypted { - // Every item is a passthrough: nothing in the container would - // authenticate the AAD, so refuse to produce it — mirroring - // `decrypt_tree`'s rejection on open. - Err(Unspecified) - } else { - Ok(PendingStackCipherText::Sequence(self.items)) - } + /// Opening goes through [`BoundKeys`], whose leaves carry their + /// retrieved keys. A minted key is never used to open. + fn open(&self, _: SealedValue, _: &Context<'_>) -> Result>, Unspecified> { + Err(Unspecified) } } -/// [`MapCipher`] driver: keys are stored in the clear; values become pending -/// sub-trees sealed against [`Context::for_map_entry`] of the map AAD and their -/// key. Mirrors `AesMapCipher`'s key/value and duplicate-key contract checks. -pub struct PendingMapCipher<'c, 'k, K> { - cipher: &'c KeysetCipher<'k, K>, - entries: Vec<(String, PendingStackCipherText)>, - /// Duplicate keys are rejected at encrypt time: `decrypt_tree` rejects - /// them outright, so accepting one here would produce a permanently - /// unreadable ciphertext. - seen_keys: HashSet, - current_key: Option>, - /// The AAD fixed at [`Cipher::encrypt_map`]. - aad: Context<'static>, - /// See [`PendingSeqCipher::encrypted`]. - encrypted: bool, -} +/// The opening half of this crate's vitaminc [`Cipher`]: opens a leaf +/// whose retrieved data key [`bind_keys`] has already bound to it, under +/// the AAD vitaminc's walk derives for the leaf's place. vitaminc then +/// checks the empty markers and the container rules and hands each +/// scalar to the sink, so the decrypt side has one definition of the +/// per-node AAD, shared with every other vitaminc cipher. +pub(crate) struct BoundKeys; -impl MapCipher for PendingMapCipher<'_, '_, K> { - type Ok = PendingStackCipherText; +impl Cipher for BoundKeys { + type Leaf = KeyedLeaf; type Error = Unspecified; - type Passthrough = BoxedPassthrough; - - fn encrypt_key(mut self, key: S) -> Result - where - S: Into>, - { - // A pending key means `encrypt_key` ran twice with no intervening - // `encrypt_value` — fail rather than silently drop the first key. - if self.current_key.is_some() { - return Err(Unspecified); - } - let key = key.into(); - if !self.seen_keys.insert(key.as_ref().to_owned()) { - return Err(Unspecified); - } - self.current_key = Some(key); - Ok(self) - } - - fn encrypt_value(mut self, value: U) -> Result - where - U: Encrypt, - { - let key = self.current_key.take().ok_or(Unspecified)?; - // Seal against PAE(domain, aad, key) — key and value are inseparable. - // `decrypt_tree` derives the same AAD on open. - let entry_aad = self.aad.for_map_entry(&key); - let pending = value.encrypt_with_aad(self.cipher, entry_aad)?; - self.encrypted |= !matches!(pending, PendingStackCipherText::Passthrough(_)); - self.entries.push((key.into_owned(), pending)); - Ok(self) - } - fn passthrough_entry(mut self, key: S, value: Self::Passthrough) -> Result - where - S: Into>, - { - // Adopting a pending key here would silently drop it — same contract - // violation `encrypt_key` rejects. - if self.current_key.is_some() { - return Err(Unspecified); - } - let key = key.into(); - if !self.seen_keys.insert(key.as_ref().to_owned()) { - return Err(Unspecified); - } - self.entries - .push((key.into_owned(), PendingStackCipherText::Passthrough(value))); - Ok(self) + /// Sealing goes through [`MintedKeys`]: a leaf is sealed under a key + /// generated for it, never one retrieved for another leaf. + fn seal(&self, _: Protected>, _: &Context<'_>) -> Result { + Err(Unspecified) } - fn passthrough_entry_boxed( - self, - key: S, - value: Box, - ) -> Result - where - S: Into>, - { - // This cipher's passthrough type *is* `Box`, so the - // type-erased box is already the payload — same as `passthrough_boxed`. - self.passthrough_entry(key, value) - } - - fn end(self) -> Result { - // Finalising with a pending key would silently drop the entry. - if self.current_key.is_some() { - return Err(Unspecified); - } - if self.entries.is_empty() { - Ok(PendingStackCipherText::EmptyMap { - aad: self.aad.for_empty_map(), - }) - } else if !self.encrypted { - // Every entry is a passthrough — see `PendingSeqCipher::end`. - Err(Unspecified) - } else { - Ok(PendingStackCipherText::Map(self.entries)) - } + fn open(&self, leaf: KeyedLeaf, aad: &Context<'_>) -> Result>, Unspecified> { + open_leaf(leaf, aad) } } -// Decrypt side: a synchronous `Decipher` over a key-bound ciphertext tree -// ============================================================================= - -/// A [`Decipher`] over a single [`StackCipherText`] whose leaves already -/// carry their retrieved data keys, built inside -/// [`StackCipher::decrypt`] and driven there by the value's [`Decrypt`] -/// impl under the same context the keys were retrieved with. +/// Open a key-bound tree into `T` under `aad`. A wrong key or AAD, a +/// tampered leaf or marker, and a malformed tree are [`Error::Aead`]. A tree +/// that opens but holds a value that is not a `T` is [`Error::OpenedType`]: +/// every leaf authenticated, so it was sealed as another type, not altered. /// -/// Structurally identical to `vitaminc_encrypt::AesDecipher` — the only -/// difference is where each leaf's key comes from. The AAD is supplied per call -/// by [`Decrypt::decrypt_with_aad`] and refined here exactly as the encrypt side -/// refined it: sequence elements under [`Context::for_sequence_element`], map -/// values under [`Context::for_map_entry`] of their key, markers under their -/// respective derivations with an enforced-empty plaintext. Because the -/// derivation lives in this drive (not in a pre-pass), `Decrypt` impls that -/// transform the AAD themselves (e.g. `vitaminc_aead::Element`) work unchanged. -pub struct StackDecipher { - ciphertext: KeyedCipherText, -} - -impl StackDecipher { - pub(crate) fn over(ciphertext: KeyedCipherText) -> Self { - Self { ciphertext } - } - - /// Typed convenience over [`Decipher::decrypt_passthrough`] for this - /// cipher's [`BoxedPassthrough`] payload type: recovers the payload and - /// downcasts it to `T`, returning [`Unspecified`] if the ciphertext is not - /// a passthrough or the stored type does not match. - pub fn decrypt_passthrough_as(self) -> Result - where - T: Any + Send + 'static, - { - self.decrypt_passthrough()? - .downcast::() - .map(|b| *b) - .map_err(|_| Unspecified) - } +/// Each leaf authenticates on its own, under its context and its place's +/// AAD (a map entry's key). Which entries a map holds and the order of a +/// sequence are deliberately not authenticated: stored values map to rows +/// and columns that a database returns in any order and a query selects in +/// part. A refusal of a container's shape is therefore `OpenedType` like any +/// other, not `Aead`. Authenticating membership may suit other uses later; +/// it is not what this crate does. +pub(crate) fn open_keyed<'a, T: Decrypt>( + keyed: KeyedCipherText, + aad: impl IntoAad<'a>, +) -> Result { + vitaminc_aead::decrypt(&BoundKeys, keyed, aad).map_err(opened_error::) } -impl<'c> Decipher<'c> for StackDecipher { - type Ok - = Result - where - T: Send + 'c; - - type Passthrough = BoxedPassthrough; - - fn map_ok(ok: Self::Ok, f: F) -> Self::Ok - where - T: Send + 'c, - U: Send + 'c, - F: FnOnce(T) -> U, - { - ok.map(f) - } - - fn decrypt_bytes<'a, V, A>(self, visitor: V, aad: A) -> Self::Ok - where - V: DecipherVisitor<'c> + Send + 'c, - A: IntoAad<'a>, - { - match self.ciphertext { - CipherText::Single(keyed) => { - let bytes = open_leaf(keyed, &aad.into_aad())?; - visitor.visit_bytes_vec(bytes) - } - _ => Err(Unspecified), - } - } - - fn decrypt_seq<'a, V, A>(self, visitor: V, aad: A) -> Self::Ok - where - V: DecipherVisitor<'c> + Send + 'c, - A: IntoAad<'a>, - { - match self.ciphertext { - // At least one non-passthrough item required: passthrough items - // authenticate nothing, so an all-passthrough (or entry-less) - // sequence would verify under any AAD. The encrypt side refuses to - // produce one; refuse to open one. Emptiness is only provable by - // the authenticated `EmptySequence` marker. - CipherText::Sequence(items) - if items - .iter() - .any(|i| !matches!(i, CipherText::Passthrough(_))) => - { - visitor.visit_seq(StackSeqAccess { - items: items.into_iter(), - element_aad: aad.into_aad().for_sequence_element(), - }) - } - CipherText::EmptySequence(keyed) => { - let aad = aad.into_aad(); - verify_empty_marker(keyed, &aad.for_empty_sequence())?; - // Store the element derivation exactly as the non-empty arm - // does: never read (the iterator is empty), but a divergent - // value here would silently break a visitor that consulted it. - visitor.visit_seq(StackSeqAccess { - items: Vec::new().into_iter(), - element_aad: aad.for_sequence_element(), - }) - } - _ => Err(Unspecified), - } - } - - fn decrypt_map<'a, V, A>(self, visitor: V, aad: A) -> Self::Ok - where - V: DecipherVisitor<'c> + Send + 'c, - A: IntoAad<'a>, - { - match self.ciphertext { - // At least one non-passthrough entry required — see `decrypt_seq`. - CipherText::Map(entries) - if entries - .iter() - .any(|(_, v)| !matches!(v, CipherText::Passthrough(_))) => - { - // Reject duplicate keys before the visitor sees any entry: two - // ciphertexts of the same logical record seal a given key's - // value against the identical `for_map_entry` AAD, so a stale - // entry appended to a current ciphertext *verifies* — with a - // last-wins visitor that is a single-field rollback. - let mut seen = HashSet::with_capacity(entries.len()); - if !entries.iter().all(|(key, _)| seen.insert(key.as_str())) { - return Err(Unspecified); - } - visitor.visit_map(StackMapAccess { - entries: entries.into_iter(), - aad: aad.into_aad(), - pending: None, - }) - } - CipherText::EmptyMap(keyed) => { - let aad = aad.into_aad(); - verify_empty_marker(keyed, &aad.for_empty_map())?; - // Raw caller AAD, not the marker derivation — see `decrypt_seq`. - visitor.visit_map(StackMapAccess { - entries: Vec::new().into_iter(), - aad, - pending: None, - }) - } - _ => Err(Unspecified), - } - } - - fn decrypt_any<'a, V, A>(self, visitor: V, aad: A) -> Self::Ok - where - V: DecipherVisitor<'c> + Send + 'c, - A: IntoAad<'a>, - { - match self.ciphertext { - ct @ CipherText::Single(_) => Self::over(ct).decrypt_bytes(visitor, aad), - ct @ (CipherText::Sequence(_) | CipherText::EmptySequence(_)) => { - Self::over(ct).decrypt_seq(visitor, aad) - } - ct @ (CipherText::Map(_) | CipherText::EmptyMap(_)) => { - Self::over(ct).decrypt_map(visitor, aad) - } - CipherText::None(keyed) => { - // Verify the domain-separated marker (tag AND empty plaintext) - // before reporting absence — an unauthenticated `visit_none` - // would let an attacker forge "absent" values, and a bare-AAD - // check would let a `Single` leaf be re-tagged as one. Mirrors - // `decrypt_option`. - verify_empty_marker(keyed, &aad.into_aad().for_none())?; - visitor.visit_none() - } - // A self-describing visitor recovers a passthrough via - // `visit_passthrough` (type-erased); visitors that do not override - // it inherit the default rejection. - CipherText::Passthrough(boxed) => visitor.visit_passthrough(boxed), - } - } - - fn decrypt_passthrough(self) -> Self::Ok { - match self.ciphertext { - CipherText::Passthrough(boxed) => Ok(boxed), - _ => Err(Unspecified), - } - } - - fn decrypt_option<'a, T, A>(self, aad: A) -> Self::Ok> - where - T: Decrypt<'c> + 'c, - A: IntoAad<'a>, - { - match self.ciphertext { - CipherText::None(keyed) => { - // Verify the tag over the domain-separated marker AAD AND that - // the sealed plaintext is actually empty. Without both, a - // `Single(leaf)` sealed under the same caller AAD could be - // re-tagged as `None(leaf)` and decrypt as Ok(None) — silent - // authenticated data deletion. - verify_empty_marker(keyed, &aad.into_aad().for_none())?; - Ok(None) - } - // Passthrough must never be decoded as an Option payload. - CipherText::Passthrough(_) => Err(Unspecified), - // Any other variant is the `Some` payload: recurse into `T` with - // the caller's AAD unchanged (there is no depth tag; the shape of - // nested options is decided by `T` at the call site, as in - // `AesDecipher`). - other => T::decrypt_with_aad(Self::over(other), aad).map(Some), - } - } -} - -struct StackSeqAccess { - items: std::vec::IntoIter, - /// [`Context::for_sequence_element`] of the caller's AAD, derived once at - /// construction and re-supplied per element by borrowing. Mirrors - /// `PendingSeqCipher::element_aad` on the encrypt side. - element_aad: Context<'static>, -} - -impl<'c> SeqAccess<'c> for StackSeqAccess { - type Error = Unspecified; - - fn next_element + 'c>(&mut self) -> Result, Self::Error> { - match self.items.next() { - Some(ct) => { - T::decrypt_with_aad(StackDecipher::over(ct), self.element_aad.clone()).map(Some) - } - None => Ok(None), - } - } -} - -struct StackMapAccess<'a> { - entries: std::vec::IntoIter<(String, KeyedCipherText)>, - aad: Context<'a>, - /// The entry handed out by `next_key` and not yet consumed by - /// `next_value` / `next_passthrough`. Held as ciphertext rather than - /// decrypted up front so the caller can choose the plaintext type after - /// seeing the key — see [`MapAccess::next_key`] — alongside the entry - /// AAD it was sealed under, derived once here so the key itself moves - /// out to the caller. - pending: Option<(Context<'static>, KeyedCipherText)>, -} - -impl<'c, 'a> MapAccess<'c> for StackMapAccess<'a> { - type Error = Unspecified; - - fn next_key(&mut self) -> Result, Self::Error> { - // A still-pending entry means the caller skipped a value. Refused - // rather than tolerated: an entry whose value is never opened is an - // entry whose AAD binding is never verified. - if self.pending.is_some() { - return Err(Unspecified); - } - match self.entries.next() { - Some((key, ct)) => { - // Mirror `PendingMapCipher::encrypt_value`: the value was - // sealed against `for_map_entry(key)`, so a swapped or - // renamed key fails when the entry is opened. - self.pending = Some((self.aad.for_map_entry(&key), ct)); - Ok(Some(key)) - } - None => Ok(None), - } - } - - fn next_value + 'c>(&mut self) -> Result { - let (entry_aad, ct) = self.pending.take().ok_or(Unspecified)?; - T::decrypt_with_aad(StackDecipher::over(ct), entry_aad) - } - - fn next_passthrough(&mut self) -> Result, Self::Error> { - match self.pending.take() { - Some((_key, CipherText::Passthrough(value))) => Ok(value), - // A sealed value under a key the caller asked to read as a - // passthrough: refuse rather than hand it back with its tag - // unchecked — but keep the entry pending. The refusal is the - // caller's answer, not a reason to lose the entry: it can still - // open it with `next_value`, and until it does `next_key` keeps - // refusing to move past it. - Some(entry) => { - self.pending = Some(entry); - Err(Unspecified) - } - None => Err(Unspecified), - } +/// What a failed open is to the caller. Only the sink's refusal is told +/// apart, and only by the type it wanted: the `DecodeError` itself can name +/// a map key, which is not repeated. +fn opened_error(error: DecryptError) -> Error { + match error { + DecryptError::Sink(DecodeError::Expected(expected)) => Error::OpenedType { expected }, + DecryptError::Sink(_) => Error::OpenedType { + expected: std::any::type_name::(), + }, + _ => Error::Aead, } } @@ -2057,67 +1569,60 @@ impl<'c, 'a> MapAccess<'c> for StackMapAccess<'a> { mod tests { use super::*; - fn map_access(entries: Vec<(&str, KeyedCipherText)>) -> StackMapAccess<'static> { - StackMapAccess { - entries: entries - .into_iter() - .map(|(key, ct)| (key.to_string(), ct)) - .collect::>() - .into_iter(), - aad: Context::from_encoded(b"map"), - pending: None, - } - } - + /// A failed open is `Aead` unless the leaves authenticated and only the + /// sink refused: then it is `OpenedType`, naming the kind the sink + /// wanted, or the target type when the refusal names no kind (and never + /// the map key a refusal can carry). #[test] - fn a_passthrough_entry_is_read_back_as_the_boxed_value() { - let mut map = map_access(vec![("plain", CipherText::Passthrough(Box::new(7u32)))]); - - assert_eq!(map.next_key(), Ok(Some("plain".to_string()))); - let value = map.next_passthrough().expect("passthrough entry"); - assert_eq!(value.downcast_ref::(), Some(&7)); - assert_eq!(map.next_key(), Ok(None)); - } - - /// Asking for a sealed entry as a passthrough is refused, and the entry - /// stays pending: it is neither handed back unverified nor lost, so the - /// caller can still open it with `next_value` and cannot skip it. - #[test] - fn a_sealed_entry_survives_being_misread_as_a_passthrough() { - let mut map = map_access(vec![ - ("sealed", CipherText::Sequence(vec![])), - ("plain", CipherText::Passthrough(Box::new(7u32))), - ]); - - assert_eq!(map.next_key(), Ok(Some("sealed".to_string()))); - assert!(map.next_passthrough().is_err()); - // Still pending: the map refuses to advance past an unopened entry. - assert_eq!(map.next_key(), Err(Unspecified)); - // And the refusal is repeatable, not a one-shot that then drops it. - assert!(map.next_passthrough().is_err()); - assert_eq!(map.next_key(), Err(Unspecified)); + fn only_a_sink_refusal_is_told_apart_from_aead() { + let opened = |error| opened_error::(error); + assert!(matches!( + opened(DecryptError::Sink(DecodeError::Expected("i32"))), + Error::OpenedType { expected: "i32" } + )); + for refusal in [ + DecodeError::MissingField("age"), + DecodeError::unknown_key("ssn"), + DecodeError::duplicate_key("ssn"), + ] { + assert!(matches!( + opened(DecryptError::Sink(refusal)), + Error::OpenedType { expected: "u32" } + )); + } + for failure in [ + DecryptError::Cipher(Unspecified), + DecryptError::Auth, + DecryptError::Malformed, + ] { + assert!(matches!(opened(failure), Error::Aead)); + } } - /// A draw with nothing pending — before any `next_key`, or after the - /// entry has already been taken — is a clean refusal, never a value and - /// never a panic. This is the guard that keeps an absent or unverified - /// value from being handed back, so a refactor from `ok_or(..)?` to an - /// `unwrap` would regress silently without it. - #[test] - fn drawing_a_value_with_nothing_pending_is_refused() { - let mut map = map_access(vec![("plain", CipherText::Passthrough(Box::new(7u32)))]); - - // No `next_key` yet: nothing is pending. - assert!(map.next_value::().is_err()); - assert!(map.next_passthrough().is_err()); - - // A legitimate draw consumes the entry, so a second draw of either - // kind is refused too. - assert_eq!(map.next_key(), Ok(Some("plain".to_string()))); - assert!(map.next_passthrough().is_ok()); - assert!(map.next_passthrough().is_err()); - assert!(map.next_value::().is_err()); - assert_eq!(map.next_key(), Ok(None)); + /// Through a real open: a leaf of another kind, and a container whose + /// shape the target refuses, are both `OpenedType`. Membership and order + /// are not authenticated, by design (see `open_keyed`), so a container + /// the target cannot read is a shape mismatch, not tampering. + #[tokio::test] + async fn a_leaf_or_a_container_of_another_shape_is_opened_type() { + let cipher = StackCipher::builder() + .kms(stack_kms::FakeDataKeySource::new()) + .init() + .await + .unwrap(); + let keyset = cipher.default_keyset(); + let leaf = keyset.encrypt(7u32, "users/age").await.unwrap(); + let opened: Result = cipher.decrypt(leaf, "users/age").await; + assert!( + matches!(opened, Err(Error::OpenedType { .. })), + "{opened:?}" + ); + let seq = keyset.encrypt(vec![7u32, 8], "users/age").await.unwrap(); + let opened: Result = cipher.decrypt(seq, "users/age").await; + assert!( + matches!(opened, Err(Error::OpenedType { .. })), + "{opened:?}" + ); } /// A cipher's `Debug` — and a keyset handle's — names the keyset and the @@ -2145,27 +1650,26 @@ mod tests { } } - /// `decrypt_passthrough` hands back the payload of a passthrough node and - /// nothing else: any sealed shape is refused rather than surfaced - /// unopened, and a payload of another type is refused by the downcast. + /// Each half of the cipher does one thing: a minted key never opens a + /// leaf, and a key bound to a leaf for opening never seals one. #[test] - fn decrypt_passthrough_opens_only_a_passthrough() { - let passthrough = || StackDecipher::over(CipherText::Passthrough(Box::new(7u32))); - - assert_eq!( - passthrough().decrypt_passthrough_as::(), - Ok(7), - "a passthrough payload of the requested type should be handed back" - ); - assert_eq!( - passthrough().decrypt_passthrough_as::(), - Err(Unspecified), - "a payload of another type should fail the downcast" + fn each_half_of_the_cipher_refuses_the_other_halfs_work() { + let leaf = + SealedValue::from_parts(Uuid::nil(), [0; 16], vec![1; 4], vec![2; 32]).expect("a leaf"); + let mut keys = std::iter::empty::(); + let minted = MintedKeys { + keyset_id: Uuid::nil(), + keys: RefCell::new(&mut keys), + }; + let aad = Context::from_encoded(b"aad"); + assert!(minted.open(leaf, &aad).is_err(), "a minted key never opens"); + assert!( + minted.seal(Protected::new(vec![1]), &aad).is_err(), + "and seals nothing once the batch is spent" ); - assert_eq!( - StackDecipher::over(CipherText::Sequence(vec![])).decrypt_passthrough_as::(), - Err(Unspecified), - "a sealed shape should be refused rather than surfaced unopened" + assert!( + BoundKeys.seal(Protected::new(vec![1]), &aad).is_err(), + "a bound key never seals" ); } diff --git a/packages/stack-encrypt/src/codes.rs b/packages/stack-encrypt/src/codes.rs index d2f752f25..3a03cc178 100644 --- a/packages/stack-encrypt/src/codes.rs +++ b/packages/stack-encrypt/src/codes.rs @@ -48,6 +48,7 @@ mod tests { errors.extend(boxed(variants![ Error::Kms(_) => Error::Kms(crate::kms::Error::Unexpected("kms".into())), Error::Aead => Error::Aead, + Error::OpenedType { .. } => Error::OpenedType { expected: "i32" }, Error::KeyCountMismatch { .. } => Error::KeyCountMismatch { expected: 2, received: 1, @@ -80,6 +81,10 @@ mod tests { TermError::Ore(_) => TermError::Ore(cllw_ore::Error), TermError::InvalidOptions(_) => TermError::InvalidOptions("k out of range"), TermError::EmptyTermText => TermError::EmptyTermText, + TermError::NoEqualityTerm => TermError::NoEqualityTerm, + TermError::Normalize(_) => { + TermError::Normalize(vitaminc_normalize::NormalizeError::UnassignedCodePoint) + }, TermError::Bytes(_) => TermError::Bytes(TermBytesError::OddMatchTermsLength(3)), ])); errors.extend(boxed(variants![ @@ -149,6 +154,10 @@ mod tests { ..MatchOptions::default() }), }, + PlanError::MatchCase { .. } => PlanError::MatchCase { + declared: "CaseInsensitive", + folds: false, + }, PlanError::TwoContextSources { .. } => PlanError::TwoContextSources { first: "the plan", second: "the call", @@ -367,6 +376,10 @@ mod tests { json!({ "left": a.to_string(), "right": b.to_string() }), ), (Box::new(Error::Aead), json!({})), + ( + Box::new(Error::OpenedType { expected: "i32" }), + json!({ "expected": "i32" }), + ), ( Box::new(LeafBytesError::UnknownVersion(9)), json!({ "version": 9 }), @@ -381,6 +394,13 @@ mod tests { json!({ "len": 3 }), ), (Box::new(TermError::EmptyTermText), json!({})), + (Box::new(TermError::NoEqualityTerm), json!({})), + ( + Box::new(TermError::Normalize( + vitaminc_normalize::NormalizeError::UnassignedCodePoint, + )), + json!({}), + ), ( Box::new(TermBytesError::MalformedCllwCiphertext(5)), json!({ "len": 5 }), diff --git a/packages/stack-encrypt/src/dynamic/context.rs b/packages/stack-encrypt/src/dynamic/context.rs index 49c983222..3b2d1493b 100644 --- a/packages/stack-encrypt/src/dynamic/context.rs +++ b/packages/stack-encrypt/src/dynamic/context.rs @@ -1,18 +1,19 @@ -//! An [`FfiValue`] read as an encryption context. See [`context`](context()). +//! A context read from a binding's frame. See [`context`](context()). use std::borrow::Cow; +use std::fmt; -use vitaminc_aead_value::FfiValue; -use vitaminc_protected::Controlled; +use serde::de::{self, Deserializer, SeqAccess, Unexpected, Visitor}; +use serde::Deserialize; use super::{Error, Reason}; use crate::{ContextPiece, NonEmpty}; -/// A context arrives from a binding as a value and becomes a [`ContextPiece`] -/// tree: vitaminc's runtime form of a context, and the *identity* of one. -/// vitaminc's law (pinned there by quickcheck over every built-in context -/// type) is that a context's two derivations each equal the same derivation -/// of its parts view: +/// A context arrives from a binding as a frame and becomes a +/// [`ContextPiece`] tree: vitaminc's runtime form of a context, and the +/// *identity* of one. vitaminc's law (pinned there by quickcheck over every +/// built-in context type) is that a context's two derivations each equal the +/// same derivation of its parts view: /// /// ```text /// x.into_aad() == x.into_context().into_aad() @@ -35,13 +36,15 @@ use crate::{ContextPiece, NonEmpty}; /// ``` /// /// A bare string is one text part. An array is a list, and may nest as deep -/// as the transport codec allows -/// ([`MAX_DEPTH`](vitaminc_aead_value::transport::MAX_DEPTH) levels, counted -/// from the root of the encoded value); a deeper value is refused by the -/// codec before this module sees it. Text and bytes with the same content -/// are distinct contexts (UTF-8 versus bytes typed leaves) — the same -/// distinction the Rust types make. Booleans, floats, null, undefined, -/// objects and passthroughs are not contexts. +/// as the transport frame allows +/// ([`MAX_DEPTH`](vitaminc_aead::frame::MAX_DEPTH) levels, counted +/// from the root of the frame); a deeper frame is refused before it is +/// read. Text and bytes with the same content are distinct contexts (UTF-8 +/// versus bytes typed leaves) — the same distinction the Rust types make. +/// An integer's width is part of its identity, so it is read at the width +/// the frame carries, and only the four widths above are contexts. +/// Booleans, floats, null, objects, other integer widths, a scalar with a +/// logical type and passthroughs are not contexts. /// /// # Which Rust contexts a list spells /// @@ -70,67 +73,125 @@ use crate::{ContextPiece, NonEmpty}; /// context: /// /// ``` -/// use stack_encrypt::dynamic::{context, FfiValue}; +/// use stack_encrypt::dynamic::context; /// use stack_encrypt::{nonempty, IntoAad}; /// -/// let parsed = context(FfiValue::Array(vec![ -/// FfiValue::Array(vec![ -/// FfiValue::String("users".into()), -/// FfiValue::String("age".into()), -/// ]), -/// FfiValue::UInt64(7), -/// ]))?; +/// // `[["users", "age"], 7u64]`, as a binding writes it. +/// let frame = vitaminc_aead_frame::serde::to_vec(&(("users", "age"), 7u64))?; +/// let parsed = context(&frame)?; /// let typed = nonempty!("users").with("age").with(7u64); /// assert_eq!( /// parsed.into_inner().into_aad().as_bytes(), /// typed.into_aad().as_bytes() /// ); -/// # Ok::<(), stack_encrypt::dynamic::Error>(()) +/// # Ok::<(), Box>(()) /// ``` /// /// # Errors /// /// [`Error::Context`] for anything outside the shape above -/// ([`Reason::ContextKind`], [`Reason::ContextNotUtf8`]), and for a context -/// that renders empty ([`Reason::EmptyContext`]). It names no field: the -/// caller that knows the field names it ([`Error::in_field`]). -pub fn context(value: FfiValue) -> Result>, Error> { - NonEmpty::new(piece_of(value)?).map_err(|_| Error::bad_context(Reason::EmptyContext)) +/// ([`Reason::ContextKind`]), including bytes that are not one frame, and +/// for a context that renders empty ([`Reason::EmptyContext`]). It names no +/// field: the caller that knows the field names it ([`Error::in_field`]). +pub fn context(frame: &[u8]) -> Result>, Error> { + let Context(piece) = vitaminc_aead_frame::serde::from_slice(frame) + .map_err(|_| Error::bad_context(Reason::ContextKind))?; + non_empty(piece) } -fn piece_of(value: FfiValue) -> Result, Error> { - Ok(match value { - // Valid UTF-8 by `Utf8String`'s construction invariant; checked - // rather than assumed because this is boundary code. The payload - // moves out of its `Protected` rather than being copied: a context - // is not secret, and the copy would only be wiped and freed. - FfiValue::String(s) => ContextPiece::Text(Cow::Owned( - String::from_utf8(s.into_inner().risky_unwrap()) - .map_err(|_| Error::bad_context(Reason::ContextNotUtf8))?, - )), - FfiValue::Bytes(bytes) => ContextPiece::Bytes(Cow::Owned(bytes.risky_unwrap())), - FfiValue::Int32(v) => ContextPiece::I32(v), - FfiValue::Int64(v) => ContextPiece::I64(v), - FfiValue::UInt32(v) => ContextPiece::U32(v), - FfiValue::UInt64(v) => ContextPiece::U64(v), - // Nesting depth is bounded by the codec's `MAX_DEPTH` before the - // value reaches here. - FfiValue::Array(items) => ContextPiece::List( - items - .into_iter() - .map(piece_of) - .collect::, Error>>()?, - ), - FfiValue::Null - | FfiValue::Undefined - | FfiValue::Bool(_) - | FfiValue::Float32(_) - | FfiValue::Float64(_) - | FfiValue::Object(_) - | FfiValue::Passthrough(_) => return Err(Error::bad_context(Reason::ContextKind)), - }) +/// A context tree, proven non-empty by vitaminc's rule. +pub(super) fn non_empty( + piece: ContextPiece<'static>, +) -> Result>, Error> { + NonEmpty::new(piece).map_err(|_| Error::bad_context(Reason::EmptyContext)) } +/// One context as serde reads it from a frame (see [`context`](context())). +/// A visitor rather than a derive: an untagged enum would buffer the value +/// through serde's own content type, which lets a text variant take bytes, +/// and would read an integer at whichever variant's width it fits first. +pub(super) struct Context(pub(super) ContextPiece<'static>); + +impl<'de> Deserialize<'de> for Context { + fn deserialize>(d: D) -> Result { + d.deserialize_any(ContextVisitor).map(Context) + } +} + +struct ContextVisitor; + +impl<'de> Visitor<'de> for ContextVisitor { + type Value = ContextPiece<'static>; + + fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str("a context: a string, bytes, an i32, i64, u32 or u64, or a list of contexts") + } + + fn visit_str(self, text: &str) -> Result { + Ok(ContextPiece::Text(Cow::Owned(text.to_owned()))) + } + + fn visit_bytes(self, bytes: &[u8]) -> Result { + Ok(ContextPiece::Bytes(Cow::Owned(bytes.to_vec()))) + } + + fn visit_i32(self, v: i32) -> Result { + Ok(ContextPiece::I32(v)) + } + + fn visit_i64(self, v: i64) -> Result { + Ok(ContextPiece::I64(v)) + } + + fn visit_u32(self, v: u32) -> Result { + Ok(ContextPiece::U32(v)) + } + + fn visit_u64(self, v: u64) -> Result { + Ok(ContextPiece::U64(v)) + } + + // serde forwards the narrow widths to the 64-bit methods by default, + // which would read a `u8` as a `u64` context: a different identity. + fn visit_i8(self, v: i8) -> Result { + Err(E::invalid_type(Unexpected::Signed(v.into()), &self)) + } + + fn visit_i16(self, v: i16) -> Result { + Err(E::invalid_type(Unexpected::Signed(v.into()), &self)) + } + + fn visit_u8(self, v: u8) -> Result { + Err(E::invalid_type(Unexpected::Unsigned(v.into()), &self)) + } + + fn visit_u16(self, v: u16) -> Result { + Err(E::invalid_type(Unexpected::Unsigned(v.into()), &self)) + } + + fn visit_seq>(self, mut seq: A) -> Result { + let mut parts = Vec::with_capacity(reserved(seq.size_hint())); + while let Some(Context(part)) = seq.next_element()? { + parts.push(part); + } + Ok(ContextPiece::List(parts)) + } +} + +/// How many elements to reserve room for before reading a list or an +/// object a control frame declares `hint` of. The hint is the count the frame +/// declares, which nothing has checked against the bytes that follow: a few +/// bytes can declare four billion elements, which would abort the guest on +/// allocation. So at most [`RESERVED`] are reserved, and a longer list grows as +/// it is read. +pub(super) fn reserved(hint: Option) -> usize { + hint.unwrap_or(0).min(RESERVED) +} + +/// The most elements [`reserved`] reserves room for: more than a context or +/// a plan holds in practice. +const RESERVED: usize = 64; + /// A view of a context tree that borrows its text and bytes, so a context /// parsed and proven once can be handed to every output of every row without /// copying the payloads. Integers are copied (they are the payload); the @@ -163,11 +224,18 @@ pub fn borrowed<'b>(piece: &'b ContextPiece<'_>) -> ContextPiece<'b> { #[cfg(test)] mod tests { use super::*; + use crate::dynamic::test_frame::frame_of; + use crate::dynamic::test_frame::Tree; use crate::{nonempty, Descriptor, IntoAad, IntoPrfContext}; - use vitaminc_protected::Protected; + use vitaminc_aead_frame::serde::to_vec; - fn s(value: &str) -> FfiValue { - FfiValue::String(value.into()) + fn s(value: &str) -> Tree { + Tree::String(value.into()) + } + + /// The context `value` spells, read from its frame. + fn ctx(value: Tree) -> Result>, Error> { + context(&frame_of(&value)) } /// `borrowed` is a view, so it must be the same context for every @@ -217,7 +285,7 @@ mod tests { #[test] fn a_bare_string_is_the_flat_context() { - let parsed = context(s("users/age")).expect("flat context"); + let parsed = ctx(s("users/age")).expect("flat context"); assert_eq!( parsed.get(), &ContextPiece::Text(Cow::Borrowed("users/age")), @@ -232,8 +300,8 @@ mod tests { #[test] fn a_list_encodes_as_the_tuple_on_both_sides() { - let parsed = context(FfiValue::Array(vec![s("users/age"), FfiValue::UInt64(7)])) - .expect("extended context"); + let parsed = + ctx(Tree::Array(vec![s("users/age"), Tree::UInt64(7)])).expect("extended context"); let tuple = nonempty!("users/age").with(7u64); assert_eq!( parsed.clone().into_inner().into_aad().as_bytes(), @@ -249,7 +317,7 @@ mod tests { #[test] fn a_list_renders_the_descriptor_the_tuple_does() { - let parsed = context(FfiValue::Array(vec![s("users"), s("age")])).expect("a pair"); + let parsed = ctx(Tree::Array(vec![s("users"), s("age")])).expect("a pair"); assert_eq!( Descriptor::of(parsed.into_inner()).as_str(), "users/age", @@ -260,9 +328,9 @@ mod tests { "users/age", "the tuple renders the same descriptor" ); - let parsed = context(FfiValue::Array(vec![ - FfiValue::Array(vec![s("users"), s("age")]), - FfiValue::UInt64(7), + let parsed = ctx(Tree::Array(vec![ + Tree::Array(vec![s("users"), s("age")]), + Tree::UInt64(7), ])) .expect("an extended pair"); assert_eq!( @@ -278,9 +346,9 @@ mod tests { #[test] fn a_nested_list_encodes_as_the_nested_tuple() { - let parsed = context(FfiValue::Array(vec![ + let parsed = ctx(Tree::Array(vec![ s("users/age"), - FfiValue::Array(vec![s("t"), FfiValue::Int32(-3)]), + Tree::Array(vec![s("t"), Tree::Int32(-3)]), ])) .expect("nested context"); let tuple = ("users/age", ("t", -3i32)); @@ -299,12 +367,9 @@ mod tests { /// The borrowed view is the same context as the owned tree. #[test] fn the_borrowed_view_encodes_as_the_owned_tree() { - let parsed = context(FfiValue::Array(vec![ + let parsed = ctx(Tree::Array(vec![ s("users/age"), - FfiValue::Array(vec![ - FfiValue::Bytes(Protected::new(b"k".to_vec())), - FfiValue::Int64(-1), - ]), + Tree::Array(vec![Tree::Bytes(b"k".to_vec()), Tree::Int64(-1)]), ])) .expect("context"); let owned = parsed.clone().into_inner(); @@ -328,13 +393,13 @@ mod tests { #[test] fn a_left_nested_list_is_the_with_chain() { let chain = nonempty!("a").with(7u64).with("eu"); - let nested = context(FfiValue::Array(vec![ - FfiValue::Array(vec![s("a"), FfiValue::UInt64(7)]), + let nested = ctx(Tree::Array(vec![ + Tree::Array(vec![s("a"), Tree::UInt64(7)]), s("eu"), ])) .expect("nested") .into_inner(); - let flat = context(FfiValue::Array(vec![s("a"), FfiValue::UInt64(7), s("eu")])) + let flat = ctx(Tree::Array(vec![s("a"), Tree::UInt64(7), s("eu")])) .expect("flat") .into_inner(); assert_eq!( @@ -363,7 +428,7 @@ mod tests { /// (vitaminc 0.4.0 made the `Option` PRF context follow its parts view). #[test] fn a_one_element_list_is_some() { - let list = context(FfiValue::Array(vec![FfiValue::UInt64(7)])) + let list = ctx(Tree::Array(vec![Tree::UInt64(7)])) .expect("list") .into_inner(); let some = Some(7u64); @@ -386,8 +451,8 @@ mod tests { #[test] fn a_one_element_list_is_not_the_bare_part() { - let list = context(FfiValue::Array(vec![s("a")])).expect("list"); - let bare = context(s("a")).expect("bare"); + let list = ctx(Tree::Array(vec![s("a")])).expect("list"); + let bare = ctx(s("a")).expect("bare"); assert_ne!( list.clone().into_inner().into_aad().as_bytes(), bare.clone().into_inner().into_aad().as_bytes(), @@ -404,8 +469,8 @@ mod tests { /// on both sides (vitaminc 0.5; before it they shared AAD bytes). #[test] fn text_and_bytes_are_distinct_contexts_on_both_sides() { - let text = context(s("ab")).expect("text").into_inner(); - let bytes = context(FfiValue::Bytes(Protected::new(b"ab".to_vec()))) + let text = ctx(s("ab")).expect("text").into_inner(); + let bytes = ctx(Tree::Bytes(b"ab".to_vec())) .expect("bytes") .into_inner(); assert_ne!( @@ -424,32 +489,32 @@ mod tests { fn emptiness_follows_the_tuple_rule() { for (label, empty) in [ ("an empty string", s("")), - ("empty bytes", FfiValue::Bytes(Protected::new(Vec::new()))), - ("an empty list", FfiValue::Array(vec![])), - ("a list of one empty string", FfiValue::Array(vec![s("")])), + ("empty bytes", Tree::Bytes(Vec::new())), + ("an empty list", Tree::Array(vec![])), + ("a list of one empty string", Tree::Array(vec![s("")])), ( "a list of empties", - FfiValue::Array(vec![FfiValue::Array(vec![]), s("")]), + Tree::Array(vec![Tree::Array(vec![]), s("")]), ), ] { assert!( - matches!(context(empty), Err(Error::Context { .. })), + matches!(ctx(empty), Err(Error::Context { .. })), "{label} is empty by the tuple rule and must be refused" ); } for (label, non_empty) in [ - ("a zero integer", FfiValue::UInt64(0)), + ("a zero integer", Tree::UInt64(0)), ( "an empty string beside an integer", - FfiValue::Array(vec![s(""), FfiValue::Int32(0)]), + Tree::Array(vec![s(""), Tree::Int32(0)]), ), ( "a nested non-empty list", - FfiValue::Array(vec![FfiValue::Array(vec![s("x")])]), + Tree::Array(vec![Tree::Array(vec![s("x")])]), ), ] { assert!( - context(non_empty).is_ok(), + ctx(non_empty).is_ok(), "{label} carries bytes and must be accepted" ); } @@ -458,24 +523,93 @@ mod tests { #[test] fn non_context_values_are_encoding_errors() { for (label, bad) in [ - ("null", FfiValue::Null), - ("undefined", FfiValue::Undefined), - ("a boolean", FfiValue::Bool(true)), - ("a float32", FfiValue::Float32(1.0)), - ("a float64", FfiValue::Float64(1.0)), - ( - "an object", - FfiValue::Object(vec![("k".to_string(), s("v"))]), - ), + ("null", Tree::Null), + ("undefined", Tree::Undefined), + ("a boolean", Tree::Bool(true)), + ("a float32", Tree::Float32(1.0)), + ("a float64", Tree::Float64(1.0)), + ("an object", Tree::Object(vec![("k".to_string(), s("v"))])), ( "a list with a boolean in it", - FfiValue::Array(vec![s("ok"), FfiValue::Bool(false)]), + Tree::Array(vec![s("ok"), Tree::Bool(false)]), ), ] { assert!( - matches!(context(bad), Err(Error::Context { .. })), + matches!(ctx(bad), Err(Error::Context { .. })), "{label} is not a context and must be refused" ); } } + + /// An integer's width is its identity, so only the four widths a + /// context takes are read, each at its own width; the others are + /// refused rather than widened. + #[test] + fn an_integer_is_read_at_its_own_width() { + let read = |frame: Vec| context(&frame).map(NonEmpty::into_inner); + assert_eq!(read(to_vec(&7i32).unwrap()).unwrap(), ContextPiece::I32(7)); + assert_eq!(read(to_vec(&7i64).unwrap()).unwrap(), ContextPiece::I64(7)); + assert_eq!(read(to_vec(&7u32).unwrap()).unwrap(), ContextPiece::U32(7)); + assert_eq!(read(to_vec(&7u64).unwrap()).unwrap(), ContextPiece::U64(7)); + for (label, frame) in [ + ("an i8", to_vec(&7i8).unwrap()), + ("an i16", to_vec(&7i16).unwrap()), + ("a u8", to_vec(&7u8).unwrap()), + ("a u16", to_vec(&7u16).unwrap()), + ("an i128", to_vec(&7i128).unwrap()), + ("a u128", to_vec(&7u128).unwrap()), + ("a u8 in a list", to_vec(&("users", 7u8)).unwrap()), + ] { + assert!( + matches!( + read(frame), + Err(Error::Context { + reason: Reason::ContextKind, + .. + }) + ), + "{label} is not a context" + ); + } + } + + /// What a frame declares is reserved only up to a bound, whatever it + /// declares. + #[test] + fn a_declared_count_reserves_at_most_the_bound() { + assert_eq!(reserved(None), 0); + assert_eq!(reserved(Some(3)), 3); + assert_eq!(reserved(Some(RESERVED)), RESERVED); + assert_eq!(reserved(Some(u32::MAX as usize)), RESERVED); + } + + /// A list that declares more parts than its frame holds is refused + /// when the parts run out, without reserving room for the count it + /// declared: four billion parts would abort the guest on allocation. + #[test] + fn a_list_that_declares_more_parts_than_it_holds_is_refused() { + let mut bytes = vec![vitaminc_aead::frame::ARRAY]; + bytes.extend_from_slice(&u32::MAX.to_le_bytes()); + assert!(matches!( + context(&bytes), + Err(Error::Context { + reason: Reason::ContextKind, + .. + }) + )); + } + + /// Bytes that are not one frame are not a context. + #[test] + fn bytes_that_are_not_a_frame_are_refused() { + for bytes in [&[][..], &[0xff, 1, 2], &to_vec(&"a").unwrap()[..2]] { + assert!(matches!( + context(bytes), + Err(Error::Context { + reason: Reason::ContextKind, + .. + }) + )); + } + } } diff --git a/packages/stack-encrypt/src/dynamic/kind.rs b/packages/stack-encrypt/src/dynamic/kind.rs index 1b49d3856..d127f98b0 100644 --- a/packages/stack-encrypt/src/dynamic/kind.rs +++ b/packages/stack-encrypt/src/dynamic/kind.rs @@ -6,16 +6,14 @@ //! JavaScript number is a float, and match is defined over text alone. So a //! plan field may say what its values are, in its `"type"` key. //! -//! The vocabulary is vitaminc's, not this crate's: a declared type is a -//! [`ValueKind`] (`vitaminc_aead_value::ValueKind`, re-exported here), whose +//! The vocabulary is [`ValueKind`], whose //! [`name`](ValueKind::name)s (`"uint64"`, `"string"`, …, `"array"`, -//! `"object"`) are frozen wire format beside vitaminc's tag table, and whose -//! [`holds`](ValueKind::holds) and [`FfiValue::kind`] say whether a value is -//! of a kind. What vitaminc deliberately leaves to the declaring layer is the -//! two rules this module adds: +//! `"object"`) are frozen wire format; [`ValueFrame::kind`] says which kind +//! a value is. Beside it, this module adds two rules: //! //! - [`admits`]: which indexes a kind is defined for, so a plan asking for -//! match on an integer or equality on a float is refused when it is built; +//! match on an integer or equality on a boolean is refused when it is +//! built; //! - [`read`]: how a query value is read as a field's kind, converting a //! number only when the conversion is exact. //! @@ -37,35 +35,118 @@ //! field has none is refused when it is built //! ([`Error::UntypedIndex`], naming the field). A field that only seals, or //! only carries its value through, may leave it out: no term derives from it. -use vitaminc_aead_value::{FfiValue, ValueKind}; +use std::fmt; +use std::str::FromStr; + +use vitaminc_aead::plaintext::{Float, Int, Logical, Physical, Raw, TimeUnit}; +use vitaminc_aead::Encrypt; + +use super::term::OneScalar; +use super::ValueFrame; use super::{Error, Reason}; use crate::target::IndexSpec; /// Whether the scheme defines an `index` term for values of `kind`. /// -/// The same table as [`IndexSpec::supports`], stated over kinds instead of -/// values, so a plan can be refused when it is built rather than when its -/// first value arrives: equality over every integer, text and bytes (no -/// floats, no booleans); match over text alone; ORE and OPE over every -/// scalar. A composite (`array`, `object`) has no term. Only the index's -/// kind matters: a match index's options do not change what it applies to. +/// The table [`IndexSpec::defines`] reads for a value, stated over kinds +/// instead, so a plan can be refused when it is built rather than when its +/// first value arrives. Equality is vitaminc's: every kind +/// `vitaminc-normalize` gives an equality domain, which is every integer +/// of every width, both floats, a decimal, a date, a timestamp, text and +/// bytes, and not a boolean. The rest are this crate's: match over text +/// alone, and ORE and OPE over the integers of 16 bits and wider, both +/// floats, text and bytes. A boolean and an 8-bit integer have no order +/// term: over so small a domain it would reveal which rows are `true`, or +/// each row's rank among 256 values. +/// A decimal, a date and a timestamp have none yet: their order encodings +/// wait for new cllw-ore and ore-rs releases (#1236), and [`not_admitted`] +/// names that reason. A composite (`array`, `object`) has no term. Only the +/// index's kind matters: a match index's options do not change what it +/// applies to. /// /// ``` /// use stack_encrypt::dynamic::{admits, ValueKind}; /// use stack_encrypt::target::IndexSpec; /// /// assert!(admits(ValueKind::UInt64, &IndexSpec::Equality)); -/// assert!(!admits(ValueKind::Float64, &IndexSpec::Equality)); +/// assert!(admits(ValueKind::Int16, &IndexSpec::Ore)); +/// assert!(admits(ValueKind::Int8, &IndexSpec::Equality)); +/// assert!(!admits(ValueKind::Int8, &IndexSpec::Ore)); +/// assert!(admits(ValueKind::Date, &IndexSpec::Equality)); +/// assert!(!admits(ValueKind::Date, &IndexSpec::Ore)); +/// assert!(!admits(ValueKind::Bool, &IndexSpec::Equality)); +/// assert!(!admits(ValueKind::Bool, &IndexSpec::Ore)); /// assert!(!admits(ValueKind::Object, &IndexSpec::Ore)); /// ``` pub fn admits(kind: ValueKind, index: &IndexSpec) -> bool { - use ValueKind::*; - match index { - IndexSpec::Equality => matches!(kind, Int32 | Int64 | UInt32 | UInt64 | String | Bytes), - IndexSpec::Match(_) => kind == String, - IndexSpec::Ore | IndexSpec::Ope => !matches!(kind, Array | Object), + scalar_of(kind).is_some_and(|(ty, scalar)| index.takes(ty, &scalar)) +} + +/// Why `kind` does not admit `index`, or `None` when it does: the reason a +/// plan that declares the pair is refused with. +/// +/// [`Reason::OrderTermPending`] for an ORE or OPE index on a decimal, date +/// or timestamp, whose order terms wait for new cllw-ore and ore-rs +/// releases (#1236). [`Reason::IndexNotAdmitted`] for every other pair +/// [`admits`] refuses. +/// +/// ``` +/// use stack_encrypt::dynamic::{not_admitted, Reason, ValueKind}; +/// use stack_encrypt::target::IndexSpec; +/// +/// assert_eq!(not_admitted(ValueKind::Timestamp, &IndexSpec::Ope), Some(Reason::OrderTermPending)); +/// assert_eq!(not_admitted(ValueKind::Bool, &IndexSpec::Ore), Some(Reason::IndexNotAdmitted)); +/// assert_eq!(not_admitted(ValueKind::Timestamp, &IndexSpec::Equality), None); +/// ``` +pub fn not_admitted(kind: ValueKind, index: &IndexSpec) -> Option { + if admits(kind, index) { + return None; } + let ordering = matches!(index, IndexSpec::Ore | IndexSpec::Ope); + let pending = matches!( + kind, + ValueKind::Decimal | ValueKind::Date | ValueKind::Timestamp + ); + Some(if ordering && pending { + Reason::OrderTermPending + } else { + Reason::IndexNotAdmitted + }) +} + +/// A scalar of `kind`, with its logical type, for asking the table about +/// the kind: any value of a kind is taken by an index exactly when every +/// other is. `None` for a composite, which is no scalar. +fn scalar_of(kind: ValueKind) -> Option<(Option, Physical<'static>)> { + let int = |int| (None, Physical::Int(int)); + Some(match kind { + ValueKind::Bool => (None, Physical::Bool(false)), + ValueKind::Int8 => int(Int::I8(0)), + ValueKind::Int16 => int(Int::I16(0)), + ValueKind::Int32 => int(Int::I32(0)), + ValueKind::Int64 => int(Int::I64(0)), + ValueKind::Int128 => int(Int::I128(0)), + ValueKind::UInt8 => int(Int::U8(0)), + ValueKind::UInt16 => int(Int::U16(0)), + ValueKind::UInt32 => int(Int::U32(0)), + ValueKind::UInt64 => int(Int::U64(0)), + ValueKind::UInt128 => int(Int::U128(0)), + ValueKind::Float32 => (None, Physical::Float(Float::F32(0.0))), + ValueKind::Float64 => (None, Physical::Float(Float::F64(0.0))), + ValueKind::Decimal => ( + Some(Logical::Decimal { scale: 0 }), + Physical::Int(Int::I128(0)), + ), + ValueKind::Date => (Some(Logical::Date), Physical::Int(Int::I32(0))), + ValueKind::Timestamp => ( + Some(Logical::Timestamp(TimeUnit::Nanos)), + Physical::Int(Int::I128(0)), + ), + ValueKind::String => (None, Physical::Text("")), + ValueKind::Bytes => (None, Physical::Bytes(&[])), + ValueKind::Array | ValueKind::Object => return None, + }) } /// Read a query value as `kind`. @@ -73,19 +154,26 @@ pub fn admits(kind: ValueKind, index: &IndexSpec) -> bool { /// A value already of this kind is returned as it is. A number of another /// width or kind is converted when the conversion is exact: an integer in /// range, or a float with no fractional part in range, for an integer kind -/// (a JavaScript `34` arrives as a float); an integer or float the target -/// float kind represents exactly, for a float kind. A NaN is never -/// converted, in either float direction: it equals nothing, so no -/// conversion of it is exact. Nothing else converts: a string is never -/// parsed as a number, and a number never becomes a string. +/// of any width (a JavaScript `34` arrives as a float); an integer or float +/// the target float kind represents exactly, for a float kind; an integer +/// whose magnitude fits 96 bits, for a decimal (at scale 0, so `34` reads as +/// the decimal `34`, which equals `34.00`). A NaN is never converted, in +/// either float direction: it equals nothing, so no conversion of it is +/// exact. A float is never read as a decimal, since most floats have no +/// short decimal form, and nothing converts to or from a date or a +/// timestamp. Nothing else converts: a string is never parsed as a number, +/// and a number never becomes a string. +/// +/// The value is any source ([`Encrypt`]): a transport frame a binding was +/// handed, walked in place. What comes back is the value as the field's kind, +/// written into a [`ValueFrame`] in the engine's value model. /// /// This is for a query: what a host hands over to search with. A value /// being sealed is not converted; it must already be of the field's kind, /// and is refused otherwise. /// /// **The engine does not call this.** [`term`](super::term()) takes a -/// [`Scalar`](super::Scalar) and an [`IndexSpec`] and never sees the field's -/// declared kind, so a binding deriving a query term for a typed field must +/// value and an [`IndexSpec`] and never sees the field's declared kind, so a binding deriving a query term for a typed field must /// call `read` first, with [`FieldPlan::field_type`](super::FieldPlan::field_type). /// One that skips it hands `Float64(34.0)` to a `uint64` field, derives a /// float term where the stored one is the `u64` term, and matches nothing, @@ -93,77 +181,142 @@ pub fn admits(kind: ValueKind, index: &IndexSpec) -> bool { /// (`query(v).using(&plan)`) is tracked in #1057. /// /// ``` -/// use stack_encrypt::dynamic::{read, FfiValue, ValueKind}; +/// use stack_encrypt::dynamic::{read, ValueFrame, ValueKind}; /// /// // A JavaScript number is a float; against a `uint64` field it is 34. -/// let value = read(ValueKind::UInt64, FfiValue::Float64(34.0))?; -/// assert!(matches!(value, FfiValue::UInt64(34))); -/// assert!(read(ValueKind::UInt64, FfiValue::Float64(34.5)).is_err()); -/// # Ok::<(), stack_encrypt::dynamic::Error>(()) +/// let value = read(ValueKind::UInt64, 34.0f64)?; +/// assert_eq!(value.kind(), Some(ValueKind::UInt64)); +/// assert_eq!(value.risky_ref(), ValueFrame::of(34u64)?.risky_ref()); +/// assert!(read(ValueKind::UInt64, 34.5f64).is_err()); +/// // Against an `int8` field, 34 is the 8-bit integer; 300 does not fit. +/// assert_eq!(read(ValueKind::Int8, 34i64)?.kind(), Some(ValueKind::Int8)); +/// assert!(read(ValueKind::Int8, 300i64).is_err()); +/// # Ok::<(), Box>(()) /// ``` /// /// # Errors /// /// [`Error::Source`] ([`Reason::FieldType`]) if the value cannot be read as -/// `kind` exactly. It names no field: the caller that knows the field names -/// it ([`Error::in_field`]). -pub fn read(kind: ValueKind, value: FfiValue) -> Result { - if kind.holds(&value) { +/// `kind` exactly, or is not in the engine's value model. It names no +/// field: the caller that knows the field names it ([`Error::in_field`]). +pub fn read(kind: ValueKind, value: impl Encrypt) -> Result { + let refused = || Error::bad_source(Reason::FieldType); + let value = ValueFrame::of(value).map_err(|_| refused())?; + if value.kind() == Some(kind) { return Ok(value); } - let number = Number::of(&value).ok_or(Error::bad_source(Reason::FieldType))?; + let number = (&value) + .visit(OneScalar::new( + |ty: Option, value: Physical<'_>| Number::of(ty, value).ok_or(None), + )) + .map_err(|_| refused())?; + let int = |int: Int| Raw(None, Physical::Int(int)); + let signed = || number.integer(); let read = match kind { - ValueKind::Int32 => number - .integer() + ValueKind::Int8 => signed() + .and_then(|i| i8::try_from(i).ok()) + .map(|v| int(Int::I8(v))), + ValueKind::Int16 => signed() + .and_then(|i| i16::try_from(i).ok()) + .map(|v| int(Int::I16(v))), + ValueKind::Int32 => signed() .and_then(|i| i32::try_from(i).ok()) - .map(FfiValue::Int32), - ValueKind::Int64 => number - .integer() + .map(|v| int(Int::I32(v))), + ValueKind::Int64 => signed() .and_then(|i| i64::try_from(i).ok()) - .map(FfiValue::Int64), - ValueKind::UInt32 => number - .integer() + .map(|v| int(Int::I64(v))), + ValueKind::Int128 => signed().map(|v| int(Int::I128(v))), + ValueKind::UInt8 => signed() + .and_then(|i| u8::try_from(i).ok()) + .map(|v| int(Int::U8(v))), + ValueKind::UInt16 => signed() + .and_then(|i| u16::try_from(i).ok()) + .map(|v| int(Int::U16(v))), + ValueKind::UInt32 => signed() .and_then(|i| u32::try_from(i).ok()) - .map(FfiValue::UInt32), - ValueKind::UInt64 => number - .integer() + .map(|v| int(Int::U32(v))), + ValueKind::UInt64 => signed() .and_then(|i| u64::try_from(i).ok()) - .map(FfiValue::UInt64), - ValueKind::Float64 => number.exact_f64().map(FfiValue::Float64), - ValueKind::Float32 => number.exact_f32().map(FfiValue::Float32), + .map(|v| int(Int::U64(v))), + ValueKind::UInt128 => number.unsigned().map(|v| int(Int::U128(v))), + ValueKind::Float64 => number + .exact_f64() + .map(|f| Raw(None, Physical::Float(Float::F64(f)))), + ValueKind::Float32 => number + .exact_f32() + .map(|f| Raw(None, Physical::Float(Float::F32(f)))), + ValueKind::Decimal => number.whole().map(|i| { + Raw( + Some(Logical::Decimal { scale: 0 }), + Physical::Int(Int::I128(i)), + ) + }), _ => None, }; - read.ok_or(Error::bad_source(Reason::FieldType)) + ValueFrame::of(read.ok_or_else(refused)?).map_err(|_| refused()) } -/// A numeric leaf, widened without loss: every integer variant fits an -/// `i128`, and an `f32` widens to an `f64` exactly. +/// 2^127 as an `f64`, exactly: the first float past `i128::MAX`. +const TWO_127: f64 = 170_141_183_460_469_231_731_687_303_715_884_105_728.0; +/// 2^128 as an `f64`, exactly: the first float past `u128::MAX`. +const TWO_128: f64 = 340_282_366_920_938_463_463_374_607_431_768_211_456.0; + +/// A numeric leaf, widened without loss: every integer but a `u128` above +/// `i128::MAX` fits an `i128`, which is `Unsigned`; an `f32` widens to an +/// `f64` exactly. #[derive(Clone, Copy)] enum Number { Integer(i128), + Unsigned(u128), Float(f64), } impl Number { - fn of(value: &FfiValue) -> Option { - Some(match value { - FfiValue::Int32(v) => Number::Integer((*v).into()), - FfiValue::Int64(v) => Number::Integer((*v).into()), - FfiValue::UInt32(v) => Number::Integer((*v).into()), - FfiValue::UInt64(v) => Number::Integer((*v).into()), - FfiValue::Float32(v) => Number::Float((*v).into()), - FfiValue::Float64(v) => Number::Float(*v), + /// The number a scalar of the value model is, or `None` for anything + /// that is not a number. A decimal, date or timestamp is not one. + fn of(ty: Option, value: Physical<'_>) -> Option { + Some(match (ty, value) { + (None, Physical::Int(int)) => match int.to_i128() { + Some(v) => Number::Integer(v), + None => Number::Unsigned(int.to_u128()?), + }, + (None, Physical::Float(Float::F32(v))) => Number::Float(v.into()), + (None, Physical::Float(Float::F64(v))) => Number::Float(v), _ => return None, }) } - /// The integer this number is exactly, if it is one. A float outside - /// `i128` saturates, which no target integer type then accepts. + /// The integer this number is exactly, if it is one that fits an + /// `i128`. A float outside `i128` is not one: casting it would + /// saturate to a different number. fn integer(self) -> Option { match self { Number::Integer(i) => Some(i), - Number::Float(f) if f.is_finite() && f.fract() == 0.0 => Some(f as i128), - Number::Float(_) => None, + Number::Unsigned(_) => None, + Number::Float(f) => { + (f.fract() == 0.0 && (-TWO_127..TWO_127).contains(&f)).then_some(f as i128) + } + } + } + + /// The integer this number is exactly, if it is a non-negative one + /// that fits a `u128`. + fn unsigned(self) -> Option { + match self { + Number::Integer(i) => u128::try_from(i).ok(), + Number::Unsigned(u) => Some(u), + Number::Float(f) => { + (f.fract() == 0.0 && (0.0..TWO_128).contains(&f)).then_some(f as u128) + } + } + } + + /// The integer this number is, if it is an integer and not a float: a + /// decimal is read from an integer alone. + fn whole(self) -> Option { + match self { + Number::Integer(i) => Some(i), + Number::Unsigned(_) | Number::Float(_) => None, } } @@ -175,7 +328,13 @@ impl Number { Number::Float(f) => (!f.is_nan()).then_some(f), Number::Integer(i) => { let f = i as f64; - (f as i128 == i).then_some(f) + // `i128::MAX` rounds up to 2^127, which casts back to + // `i128::MAX` by saturation: the range check refuses it. + (f < TWO_127 && f as i128 == i).then_some(f) + } + Number::Unsigned(u) => { + let f = u as f64; + (f < TWO_128 && f as u128 == u).then_some(f) } } } @@ -189,31 +348,236 @@ impl Number { } } +/// The kind of a value: the type vocabulary a plan field declares in its +/// `"type"` key, and what [`ValueFrame::kind`] reports. +/// +/// `Null`, `Undefined` and `Passthrough` have no kind: each null is a type +/// with one value, so declaring a field as one says nothing, and a +/// passthrough is a transport choice, not a type. +/// +/// # Names are wire format +/// +/// [`name`](Self::name) (also its [`Display`](fmt::Display) and [`FromStr`] +/// form) is how a binding spells a kind. The names are frozen: matched +/// exactly, case-sensitively, and never renamed. +#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] +pub enum ValueKind { + /// `"bool"`. + Bool, + /// `"int8"`. + Int8, + /// `"int16"`. + Int16, + /// `"int32"`. + Int32, + /// `"int64"`. + Int64, + /// `"int128"`. + Int128, + /// `"uint8"`. + UInt8, + /// `"uint16"`. + UInt16, + /// `"uint32"`. + UInt32, + /// `"uint64"`. + UInt64, + /// `"uint128"`. + UInt128, + /// `"float32"`. + Float32, + /// `"float64"`. + Float64, + /// `"decimal"`: vitaminc's `Decimal` logical type, a mantissa and a + /// scale. + Decimal, + /// `"date"`: vitaminc's `Date` logical type, a calendar date with no + /// time or zone. + Date, + /// `"timestamp"`: vitaminc's `Timestamp` logical type, an instant in + /// UTC, to the nanosecond. + Timestamp, + /// `"string"`. + String, + /// `"bytes"`. + Bytes, + /// `"array"`. Says nothing about the elements' kinds. + Array, + /// `"object"`. Says nothing about the entries' kinds. + Object, +} + +impl ValueKind { + /// Every kind, in declaration order. + pub const ALL: [ValueKind; 20] = [ + ValueKind::Bool, + ValueKind::Int8, + ValueKind::Int16, + ValueKind::Int32, + ValueKind::Int64, + ValueKind::Int128, + ValueKind::UInt8, + ValueKind::UInt16, + ValueKind::UInt32, + ValueKind::UInt64, + ValueKind::UInt128, + ValueKind::Float32, + ValueKind::Float64, + ValueKind::Decimal, + ValueKind::Date, + ValueKind::Timestamp, + ValueKind::String, + ValueKind::Bytes, + ValueKind::Array, + ValueKind::Object, + ]; + + /// How a declaration spells this kind: `"bool"`, `"int8"`, `"int16"`, + /// `"int32"`, `"int64"`, `"int128"`, `"uint8"`, `"uint16"`, `"uint32"`, + /// `"uint64"`, `"uint128"`, `"float32"`, `"float64"`, `"decimal"`, + /// `"date"`, `"timestamp"`, `"string"`, `"bytes"`, `"array"` or + /// `"object"`. Frozen wire format. + pub const fn name(self) -> &'static str { + match self { + ValueKind::Bool => "bool", + ValueKind::Int8 => "int8", + ValueKind::Int16 => "int16", + ValueKind::Int32 => "int32", + ValueKind::Int64 => "int64", + ValueKind::Int128 => "int128", + ValueKind::UInt8 => "uint8", + ValueKind::UInt16 => "uint16", + ValueKind::UInt32 => "uint32", + ValueKind::UInt64 => "uint64", + ValueKind::UInt128 => "uint128", + ValueKind::Float32 => "float32", + ValueKind::Float64 => "float64", + ValueKind::Decimal => "decimal", + ValueKind::Date => "date", + ValueKind::Timestamp => "timestamp", + ValueKind::String => "string", + ValueKind::Bytes => "bytes", + ValueKind::Array => "array", + ValueKind::Object => "object", + } + } +} + +impl fmt::Display for ValueKind { + /// Writes [`name`](Self::name). + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(self.name()) + } +} + +impl FromStr for ValueKind { + type Err = ParseValueKindError; + + /// Parses a [`name`](Self::name), exactly: `"uint64"`, not `"UInt64"`, + /// `"u64"` or `" uint64"`. `"null"` and `"undefined"` are not kinds. + fn from_str(name: &str) -> Result { + ValueKind::ALL + .into_iter() + .find(|kind| kind.name() == name) + .ok_or(ParseValueKindError) + } +} + +/// The error from parsing a string that is not a [`ValueKind::name`]. +/// Carries no detail: the caller holds the string it tried to parse. +#[derive(Clone, Copy, PartialEq, Eq, Debug, thiserror::Error)] +#[error("not a value kind")] +pub struct ParseValueKindError; + #[cfg(test)] mod tests { use super::*; - use crate::dynamic::Scalar; + use crate::dynamic::test_frame::Tree; use crate::sem::{MatchOptions, Tokenizer}; - use vitaminc_protected::Protected; + use vitaminc_aead::plaintext::Raw; + + #[test] + fn kind_names_parse_back_exactly() { + let names: Vec<&str> = ValueKind::ALL.iter().map(|kind| kind.name()).collect(); + assert_eq!( + names, + [ + "bool", + "int8", + "int16", + "int32", + "int64", + "int128", + "uint8", + "uint16", + "uint32", + "uint64", + "uint128", + "float32", + "float64", + "decimal", + "date", + "timestamp", + "string", + "bytes", + "array", + "object" + ], + "the frozen names" + ); + for kind in ValueKind::ALL { + assert_eq!(kind.name().parse::(), Ok(kind)); + assert_eq!(kind.to_string(), kind.name()); + } + assert_eq!("UInt64".parse::(), Err(ParseValueKindError)); + assert_eq!("null".parse::(), Err(ParseValueKindError)); + } - // What a kind is, its name and its tags, and which values it holds are - // vitaminc's to test (`ValueKind`). These test the two rules this crate + // Beside the frozen names (above), these test the two rules this crate // adds over the vocabulary. + /// A scalar as the engine holds it: its frame. + fn scalar(ty: Option, value: Physical<'_>) -> ValueFrame { + ValueFrame::of(Raw(ty, value)).expect("in the value model") + } + + fn int(int: Int) -> ValueFrame { + scalar(None, Physical::Int(int)) + } + + fn tree(value: Tree) -> ValueFrame { + ValueFrame::of(&value).expect("in the value model") + } + /// One value of every kind. - fn sample(kind: ValueKind) -> FfiValue { + fn sample(kind: ValueKind) -> ValueFrame { match kind { - ValueKind::Bool => FfiValue::Bool(true), - ValueKind::Int32 => FfiValue::Int32(-3), - ValueKind::Int64 => FfiValue::Int64(-4), - ValueKind::UInt32 => FfiValue::UInt32(34), - ValueKind::UInt64 => FfiValue::UInt64(35), - ValueKind::Float32 => FfiValue::Float32(1.5), - ValueKind::Float64 => FfiValue::Float64(2.5), - ValueKind::String => FfiValue::String("alice".into()), - ValueKind::Bytes => FfiValue::Bytes(Protected::new(b"ab".to_vec())), - ValueKind::Array => FfiValue::Array(vec![FfiValue::UInt32(1)]), - ValueKind::Object => FfiValue::Object(vec![("k".to_string(), FfiValue::UInt32(1))]), + ValueKind::Bool => tree(Tree::Bool(true)), + ValueKind::Int8 => int(Int::I8(-1)), + ValueKind::Int16 => int(Int::I16(-2)), + ValueKind::Int32 => tree(Tree::Int32(-3)), + ValueKind::Int64 => tree(Tree::Int64(-4)), + ValueKind::Int128 => int(Int::I128(i128::MIN)), + ValueKind::UInt8 => int(Int::U8(32)), + ValueKind::UInt16 => int(Int::U16(33)), + ValueKind::UInt32 => tree(Tree::UInt32(34)), + ValueKind::UInt64 => tree(Tree::UInt64(35)), + ValueKind::UInt128 => int(Int::U128(u128::MAX)), + ValueKind::Float32 => tree(Tree::Float32(1.5)), + ValueKind::Float64 => tree(Tree::Float64(2.5)), + ValueKind::Decimal => scalar( + Some(Logical::Decimal { scale: 2 }), + Physical::Int(Int::I64(150)), + ), + ValueKind::Date => scalar(Some(Logical::Date), Physical::Int(Int::I32(19_782))), + ValueKind::Timestamp => scalar( + Some(Logical::Timestamp(TimeUnit::Nanos)), + Physical::Int(Int::I128(1_760_662_923_123_456_789)), + ), + ValueKind::String => tree(Tree::String("alice".into())), + ValueKind::Bytes => tree(Tree::Bytes(b"ab".to_vec())), + ValueKind::Array => tree(Tree::Array(vec![Tree::UInt32(1)])), + ValueKind::Object => tree(Tree::Object(vec![("k".to_string(), Tree::UInt32(1))])), } } @@ -226,27 +590,23 @@ mod tests { ] } - /// `admits` is `IndexSpec::supports` stated over kinds: the two tables - /// cannot disagree about any scalar, and a composite admits nothing. + /// `admits` is `IndexSpec::defines` stated over kinds: the two cannot + /// disagree about a value of any kind, and a composite admits nothing. #[test] - fn admits_agrees_with_supports_for_every_scalar_kind() { + fn admits_agrees_with_defines_for_every_kind() { for kind in ValueKind::ALL { for index in indexes() { - match Scalar::of(&sample(kind), &index) { - Ok(scalar) => { - assert_eq!( - admits(kind, &index), - index.supports(&scalar), - "{kind} and {index}" - ) - } - Err(_) => assert!(!admits(kind, &index), "{kind} is not a scalar"), - } + assert_eq!( + admits(kind, &index), + index.defines(sample(kind)), + "{kind} and {index}" + ); } } // Spelled out, so the table reads without the cross-check. assert!(admits(ValueKind::UInt64, &IndexSpec::Equality)); - assert!(!admits(ValueKind::Float64, &IndexSpec::Equality)); + assert!(admits(ValueKind::Float64, &IndexSpec::Equality)); + assert!(admits(ValueKind::Bytes, &IndexSpec::Equality)); assert!(!admits(ValueKind::Bool, &IndexSpec::Equality)); assert!(admits( ValueKind::String, @@ -257,10 +617,30 @@ mod tests { &IndexSpec::Match(MatchOptions::default()) )); assert!(admits(ValueKind::Float64, &IndexSpec::Ore)); + assert!(admits(ValueKind::String, &IndexSpec::Ope)); + assert!(!admits(ValueKind::Bool, &IndexSpec::Ore)); + assert!(!admits(ValueKind::Bool, &IndexSpec::Ope)); assert!(!admits(ValueKind::Object, &IndexSpec::Ope)); assert!(!admits(ValueKind::Array, &IndexSpec::Ore)); } + /// Equality is vitaminc's table: a kind admits it exactly when + /// `vitaminc-normalize` gives the kind's values an equality domain. + #[test] + fn admits_equality_exactly_where_vitaminc_gives_a_domain() { + for kind in ValueKind::ALL { + let has_domain = matches!( + vitaminc_normalize::terms(sample(kind)).as_deref(), + Ok([term]) if term.path.steps().is_empty() + ); + assert_eq!( + admits(kind, &IndexSpec::Equality), + has_domain, + "{kind} admits equality exactly when it has a domain" + ); + } + } + /// A match index's options are not part of what it applies to: text /// admits it under any options, and nothing else does. #[test] @@ -280,23 +660,258 @@ mod tests { } } - fn read_ok(kind: ValueKind, value: FfiValue) -> Option { + /// The new kinds' rows, spelled out: equality on every one, order on + /// every integer width but 8 bits and on none of the decimal, date and + /// timestamp, match on none. + #[test] + fn admits_the_new_kinds_where_their_terms_exist() { + let integers = [ + ValueKind::Int16, + ValueKind::Int128, + ValueKind::UInt16, + ValueKind::UInt128, + ]; + let logical = [ValueKind::Decimal, ValueKind::Date, ValueKind::Timestamp]; + let matched = IndexSpec::Match(MatchOptions::default()); + for kind in integers { + assert!(admits(kind, &IndexSpec::Equality), "{kind} equality"); + assert!(admits(kind, &IndexSpec::Ore), "{kind} ore"); + assert!(admits(kind, &IndexSpec::Ope), "{kind} ope"); + assert!(!admits(kind, &matched), "{kind} match"); + } + // An 8-bit integer keeps its equality term and, like a boolean, + // has no order term: 256 values are too few to rank. + for kind in [ValueKind::Int8, ValueKind::UInt8] { + assert!(admits(kind, &IndexSpec::Equality), "{kind} equality"); + assert!(!admits(kind, &IndexSpec::Ore), "{kind} ore"); + assert!(!admits(kind, &IndexSpec::Ope), "{kind} ope"); + assert!(!admits(kind, &matched), "{kind} match"); + assert_eq!( + not_admitted(kind, &IndexSpec::Ore), + Some(Reason::IndexNotAdmitted), + "{kind} ore is refused as a boolean's is, not as pending" + ); + } + for kind in logical { + assert!(admits(kind, &IndexSpec::Equality), "{kind} equality"); + assert!(!admits(kind, &IndexSpec::Ore), "{kind} ore"); + assert!(!admits(kind, &IndexSpec::Ope), "{kind} ope"); + assert!(!admits(kind, &matched), "{kind} match"); + } + } + + /// `not_admitted` is `admits` with a reason: none for an admitted pair, + /// the #1236 reason for an order index on a decimal, date or timestamp + /// and nothing else, and the generic reason for every other refusal. + #[test] + fn not_admitted_names_the_pending_order_terms_and_nothing_else() { + for kind in ValueKind::ALL { + for index in indexes() { + let reason = not_admitted(kind, &index); + assert_eq!(reason.is_none(), admits(kind, &index), "{kind} and {index}"); + let pending = matches!(index, IndexSpec::Ore | IndexSpec::Ope) + && matches!( + kind, + ValueKind::Decimal | ValueKind::Date | ValueKind::Timestamp + ); + if pending { + assert_eq!(reason, Some(Reason::OrderTermPending), "{kind} and {index}"); + } else if reason.is_some() { + assert_eq!(reason, Some(Reason::IndexNotAdmitted), "{kind} and {index}"); + } + } + } + assert_eq!( + not_admitted(ValueKind::Decimal, &IndexSpec::Ore), + Some(Reason::OrderTermPending) + ); + assert_eq!( + not_admitted(ValueKind::Date, &IndexSpec::Ope), + Some(Reason::OrderTermPending) + ); + assert_eq!( + not_admitted(ValueKind::Bool, &IndexSpec::Ope), + Some(Reason::IndexNotAdmitted) + ); + assert_eq!( + not_admitted(ValueKind::Date, &IndexSpec::Match(MatchOptions::default())), + Some(Reason::IndexNotAdmitted) + ); + assert_eq!(not_admitted(ValueKind::Int16, &IndexSpec::Ore), None); + assert_eq!( + not_admitted(ValueKind::Int8, &IndexSpec::Ore), + Some(Reason::IndexNotAdmitted) + ); + assert!(Reason::OrderTermPending.to_string().contains("#1236")); + } + + /// Every integer width is a source and a target: a value in range + /// converts exactly, one outside it is refused. + #[test] + fn read_converts_between_every_integer_width() { + assert!(reads_as( + ValueKind::Int8, + Tree::Int64(-128), + int(Int::I8(-128)) + )); + assert!(read_frame(ValueKind::Int8, Tree::Int64(128)).is_none()); + assert!(reads_as( + ValueKind::Int16, + int(Int::U8(200)), + int(Int::I16(200)) + )); + assert!(read_frame(ValueKind::Int16, Tree::Int32(40_000)).is_none()); + assert!(reads_as( + ValueKind::UInt8, + int(Int::I16(255)), + int(Int::U8(255)) + )); + assert!(read_frame(ValueKind::UInt8, int(Int::I8(-1))).is_none()); + assert!(reads_as( + ValueKind::UInt16, + int(Int::U128(65_535)), + int(Int::U16(65_535)) + )); + assert!(read_frame(ValueKind::UInt16, Tree::UInt32(65_536)).is_none()); + assert!(reads_as( + ValueKind::Int128, + Tree::UInt64(u64::MAX), + int(Int::I128(u64::MAX.into())) + )); + assert!(reads_as( + ValueKind::Int128, + int(Int::U128(i128::MAX as u128)), + int(Int::I128(i128::MAX)) + )); + // A `u128` above `i128::MAX` is no `i128`, nor any narrower width. + assert!(read_frame(ValueKind::Int128, int(Int::U128(u128::MAX))).is_none()); + assert!(read_frame(ValueKind::UInt64, int(Int::U128(u128::MAX))).is_none()); + assert!(reads_as( + ValueKind::UInt128, + int(Int::I8(7)), + int(Int::U128(7)) + )); + assert!(read_frame(ValueKind::UInt128, int(Int::I128(-1))).is_none()); + assert!(reads_as( + ValueKind::Int64, + int(Int::I128(-5)), + int(Int::I64(-5)) + )); + assert!(reads_as( + ValueKind::UInt32, + int(Int::U16(9)), + int(Int::U32(9)) + )); + assert!(reads_as( + ValueKind::Int32, + int(Int::I8(-9)), + int(Int::I32(-9)) + )); + } + + /// The 128-bit edges: a float at 2^127 is past `i128` and one at 2^128 + /// past `u128`, though casting either would saturate to the maximum and + /// derive the term of a different number. -2^127 is `i128::MIN` + /// exactly. An integer the float kind would round is refused in the + /// other direction too. + #[test] + fn read_refuses_a_number_past_the_128_bit_ranges() { + let two_127 = 170_141_183_460_469_231_731_687_303_715_884_105_728.0_f64; + let two_128 = 340_282_366_920_938_463_463_374_607_431_768_211_456.0_f64; + assert!(read_frame(ValueKind::Int128, Tree::Float64(two_127)).is_none()); + assert!(reads_as( + ValueKind::Int128, + Tree::Float64(-two_127), + int(Int::I128(i128::MIN)) + )); + assert!(read_frame(ValueKind::UInt128, Tree::Float64(two_128)).is_none()); + assert!(reads_as( + ValueKind::UInt128, + Tree::Float64(two_127), + int(Int::U128(1 << 127)) + )); + assert!(read_frame(ValueKind::UInt128, Tree::Float64(-1.0)).is_none()); + assert!(read_frame(ValueKind::UInt128, Tree::Float64(0.5)).is_none()); + assert!(read_frame(ValueKind::UInt128, Tree::Float64(f64::NAN)).is_none()); + assert!(read_frame(ValueKind::Float64, int(Int::I128(i128::MAX))).is_none()); + assert!(read_frame(ValueKind::Float64, int(Int::U128(u128::MAX))).is_none()); + assert!(reads_as( + ValueKind::Float64, + int(Int::I128(i128::MIN)), + tree(Tree::Float64(-two_127)) + )); + assert!(reads_as( + ValueKind::Float64, + int(Int::U128(1 << 127)), + tree(Tree::Float64(two_127)) + )); + assert!(read_frame(ValueKind::Float32, int(Int::U128((1 << 24) + 1))).is_none()); + } + + /// An integer reads as a decimal at scale 0 when its magnitude fits 96 + /// bits; a float never does. Nothing converts to a date or a + /// timestamp, and a decimal, date or timestamp converts to nothing. + #[test] + fn read_converts_an_integer_to_a_decimal_and_nothing_to_a_date() { + let decimal = |mantissa: i128| { + scalar( + Some(Logical::Decimal { scale: 0 }), + Physical::Int(Int::I128(mantissa)), + ) + }; + assert!(reads_as(ValueKind::Decimal, Tree::Int64(-34), decimal(-34))); + assert!(reads_as(ValueKind::Decimal, int(Int::U8(34)), decimal(34))); + assert!(read_frame(ValueKind::Decimal, int(Int::I128(1 << 96))).is_none()); + assert!(read_frame(ValueKind::Decimal, int(Int::U128(u128::MAX))).is_none()); + assert!(read_frame(ValueKind::Decimal, Tree::Float64(1.0)).is_none()); + assert!(read_frame(ValueKind::Date, Tree::Int32(19_782)).is_none()); + assert!(read_frame(ValueKind::Timestamp, Tree::Int64(1)).is_none()); + for kind in [ValueKind::Decimal, ValueKind::Date, ValueKind::Timestamp] { + for target in [ValueKind::Int128, ValueKind::Float64, ValueKind::String] { + assert!( + read_frame(target, sample(kind)).is_none(), + "{kind} as {target}" + ); + } + } + } + + /// `read`, with the frame it writes read back as a value tree to + /// compare. + fn read_ok(kind: ValueKind, value: Tree) -> Option { + let read = read(kind, value).ok()?; + Some(Tree::from_frame(read.risky_ref()).expect("a value")) + } + + /// `read` from any source, as the frame it writes, for the kinds a + /// control-data tree cannot hold. + fn read_frame(kind: ValueKind, value: impl Encrypt) -> Option { read(kind, value).ok() } + /// Whether `read` gives exactly the frame of `want`. + fn reads_as(kind: ValueKind, value: impl Encrypt, want: ValueFrame) -> bool { + read_frame(kind, value).is_some_and(|read| read.risky_ref() == want.risky_ref()) + } + #[test] fn read_returns_a_value_of_the_kind_as_it_is() { for kind in ValueKind::ALL { - let read = read_ok(kind, sample(kind)).expect("its own kind"); - assert!(kind.holds(&read)); + let read = read_frame(kind, sample(kind)).expect("its own kind"); + assert_eq!(read.kind(), Some(kind)); + assert_eq!( + read.risky_ref(), + sample(kind).risky_ref(), + "{kind} as it is" + ); } // Already of the kind: returned as it is, not converted, so a NaN // the host sent as the field's own float kind is not refused here. assert!( - matches!(read_ok(ValueKind::Float32, FfiValue::Float32(f32::NAN)), Some(FfiValue::Float32(f)) if f.is_nan()) + matches!(read_ok(ValueKind::Float32, Tree::Float32(f32::NAN)), Some(Tree::Float32(f)) if f.is_nan()) ); assert!( - matches!(read_ok(ValueKind::Float64, FfiValue::Float64(f64::NAN)), Some(FfiValue::Float64(f)) if f.is_nan()) + matches!(read_ok(ValueKind::Float64, Tree::Float64(f64::NAN)), Some(Tree::Float64(f)) if f.is_nan()) ); } @@ -304,63 +919,63 @@ mod tests { fn read_converts_an_exact_number_to_an_integer_kind() { // Every numeric variant is a source, each read into another width. assert!(matches!( - read_ok(ValueKind::Int64, FfiValue::Int32(-5)), - Some(FfiValue::Int64(-5)) + read_ok(ValueKind::Int64, Tree::Int32(-5)), + Some(Tree::Int64(-5)) )); assert!(matches!( - read_ok(ValueKind::Int32, FfiValue::UInt64(5)), - Some(FfiValue::Int32(5)) + read_ok(ValueKind::Int32, Tree::UInt64(5)), + Some(Tree::Int32(5)) )); assert!( - matches!(read_ok(ValueKind::Float64, FfiValue::Int32(-5)), Some(FfiValue::Float64(f)) if f == -5.0) + matches!(read_ok(ValueKind::Float64, Tree::Int32(-5)), Some(Tree::Float64(f)) if f == -5.0) ); // A JavaScript number is a float. assert!(matches!( - read_ok(ValueKind::UInt64, FfiValue::Float64(34.0)), - Some(FfiValue::UInt64(34)) + read_ok(ValueKind::UInt64, Tree::Float64(34.0)), + Some(Tree::UInt64(34)) )); assert!(matches!( - read_ok(ValueKind::Int32, FfiValue::Float32(-2.0)), - Some(FfiValue::Int32(-2)) + read_ok(ValueKind::Int32, Tree::Float32(-2.0)), + Some(Tree::Int32(-2)) )); assert!(matches!( - read_ok(ValueKind::Int64, FfiValue::UInt32(7)), - Some(FfiValue::Int64(7)) + read_ok(ValueKind::Int64, Tree::UInt32(7)), + Some(Tree::Int64(7)) )); assert!(matches!( - read_ok(ValueKind::UInt32, FfiValue::Int64(7)), - Some(FfiValue::UInt32(7)) + read_ok(ValueKind::UInt32, Tree::Int64(7)), + Some(Tree::UInt32(7)) )); assert!(matches!( - read_ok(ValueKind::Int64, FfiValue::Float64(-0.0)), - Some(FfiValue::Int64(0)) + read_ok(ValueKind::Int64, Tree::Float64(-0.0)), + Some(Tree::Int64(0)) )); assert!(matches!( - read_ok(ValueKind::UInt64, FfiValue::Int64(i64::MAX)), - Some(FfiValue::UInt64(v)) if v == i64::MAX as u64 + read_ok(ValueKind::UInt64, Tree::Int64(i64::MAX)), + Some(Tree::UInt64(v)) if v == i64::MAX as u64 )); assert!(matches!( - read_ok(ValueKind::Int32, FfiValue::Int64(i32::MIN.into())), - Some(FfiValue::Int32(i32::MIN)) + read_ok(ValueKind::Int32, Tree::Int64(i32::MIN.into())), + Some(Tree::Int32(i32::MIN)) )); assert!(matches!( - read_ok(ValueKind::UInt32, FfiValue::UInt64(u32::MAX.into())), - Some(FfiValue::UInt32(u32::MAX)) + read_ok(ValueKind::UInt32, Tree::UInt64(u32::MAX.into())), + Some(Tree::UInt32(u32::MAX)) )); } #[test] fn read_refuses_an_inexact_or_out_of_range_integer() { let refused = [ - (ValueKind::UInt64, FfiValue::Float64(34.5)), - (ValueKind::Int64, FfiValue::Float64(f64::NAN)), - (ValueKind::Int64, FfiValue::Float64(f64::INFINITY)), - (ValueKind::Int64, FfiValue::Float64(1e30)), - (ValueKind::UInt64, FfiValue::Int64(-1)), - (ValueKind::UInt32, FfiValue::UInt64(u64::from(u32::MAX) + 1)), - (ValueKind::Int32, FfiValue::Int64(i64::from(i32::MAX) + 1)), - (ValueKind::Int32, FfiValue::Int64(i64::from(i32::MIN) - 1)), - (ValueKind::Int64, FfiValue::UInt64(u64::MAX)), + (ValueKind::UInt64, Tree::Float64(34.5)), + (ValueKind::Int64, Tree::Float64(f64::NAN)), + (ValueKind::Int64, Tree::Float64(f64::INFINITY)), + (ValueKind::Int64, Tree::Float64(1e30)), + (ValueKind::UInt64, Tree::Int64(-1)), + (ValueKind::UInt32, Tree::UInt64(u64::from(u32::MAX) + 1)), + (ValueKind::Int32, Tree::Int64(i64::from(i32::MAX) + 1)), + (ValueKind::Int32, Tree::Int64(i64::from(i32::MIN) - 1)), + (ValueKind::Int64, Tree::UInt64(u64::MAX)), ]; for (at, (kind, value)) in refused.into_iter().enumerate() { assert!( @@ -378,53 +993,53 @@ mod tests { fn read_refuses_a_float_at_the_first_value_past_an_integer_range() { let two_63 = 9_223_372_036_854_775_808.0_f64; let two_64 = 18_446_744_073_709_551_616.0_f64; - assert!(read_ok(ValueKind::Int64, FfiValue::Float64(two_63)).is_none()); + assert!(read_ok(ValueKind::Int64, Tree::Float64(two_63)).is_none()); assert!(matches!( - read_ok(ValueKind::Int64, FfiValue::Float64(-two_63)), - Some(FfiValue::Int64(i64::MIN)) + read_ok(ValueKind::Int64, Tree::Float64(-two_63)), + Some(Tree::Int64(i64::MIN)) )); - assert!(read_ok(ValueKind::UInt64, FfiValue::Float64(two_64)).is_none()); + assert!(read_ok(ValueKind::UInt64, Tree::Float64(two_64)).is_none()); assert!(matches!( read_ok( ValueKind::UInt64, - FfiValue::Float64(18_446_744_073_709_549_568.0) + Tree::Float64(18_446_744_073_709_549_568.0) ), - Some(FfiValue::UInt64(18_446_744_073_709_549_568)) + Some(Tree::UInt64(18_446_744_073_709_549_568)) )); - assert!(read_ok(ValueKind::UInt32, FfiValue::Float64(4_294_967_296.0)).is_none()); + assert!(read_ok(ValueKind::UInt32, Tree::Float64(4_294_967_296.0)).is_none()); assert!(matches!( - read_ok(ValueKind::UInt32, FfiValue::Float64(4_294_967_295.0)), - Some(FfiValue::UInt32(u32::MAX)) + read_ok(ValueKind::UInt32, Tree::Float64(4_294_967_295.0)), + Some(Tree::UInt32(u32::MAX)) )); } #[test] fn read_converts_an_exactly_representable_number_to_a_float_kind() { assert!( - matches!(read_ok(ValueKind::Float64, FfiValue::Int64(34)), Some(FfiValue::Float64(f)) if f == 34.0) + matches!(read_ok(ValueKind::Float64, Tree::Int64(34)), Some(Tree::Float64(f)) if f == 34.0) ); assert!( - matches!(read_ok(ValueKind::Float64, FfiValue::Float32(1.5)), Some(FfiValue::Float64(f)) if f == 1.5) + matches!(read_ok(ValueKind::Float64, Tree::Float32(1.5)), Some(Tree::Float64(f)) if f == 1.5) ); assert!( - matches!(read_ok(ValueKind::Float32, FfiValue::Float64(1.5)), Some(FfiValue::Float32(f)) if f == 1.5) + matches!(read_ok(ValueKind::Float32, Tree::Float64(1.5)), Some(Tree::Float32(f)) if f == 1.5) ); assert!( - matches!(read_ok(ValueKind::Float32, FfiValue::UInt32(16_777_216)), Some(FfiValue::Float32(f)) if f == 16_777_216.0) + matches!(read_ok(ValueKind::Float32, Tree::UInt32(16_777_216)), Some(Tree::Float32(f)) if f == 16_777_216.0) ); assert!(matches!( - read_ok(ValueKind::Float64, FfiValue::UInt64(1 << 53)), - Some(FfiValue::Float64(f)) if f == 9_007_199_254_740_992.0 + read_ok(ValueKind::Float64, Tree::UInt64(1 << 53)), + Some(Tree::Float64(f)) if f == 9_007_199_254_740_992.0 )); } #[test] fn read_refuses_a_number_a_float_kind_would_round() { let refused = [ - (ValueKind::Float64, FfiValue::UInt64((1 << 53) + 1)), - (ValueKind::Float64, FfiValue::UInt64(u64::MAX)), - (ValueKind::Float32, FfiValue::UInt32(16_777_217)), - (ValueKind::Float32, FfiValue::Float64(0.1)), + (ValueKind::Float64, Tree::UInt64((1 << 53) + 1)), + (ValueKind::Float64, Tree::UInt64(u64::MAX)), + (ValueKind::Float32, Tree::UInt32(16_777_217)), + (ValueKind::Float32, Tree::Float64(0.1)), ]; for (at, (kind, value)) in refused.into_iter().enumerate() { assert!( @@ -439,11 +1054,11 @@ mod tests { #[test] fn read_refuses_a_nan_in_both_float_directions() { assert!(matches!( - read(ValueKind::Float32, FfiValue::Float64(f64::NAN)), + read(ValueKind::Float32, Tree::Float64(f64::NAN)), Err(Error::Source { .. }) )); assert!(matches!( - read(ValueKind::Float64, FfiValue::Float32(f32::NAN)), + read(ValueKind::Float64, Tree::Float32(f32::NAN)), Err(Error::Source { .. }) )); } @@ -451,19 +1066,16 @@ mod tests { #[test] fn read_never_converts_across_kinds() { let refused = [ - (ValueKind::UInt64, FfiValue::String("34".into())), - (ValueKind::String, FfiValue::UInt64(34)), - (ValueKind::Bool, FfiValue::UInt32(1)), - (ValueKind::UInt32, FfiValue::Bool(true)), - (ValueKind::Bytes, FfiValue::String("ab".into())), - ( - ValueKind::String, - FfiValue::Bytes(Protected::new(b"ab".to_vec())), - ), - (ValueKind::Array, FfiValue::Object(vec![])), - (ValueKind::Object, FfiValue::Array(vec![])), - (ValueKind::UInt32, FfiValue::Null), - (ValueKind::Bool, FfiValue::Float64(1.0)), + (ValueKind::UInt64, Tree::String("34".into())), + (ValueKind::String, Tree::UInt64(34)), + (ValueKind::Bool, Tree::UInt32(1)), + (ValueKind::UInt32, Tree::Bool(true)), + (ValueKind::Bytes, Tree::String("ab".into())), + (ValueKind::String, Tree::Bytes(b"ab".to_vec())), + (ValueKind::Array, Tree::Object(vec![])), + (ValueKind::Object, Tree::Array(vec![])), + (ValueKind::UInt32, Tree::Null), + (ValueKind::Bool, Tree::Float64(1.0)), ]; for (at, (kind, value)) in refused.into_iter().enumerate() { assert!( diff --git a/packages/stack-encrypt/src/dynamic/mod.rs b/packages/stack-encrypt/src/dynamic/mod.rs index 8466f6bc9..7ccaabf08 100644 --- a/packages/stack-encrypt/src/dynamic/mod.rs +++ b/packages/stack-encrypt/src/dynamic/mod.rs @@ -2,8 +2,7 @@ //! //! Everything else in this crate is typed: a target names its source type, //! and the operations it composes are reached through bounds — `Encrypt` for -//! a ciphertext, [`PrfValue`](vitaminc_prf::PrfValue) for an equality term, -//! `AsRef` for a match term. That is what makes a term a cross-language +//! a ciphertext or an equality term, `AsRef` for a match term. That is what makes a term a cross-language //! contract: `equality_term(34u32)` derives the same bytes wherever it is //! called from, because `34u32` is the same value everywhere. //! @@ -13,13 +12,26 @@ //! the typed operation. This module is that something, written once here //! rather than once per language binding. //! -//! The runtime value is [`FfiValue`], vitaminc's language-neutral value tree -//! and the type every binding already funnels through. +//! A term is derived from anything that describes itself to vitaminc +//! ([`Encrypt`](crate::Encrypt)), walked to its one scalar: a guest +//! walks the transport frame it was handed in place, with no tree built. +//! A plaintext the engine holds is a [`ValueFrame`]: one value as its +//! transport frame, in a buffer wiped when it drops. A record's source is +//! walked once and split into one frame per field; a field is sealed and +//! indexed by walking its frame into the encrypting sink and the term +//! derivers; and a record opens straight into a frame (vitaminc ADR 0001: a +//! value describes itself once, and sinks consume it). A binding's control +//! data (a plan, a context, query statistics) is read from its frame by +//! serde (`vitaminc_aead_frame::serde`) into a typed message, with no tree +//! built. //! //! # What is here //! -//! * [`context`](context()) — an [`FfiValue`] read as an encryption context. -//! * [`term`](term()) — one index term for a value, dispatched on its variant. +//! * [`context`](context()) — a frame read as an encryption context. +//! * [`ValueFrame`] — the engine's plaintext for a value whose type is known +//! only at run time, and the value model it holds. +//! * [`term`](term()) — one index term for a value, derived at the one +//! scalar it is walked to. //! * [`record`] — a fields plan spelled as data, *lowered* into the plan //! builder ([`Plan`](crate::Plan)) and run by the engine: the same code a //! Rust chain and the derive run, so a record written from any language @@ -30,16 +42,21 @@ //! that links them, so a plan field may name one as its target and the //! lowering runs that type's own plan in the same request; [`NoTargets`] //! is the build without them. -//! * [`Value`] — an [`FfiValue`] as a plan field's plaintext, the type of -//! every field lowered from data; [`TermBytes`] — the term such a field -//! derives, as its frozen bytes. +//! * [`TermBytes`] — the term a field lowered from data derives, as its +//! frozen bytes. Such a field's plaintext is a [`ValueFrame`]. +//! * [`query_term`], [`verify`] and [`target_limit`] — a query named by +//! operator ([`OpSpec`]) on a plan field, and a probabilistic term's two +//! questions, over a page of decrypted values and over [`Stats`](crate::op::Stats) +//! (ADR-0009; ADR-0007, amended 2026-10-16), and [`field_operators`], the +//! operators a plan field answers, for a generator to ask before the +//! program runs. //! * [`Scope`] — which cipher an opening operation decrypts through. //! //! # What is not here //! -//! Encrypting a whole value is not: [`FfiValue`] implements `Encrypt` -//! already, so `keyset.encrypt(value, aad)` is the whole of it and needs -//! nothing from this module. Nor is a second executor: nothing here calls +//! Encrypting a whole value is not: a [`ValueFrame`], like any source, +//! implements `Encrypt` already, so `keyset.encrypt(value, aad)` is the whole +//! of it and needs nothing from this module. Nor is a second executor: nothing here calls //! the term functions or the seal path to produce a record. A capability a //! data plan needs and the builder lacks is added to the builder, once. //! @@ -55,11 +72,10 @@ //! //! A plan field's `"type"` names (`"int64"`, `"string"`, …) are wire format //! in the same way: a binding spells them, and a stored row opens only under -//! the type it was sealed as. They are not this crate's: a declared type is -//! vitaminc's [`ValueKind`], re-exported here, whose names vitaminc freezes -//! beside its tag table. This crate adds only what a kind means to an index -//! ([`admits`]) and to a query value ([`read`]); it decides nothing about -//! the bytes ([`record`]). Every field with a term output declares one; +//! the type it was sealed as. A declared type is a [`ValueKind`], whose +//! names are frozen. What a kind means to an index ([`admits`]) and to a +//! query value ([`read`]) is stated over it; the bytes are vitaminc's, from +//! the tagged leaf a value of the kind seals as ([`record`]). Every field with a term output declares one; //! a plan whose indexed field has none is refused when it is built //! ([`Error::UntypedIndex`], naming the field). //! @@ -71,28 +87,29 @@ //! reason, given on the type. mod context; mod kind; +mod query; pub mod record; mod target; mod term; -mod value; +#[cfg(test)] +mod test_frame; +mod value_frame; use std::fmt; pub use context::{borrowed, context}; -pub use kind::{admits, read}; +/// The value kinds, the type a plan field declares in its `"type"` key. A +/// kind's names are frozen wire format; see [`admits`] and [`read`] for what +/// a kind means to this engine. +pub use kind::{admits, not_admitted, read, ParseValueKindError, ValueKind}; +pub use query::{ + check_query, field_operators, query_term, target_limit, verify, Fidelity, OpSpec, Operand, + OperatorEntry, QueryTerm, +}; pub use record::{FieldPlan, Output, Plan}; pub use target::{NoTargets, TargetDescriptor, TargetError, TargetResolver}; -pub use term::{term, Scalar, TermBytes}; -pub use value::Value; -/// vitaminc's language-neutral value tree — the runtime value every binding -/// funnels through. Its transport codec is `vitaminc_aead_value::transport`, -/// which stays the binding's: this crate takes and returns values, never -/// encoded bytes. -pub use vitaminc_aead_value::FfiValue; -/// vitaminc's value kinds: the type a plan field declares in its `"type"` -/// key. Its names are frozen wire format; see [`admits`] and [`read`] for -/// what a kind means to this engine. -pub use vitaminc_aead_value::ValueKind; +pub use term::{term, TermBytes}; +pub use value_frame::{Children, FromFrameError, Modeled, Opening, ValueFrame}; use crate::target::IndexSpec; use crate::{KeysetCipher, StackCipher}; @@ -135,10 +152,13 @@ impl fmt::Debug for Scope<'_, K> { } } -/// The UTF-8 inside a string leaf. Valid by `Utf8String`'s construction -/// invariant; checked rather than assumed because this is boundary code. -fn utf8(s: &vitaminc_aead_value::Utf8String) -> Option<&str> { - std::str::from_utf8(s.risky_ref()).ok() +/// Bytes, written as a frame's bytes leaf rather than a list of integers. +struct WireBytes<'a>(&'a [u8]); + +impl serde::Serialize for WireBytes<'_> { + fn serialize(&self, s: S) -> Result { + s.serialize_bytes(self.0) + } } /// What went wrong in a dynamic operation. @@ -187,9 +207,9 @@ pub enum Error { /// A term was asked for a value the scheme defines no such term for: a /// container, null or passthrough (which have no term semantics at all), - /// or a scalar outside the kind's domain — equality over a float or a - /// boolean, match over anything but text. See - /// [`IndexSpec::supports`]. + /// or a scalar outside the kind's domain — equality over a boolean, + /// match over anything but text, an order term over a boolean. See + /// [`IndexSpec::defines`]. #[error("no {kind} term is defined for this value{}", in_field_text(field))] #[diagnostic(code(stack_encrypt::dynamic_term))] Term { @@ -236,8 +256,12 @@ pub enum Error { /// them), a field the plan does not name, a plan field the source does /// not carry or carries twice, or a passthrough or a repeated map key /// under a field the plan seals, or a value of another type than its - /// field declares. Also a query value that cannot be read as its field's - /// type ([`read`]). + /// field declares. Also a query its field does not answer: an operator + /// the field's type does not answer, an input that cannot be read as the + /// field's type ([`read`]) or is not the pair a range takes, a page of + /// values to verify that holds a value of another type, or statistics + /// or a term that are not what [`target_limit`] reads — the same shape of + /// refusal as a mistyped field, naming the field. #[error( "record source does not fit the plan: {reason}{}", in_field_text(field) @@ -440,10 +464,10 @@ macro_rules! reasons { } reasons! { - /// What was wrong with a context, plan, source or stored record: the reason - /// a dynamic input error carries beside the field it names. + /// What was wrong with a context, plan, source, stored record or query: the + /// reason a dynamic input error carries beside the field it names. /// - /// One vocabulary for all four, since several reasons apply to more than + /// One vocabulary for all five, since several reasons apply to more than /// one (a field given twice is a misfit in a source and in a stored /// record). [`as_str`](Self::as_str) is the `snake_case` name a binding /// reports in its payload's `reason` field; `Display` is the phrase the @@ -458,7 +482,9 @@ reasons! { /// A context value is of a kind a context cannot hold: a boolean, /// float, null, object or passthrough. ContextKind => "context_kind", "a boolean, float, null, object or passthrough cannot be a context"; - /// A context string is not UTF-8. + /// A context string is not UTF-8. No longer produced: a frame's + /// text is UTF-8 by construction. Kept so a binding that switches on + /// it still compiles. ContextNotUtf8 => "context_not_utf8", "a context string is not UTF-8"; /// A context renders empty. EmptyContext => "empty_context", "the context renders empty"; @@ -501,8 +527,13 @@ reasons! { /// `"type"` is not a string naming a value type. UnknownType => "unknown_type", r#""type" does not name a value type"#; /// The field's declared type has no such index: match on an integer, - /// equality on a float, any index on a composite. + /// equality or an order index on a boolean, any index on a composite. IndexNotAdmitted => "index_not_admitted", "the declared type has no such index"; + /// The field declares an ORE or OPE index on a decimal, date or + /// timestamp. Their order terms wait for cllw-ore and ore-rs + /// releases that encode them the ADR-0002 way (#1236); equality on + /// them works today. + OrderTermPending => "order_term_pending", "an order index on a decimal, date or timestamp waits for new cllw-ore and ore-rs releases (#1236)"; /// Two fields are keyed under one identity. SharedIdentity => "shared_identity", "two fields are keyed under one identity"; /// The plan has no field of the name asked for. @@ -526,6 +557,9 @@ reasons! { FieldType => "field_type", "a value is not of the type its field declares"; /// A passthrough sits where a sealed value, or a ciphertext, must be. Passthrough => "passthrough", "a passthrough where a sealed value must be"; + /// A passthrough value cannot be stored as a frame: it nests deeper, + /// or holds text, bytes or a key longer, than a frame carries. + Unframeable => "unframeable", "a passthrough value nests deeper, or holds a longer value, than a frame carries"; /// A stored field is not a map of outputs. OutputsNotMap => "outputs_not_map", "a stored field is not a map of outputs"; /// A stored sealed field has no `"c"` node. @@ -537,6 +571,25 @@ reasons! { /// A stored `"passthrough"` or `"eql"` node is not a passthrough /// carrying a value of the kind it holds. NotPassthrough => "not_passthrough", "a node does not carry a value of the kind it holds"; + /// A plan takes its context from a field of each record, so a query on + /// it has no context: the caller names the context, and sends the plan + /// under it. + QueryContextField => "query_context_field", "the plan takes its context from a field of each record, so a query has none"; + /// An operator name is not one the engine knows ([`OpSpec::parse`]). + UnknownOperator => "unknown_operator", "the operator is not one the engine knows"; + /// The field's type does not answer the operator: no index it declares + /// answers it, or the EQL type it names does not ([`OpSpec::answered_by`]). + OperatorNotAnswered => "operator_not_answered", "the field's type does not answer the operator"; + /// A range's input is not a list of two values. + NotARange => "not_a_range", "a range is not a list of two values"; + /// The operator's answer is exact, so there is nothing to verify and no + /// fetch to size. + ExactOperator => "exact_operator", "the operator's answer is exact, so there is nothing to verify or size"; + /// The term is not one the field's index derives for the operator. + NotAQueryTerm => "not_a_query_term", "the term is not one the field's index derives for the operator"; + /// Statistics are not a row count with an optional histogram and + /// confidence ([`Stats::from_frame`](crate::op::Stats::from_frame)). + NotStats => "not_stats", "the statistics are not a row count with an optional histogram and confidence"; } } diff --git a/packages/stack-encrypt/src/dynamic/query.rs b/packages/stack-encrypt/src/dynamic/query.rs new file mode 100644 index 000000000..bb835c22e --- /dev/null +++ b/packages/stack-encrypt/src/dynamic/query.rs @@ -0,0 +1,2785 @@ +//! Queries named by operator, for a binding. +//! +//! A Rust caller names an operator as a type, `cipher.query(op::Matches, +//! "ali").on(&plan)`, and the compiler finds the index that answers it +//! (ADR-0009). A binding has no type to name: its plan arrives as data and +//! its operator as a string. This module is the runtime form of that query, +//! written once here rather than once per language binding (ADR-0007, +//! amended 2026-10-16): +//! +//! - [`OpSpec`] names an operator, as [`IndexSpec`] names an index, and +//! [`OpSpec::answered_by`] is the table the typed path's `DefaultIndex` +//! impls state: which declared index answers the operator for a field of +//! a kind, if any does. +//! - [`query_term`] derives the query term for a plan field, an operator and +//! its input: the field's own index term for the input, or, for a field +//! that names an EQL type, that type's query value. It refuses an operator +//! the field does not answer as it refuses a value of the wrong type, with +//! [`Error::Source`] naming the field. +//! - [`field_operators`] lists the operators a plan field answers, each with +//! the index that answers it ([`OperatorEntry`] is one's wire form): what a +//! generator asks before the program runs, so it writes one query method +//! per operator the engine answers and holds no copy of the table. +//! - [`verify`] and [`target_limit`] are a probabilistic term's two +//! questions, [`Probabilistic::verify`] and +//! [`Probabilistic::target_limit`], over a page of decrypted values and +//! over [`Stats`]. They run the same code the typed `MatchQuery` runs, with +//! the match index's options read from the plan, and need no key. +//! +//! An exact term has neither question: [`verify`] and [`target_limit`] +//! refuse an exact operator ([`Reason::ExactOperator`]) rather than answer +//! `true` for every row, as the typed path does not compile the call. +//! +//! # Which operators a field answers +//! +//! A field with indexes answers what [`OpSpec::answered_by`] says for its +//! declared kind: `eq` through an equality index, `matches` through a match +//! index over text, and the orderings (`lt`, `lte`, `gt`, `gte`, +//! `between`) through an ORE index over an integer of 16 bits or wider, a +//! float or text, or an OPE index when the field declares no ORE. The typed +//! path's default for an ordering is ORE, and OPE is the typed path's +//! `.via(Ope)`; here a field that declares only OPE is answered through it. +//! Every order term is derived over the value's ADR-0002 order key: a +//! float's ties `-0.0` with `0.0` and sorts every NaN last, and text's is +//! its fold. An ordering over bytes is not answered, as `op::Ordered` does +//! not cover them. Nor is one over an 8-bit integer, which has no order +//! term, or over a decimal, date or timestamp: a plan cannot declare an +//! order index on one yet. +//! +//! A field that names an EQL type answers what its +//! [`TargetDescriptor::operators`] lists: the operators of a single value +//! whose index the type carries, for a type the engine produces and that +//! has a query twin. The term is the twin, which carries every term of the +//! type; one query domain per operator is EQL v4's (ADR-0009, decision 8). +//! `matches` is answered through a type whose descriptor carries its match +//! options ([`TargetDescriptor::with_match_options`]), since [`verify`] +//! must cut the query's tokens as the stored filter was cut: `TextMatch` +//! answers it through `TextMatchQuery`, whose `bf` is the filter, and +//! [`verify`] and [`target_limit`] run under the type's options. A type +//! with a match index and no options answers no probabilistic operator. +//! +//! # Wire format +//! +//! An operator is its [`name`](OpSpec::name). A query term is the object +//! [`QueryTerm`] serializes to, the statistics the frame object +//! [`Stats::from_frame`] reads, and a limit [`Limit::rows`]: an unsigned +//! 64-bit integer, or null for no finite fetch. Each answer is written to a +//! frame by serde (`vitaminc_aead_frame::serde`) and documented on its +//! type. +//! +//! [`Probabilistic::verify`]: crate::op::Probabilistic::verify +//! [`Probabilistic::target_limit`]: crate::op::Probabilistic::target_limit + +use serde::{Serialize, Serializer}; + +use super::WireBytes; +use std::fmt; + +use stack_kms::DataKeySource; + +use super::record::{FieldPlan, Plan}; +use super::term::OneScalar; +use super::term::{derive, Use}; +use super::value_frame::Parts; +use super::ValueKind; +use super::{admits, read, Error, Reason, TargetDescriptor, TargetResolver, ValueFrame}; +use crate::op::{Limit, Stats}; +use crate::sem::{match_limit, MatchOptions, QueryTokens, TermError}; +use crate::target::IndexSpec; +use crate::{KeysetCipher, Pending}; +use vitaminc_aead::plaintext::{Logical, Physical}; +use vitaminc_aead::Encrypt; + +/// An operator, named at run time: the runtime form of the +/// [`op`](crate::op) module's operator types, as [`IndexSpec`] is of the +/// index types. +/// +/// Not `#[non_exhaustive]`, for the reason the [module docs](super#stability) +/// give for [`IndexSpec`]: the names are wire format, and a new operator is +/// one every binding has to be taught. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub enum OpSpec { + /// `"eq"`: [`op::Eq`](struct@crate::op::Eq). + Eq, + /// `"lt"`: [`op::Lt`](crate::op::Lt). + Lt, + /// `"lte"`: [`op::Lte`](crate::op::Lte). + Lte, + /// `"gt"`: [`op::Gt`](crate::op::Gt). + Gt, + /// `"gte"`: [`op::Gte`](crate::op::Gte). + Gte, + /// `"between"`: [`op::Between`](crate::op::Between), whose input is a + /// pair of bounds, low then high, inclusive. + Between, + /// `"matches"`: [`op::Matches`](struct@crate::op::Matches), in the case + /// the field's match index fixes. + Matches, +} + +impl OpSpec { + /// Every operator, in declaration order: the order a catalog lists them + /// in. + pub const ALL: [OpSpec; 7] = [ + OpSpec::Eq, + OpSpec::Lt, + OpSpec::Lte, + OpSpec::Gt, + OpSpec::Gte, + OpSpec::Between, + OpSpec::Matches, + ]; + + /// The operator a name names, or `None` for a name that is not one. + /// Names match exactly: `"eq"`, not `"Eq"` or `"="`. + pub fn parse(name: &str) -> Option { + Self::ALL.into_iter().find(|op| op.name() == name) + } + + /// The operator's wire name. + pub fn name(self) -> &'static str { + match self { + OpSpec::Eq => "eq", + OpSpec::Lt => "lt", + OpSpec::Lte => "lte", + OpSpec::Gt => "gt", + OpSpec::Gte => "gte", + OpSpec::Between => "between", + OpSpec::Matches => "matches", + } + } + + /// How far the server's answer to this operator can be trusted: what + /// the typed path says by the trait the term implements. + pub fn fidelity(self) -> Fidelity { + match self { + OpSpec::Matches => Fidelity::Probabilistic, + _ => Fidelity::Exact, + } + } + + /// Whether the operator takes a pair of values, low then high, rather + /// than one: `between` does. + pub fn takes_pair(self) -> bool { + self == OpSpec::Between + } + + /// The index among `indexes` that answers this operator for a field of + /// `kind`, or `None` when none does: the typed path's `DefaultIndex` + /// table, stated over a kind and the indexes a field declares. + /// + /// ``` + /// use stack_encrypt::dynamic::{OpSpec, ValueKind}; + /// use stack_encrypt::target::IndexSpec; + /// + /// let both = [IndexSpec::Ope, IndexSpec::Ore]; + /// assert_eq!(OpSpec::Lt.answered_by(ValueKind::UInt32, &both), Some(&IndexSpec::Ore)); + /// assert_eq!(OpSpec::Lt.answered_by(ValueKind::String, &both), Some(&IndexSpec::Ore)); + /// assert_eq!(OpSpec::Lt.answered_by(ValueKind::Float32, &both), Some(&IndexSpec::Ore)); + /// assert_eq!(OpSpec::Lt.answered_by(ValueKind::Bytes, &both), None); + /// assert_eq!(OpSpec::Eq.answered_by(ValueKind::UInt32, &both), None); + /// ``` + pub fn answered_by(self, kind: ValueKind, indexes: &[IndexSpec]) -> Option<&IndexSpec> { + let declared = |wanted: fn(&IndexSpec) -> bool| indexes.iter().find(|index| wanted(index)); + match self { + OpSpec::Eq => declared(|index| matches!(index, IndexSpec::Equality)), + OpSpec::Matches => declared(|index| matches!(index, IndexSpec::Match(_))), + OpSpec::Lt | OpSpec::Lte | OpSpec::Gt | OpSpec::Gte | OpSpec::Between => { + if !ordered(kind) { + return None; + } + declared(|index| matches!(index, IndexSpec::Ore)) + .or_else(|| declared(|index| matches!(index, IndexSpec::Ope))) + } + } + .filter(|index| admits(kind, index)) + } +} + +impl fmt::Display for OpSpec { + /// Writes [`name`](Self::name). + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(self.name()) + } +} + +/// The kinds the ordering operators are answered over: the integers of 16 +/// bits and wider, `int16` to `uint128`, the floats and text, as +/// [`op::Ordered`](crate::op::Ordered) covers them in the typed path. Not +/// `int8` or `uint8`, which have no order term. Each orders by its ADR-0002 +/// order key; a `float32` is ordered as the `f64` it widens to, as the +/// typed path asks. +fn ordered(kind: ValueKind) -> bool { + matches!( + kind, + ValueKind::Int16 + | ValueKind::Int32 + | ValueKind::Int64 + | ValueKind::Int128 + | ValueKind::UInt16 + | ValueKind::UInt32 + | ValueKind::UInt64 + | ValueKind::UInt128 + | ValueKind::Float32 + | ValueKind::Float64 + | ValueKind::String + ) +} + +/// How far the server's answer to an operator can be trusted (ADR-0009, +/// decision 4), as a catalog reports it. +/// +/// The typed path says this with traits, not a value: a term that +/// implements [`Probabilistic`](crate::op::Probabilistic) can be verified, +/// and one that does not cannot. A binding's generator asks before the +/// program runs, so it needs the answer as data. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub enum Fidelity { + /// `"exact"`: the server's answer is the answer. + Exact, + /// `"probabilistic"`: the answer can hold false positives and no false + /// negatives; [`verify`] decides each row, and [`target_limit`] sizes + /// the fetch. + Probabilistic, +} + +impl Fidelity { + /// The fidelity's wire name. + pub fn name(self) -> &'static str { + match self { + Fidelity::Exact => "exact", + Fidelity::Probabilistic => "probabilistic", + } + } +} + +/// The operators an EQL type answers, as [`TargetDescriptor::operators`] +/// lists them: none for a type the engine does not produce or that has no +/// query twin, and otherwise every operator of one value that one of the +/// type's indexes answers for its plaintext kind, `matches` only when the +/// type's match options are known. The match index answers under those +/// options. See the [module docs](self#which-operators-a-field-answers). +pub(super) fn target_operators(target: &TargetDescriptor) -> Vec<(OpSpec, IndexSpec)> { + let Some(kind) = target + .plaintext + .filter(|_| target.producible && target.query.is_some()) + else { + return Vec::new(); + }; + let indexes: Vec = target + .indexes + .iter() + .filter_map( + |key| match (IndexSpec::parse(key)?, &target.match_options) { + (IndexSpec::Match(_), Some(options)) => Some(IndexSpec::Match(options.clone())), + (IndexSpec::Match(_), None) => None, + (index, _) => Some(index), + }, + ) + .collect(); + OpSpec::ALL + .into_iter() + .filter(|op| !op.takes_pair()) + .filter_map(|op| { + op.answered_by(kind, &indexes) + .map(|index| (op, index.clone())) + }) + .collect() +} + +/// A query term a binding asked for by operator: the operand to bind in +/// SQL, and what it is. +/// +/// The bytes are not plaintext: an index term, or an EQL query value, which +/// is what the server compares. The query's own tokens, which +/// [`verify`] needs, are plaintext and are not here; [`verify`] cuts them +/// again from the query's input. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct QueryTerm { + operator: OpSpec, + index: IndexSpec, + domain: Option, + operand: Operand, +} + +/// What a [`QueryTerm`] binds. +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum Operand { + /// One term: an index term's frozen bytes ([`TermBytes`](super::TermBytes)), or an EQL + /// query value's JSON bytes. + One(Vec), + /// A range's two terms, each the index term of one bound, inclusive. + Range { + /// The low bound's term. + lo: Vec, + /// The high bound's term. + hi: Vec, + }, +} + +/// The term in its wire form: an object with every key present, an +/// absent value null. +/// +/// | key | value | +/// |---|---| +/// | `operator` | string: the [operator's name](OpSpec::name), `"matches"` | +/// | `fidelity` | string: `"exact"` or `"probabilistic"` ([`Fidelity::name`]) | +/// | `index` | string: the [key](IndexSpec::key) of the index that answers, `"match"` | +/// | `domain` | string or null: the query value's PostgreSQL domain, for a field that names an EQL type | +/// | `term` | bytes: the term, or for `between` a list of two byte strings, the low bound's term then the high's | +impl Serialize for QueryTerm { + fn serialize(&self, s: S) -> Result { + #[derive(Serialize)] + struct Wire<'a> { + operator: &'static str, + fidelity: &'static str, + index: &'static str, + domain: Option<&'a str>, + term: Term<'a>, + } + #[derive(Serialize)] + #[serde(untagged)] + enum Term<'a> { + One(WireBytes<'a>), + Range([WireBytes<'a>; 2]), + } + Wire { + operator: self.operator.name(), + fidelity: self.fidelity().name(), + index: self.index.key(), + domain: self.domain.as_deref(), + term: match &self.operand { + Operand::One(term) => Term::One(WireBytes(term)), + Operand::Range { lo, hi } => Term::Range([WireBytes(lo), WireBytes(hi)]), + }, + } + .serialize(s) + } +} + +impl QueryTerm { + /// The operator the term answers. + pub fn operator(&self) -> OpSpec { + self.operator + } + + /// How far the server's answer to it can be trusted. + pub fn fidelity(&self) -> Fidelity { + self.operator.fidelity() + } + + /// The index that answers the operator for the field. + pub fn index(&self) -> &IndexSpec { + &self.index + } + + /// The PostgreSQL domain the operand is cast to, for a field that names + /// an EQL type; `None` for a field with indexes, whose terms are bytes. + pub fn domain(&self) -> Option<&str> { + self.domain.as_deref() + } + + /// What the term binds. + pub fn operand(&self) -> &Operand { + &self.operand + } +} + +/// The field a query is about, and the index that answers its operator. +struct Answer<'p> { + field: &'p FieldPlan, + kind: ValueKind, + index: IndexSpec, + target: Option, +} + +/// The input of a query, read as its field's kind. +enum Input { + One(ValueFrame), + Pair(ValueFrame, ValueFrame), +} + +/// Find `field` in `plan` and the index that answers `operator` for it. +/// +/// # Errors +/// +/// [`Error::Plan`] for a field the plan does not have +/// ([`Reason::NoSuchField`]), [`Error::Target`] for a target the resolver +/// refuses, and [`Error::Source`] +/// ([`Reason::OperatorNotAnswered`]) for an operator the field does not +/// answer. +fn answer<'p>( + plan: &'p Plan, + field: &str, + operator: OpSpec, + resolver: &(impl TargetResolver + ?Sized), +) -> Result, Error> { + let found = find(plan, field)?; + let not_answered = || Error::Source { + field: Some(field.to_owned()), + reason: Reason::OperatorNotAnswered, + }; + let kind = found.field_type().ok_or_else(not_answered)?; + let (operators, target) = answers(found, resolver)?; + let index = operators + .into_iter() + .find_map(|(op, index)| (op == operator).then_some(index)); + Ok(Answer { + field: found, + kind, + index: index.ok_or_else(not_answered)?, + target, + }) +} + +/// The field named `field`, or [`Error::Plan`] with +/// [`Reason::NoSuchField`]. +fn find<'p>(plan: &'p Plan, field: &str) -> Result<&'p FieldPlan, Error> { + plan.fields() + .iter() + .find(|candidate| candidate.name() == field) + .ok_or_else(|| Error::Plan { + field: Some(field.to_owned()), + reason: Reason::NoSuchField, + }) +} + +/// Operators a field answers, each with the index that answers it. +type Operators = Vec<(OpSpec, IndexSpec)>; + +/// Every operator `field` answers with the index that answers it, and the +/// EQL type it names, resolved: the one table [`answer`] and +/// [`field_operators`] both read, so what a generator is told a field +/// answers is what a query on it finds. +fn answers( + field: &FieldPlan, + resolver: &(impl TargetResolver + ?Sized), +) -> Result<(Operators, Option), Error> { + let Some(kind) = field.field_type() else { + return Ok((Vec::new(), None)); + }; + if let Some(name) = field.target() { + let target = resolver.resolve(name).map_err(Error::Target)?; + return Ok((target_operators(&target), Some(target))); + } + let indexes = field.indexes(); + let operators = OpSpec::ALL + .into_iter() + .filter_map(|op| { + op.answered_by(kind, &indexes) + .map(|index| (op, index.clone())) + }) + .collect(); + Ok((operators, None)) +} + +/// The operators a field of a plan answers, each with the index that +/// answers it, in [`OpSpec::ALL`]'s order: exactly the operators +/// [`query_term`] derives a term for on that field, so a generator asks the +/// engine which query methods to write rather than holding a copy of the +/// table. +/// +/// A field with indexes answers each operator [`OpSpec::answered_by`] finds +/// an index for under its declared kind; a field that names an EQL type +/// answers what the type's [`TargetDescriptor::operators`] lists; a field +/// with no declared kind answers none. The context does not matter, so a +/// plan whose context is a field of each record is taken. Write each entry +/// as an [`OperatorEntry`]. +/// +/// ``` +/// use stack_encrypt::dynamic::{field_operators, record, NoTargets, OpSpec}; +/// use stack_encrypt::target::IndexSpec; +/// +/// let plan = record::plan(&vitaminc_aead_frame::serde::to_vec(&serde_json::json!({ +/// "age": { "context": ["users", "age"], "outputs": ["c", "eq", "ore"], "type": "uint32" }, +/// }))?)?; +/// +/// let operators = field_operators(&plan, "age", &NoTargets)?; +/// assert_eq!(operators[0], (OpSpec::Eq, IndexSpec::Equality)); +/// assert_eq!(operators[1], (OpSpec::Lt, IndexSpec::Ore)); +/// assert_eq!(operators.len(), 6, "eq, the four comparisons and between"); +/// # Ok::<(), Box>(()) +/// ``` +/// +/// # Errors +/// +/// [`Error::Plan`] for a field the plan does not have +/// ([`Reason::NoSuchField`]), and [`Error::Target`] for a target the +/// resolver refuses. +pub fn field_operators( + plan: &Plan, + field: &str, + resolver: &(impl TargetResolver + ?Sized), +) -> Result, Error> { + answers(find(plan, field)?, resolver).map(|(operators, _)| operators) +} + +/// One operator a field answers in its wire form, as a catalog lists it: an +/// object with every key present. +/// +/// | key | value | +/// |---|---| +/// | `operator` | string: the operator's name, `eq` ([`OpSpec::name`]) | +/// | `fidelity` | string: `exact` or `probabilistic` ([`Fidelity::name`]) | +/// | `arity` | string: `one`, or `pair` for an operator whose input is two values, low then high | +/// | `index` | string: the [key](IndexSpec::key) of the index that answers it, `eq` | +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize)] +pub struct OperatorEntry { + operator: &'static str, + fidelity: &'static str, + arity: &'static str, + index: &'static str, +} + +impl OperatorEntry { + /// The entry for `operator`, answered by `index`. + pub fn new(operator: OpSpec, index: &IndexSpec) -> Self { + Self { + operator: operator.name(), + fidelity: operator.fidelity().name(), + arity: if operator.takes_pair() { "pair" } else { "one" }, + index: index.key(), + } + } +} + +/// Refuse a plan whose context is a field of each record: a term derives +/// under a context, and such a plan has none until a record names it, so a +/// binding sends the plan under the context its query names. +/// [`verify`] and [`target_limit`] derive nothing and take such a plan. +fn has_context(plan: &Plan, field: &str) -> Result<(), Error> { + match plan.context_field() { + Some(_) => Err(Error::Plan { + field: Some(field.to_owned()), + reason: Reason::QueryContextField, + }), + None => Ok(()), + } +} + +/// Read a query's input as the field's kind ([`read`]): one value, or for +/// `between` a list of two, low then high. +/// +/// # Errors +/// +/// [`Error::Source`] naming the field: [`Reason::FieldType`] for a value +/// that cannot be read as the kind, [`Reason::NotARange`] for a `between` +/// input that is not a list of two values. +fn read_input(answer: &Answer<'_>, operator: OpSpec, input: impl Encrypt) -> Result { + let name = answer.field.name(); + if !operator.takes_pair() { + return read(answer.kind, input) + .map(Input::One) + .map_err(|error| error.in_field(name)); + } + let one = |value: ValueFrame| read(answer.kind, value).map_err(|error| error.in_field(name)); + let bounds = ValueFrame::of(input) + .and_then(|input| input.parts()) + .map_err(|_| not_a_range(name))?; + match bounds { + Parts::Seq(bounds) => match <[ValueFrame; 2]>::try_from(bounds) { + Ok([lo, hi]) => Ok(Input::Pair(one(lo)?, one(hi)?)), + Err(_) => Err(not_a_range(name)), + }, + _ => Err(not_a_range(name)), + } +} + +fn not_a_range(field: &str) -> Error { + Error::Source { + field: Some(field.to_owned()), + reason: Reason::NotARange, + } +} + +/// The refusals the typed path makes when a query is awaited, before any +/// term exists ([`Supports::check`](crate::op::Supports::check)): match +/// text the index cannot normalize or that cuts no token, and equality +/// text the scheme cannot normalize. Each index's own derivation refuses +/// these again; asking here lets a binding refuse at its boundary. A range +/// whose low bound is above its high bound is not refused: as SQL's +/// `BETWEEN`, it matches nothing. +fn check_input(index: &IndexSpec, input: &Input) -> Result<(), Error> { + let refused = |error: TermError| Error::Cipher(error.into()); + match (index, input) { + // Order text the fold cannot take (a code point unassigned in + // Unicode 16) is refused here, before a term or a keyset, as + // derivation would refuse it after one. + (IndexSpec::Ore | IndexSpec::Ope, Input::One(value)) => { + order_text(value).map_err(refused)?; + } + (IndexSpec::Ore | IndexSpec::Ope, Input::Pair(lo, hi)) => { + order_text(lo).map_err(refused)?; + order_text(hi).map_err(refused)?; + } + (IndexSpec::Match(options), Input::One(value)) => { + query_tokens(value, options).map(drop)?; + } + // Equality text the scheme cannot normalize (a code point + // unassigned in Unicode 16) is refused here, before a term or a + // keyset, as derivation would refuse it after one. + (IndexSpec::Equality, Input::One(value)) => { + crate::sem::normalized(value).map(drop).map_err(refused)?; + } + _ => {} + } + Ok(()) +} + +/// Whether `value`, if it is order text, has a fold: `vitaminc-ore`'s +/// `Text` encoding, the one an order index encrypts, refuses a code point +/// Unicode 16 does not assign. Anything but text has nothing to refuse. +fn order_text(value: &ValueFrame) -> Result<(), TermError> { + value + .visit(OneScalar::new( + |ty: Option, value: Physical<'_>| match (ty, value) { + (None, Physical::Text(text)) => Ok(vitaminc_ore::text(text) + .map(drop) + .map_err(TermError::Normalize)), + _ => Err(None), + }, + )) + // Not one text scalar: nothing to refuse here. + .unwrap_or(Ok(())) +} + +/// The tokens a match query of `value` keeps, under the index's options. +/// +/// # Errors +/// +/// [`Error::Cipher`] with [`TermError::InvalidOptions`] for options the +/// index cannot use (a [`FieldPlan`] built by hand is not +/// checked, and an n-gram length of zero would panic in the tokenizer), +/// [`TermError::Normalize`] for text the index cannot normalize, and +/// [`TermError::EmptyTermText`] for text that cuts no token, whose filter +/// would match every row. [`Error::Internal`] for a value that is not text, +/// which [`read_input`] has ruled out. +fn query_tokens(value: &ValueFrame, options: &MatchOptions) -> Result { + value + .visit(OneScalar::new( + |ty: Option, value: Physical<'_>| match (ty, value) { + // The query chain's rule, from the same helper. + (None, Physical::Text(text)) => Ok(QueryTokens::of_query(text, options) + .map_err(|error| Error::Cipher(error.into()))), + _ => Err(None), + }, + )) + .map_err(|_| Error::Internal)? +} + +/// Check a query without a cipher: everything [`query_term`] refuses before +/// it derives anything. A binding calls this at its boundary, so a bad +/// query is refused before a keyset is resolved. +/// +/// # Errors +/// +/// As [`query_term`]. +pub fn check_query( + plan: &Plan, + field: &str, + operator: OpSpec, + input: impl Encrypt, + resolver: &(impl TargetResolver + ?Sized), +) -> Result<(), Error> { + let answer = answer(plan, field, operator, resolver)?; + has_context(plan, field)?; + let input = read_input(&answer, operator, input)?; + check_input(&answer.index, &input) +} + +/// Derive the query term for one field of a plan, an operator and its +/// input: one value for most operators, a list of two for +/// [`between`](OpSpec::Between). +/// +/// The input is read as the field's declared kind first ([`read`]), so a +/// host's `34` as a float queries a `uint64` field as the `u64` it stored. +/// A field with indexes derives the term of the index that answers the +/// operator ([`OpSpec::answered_by`]) under the field's context, by the +/// derivation its stored terms came from; a range derives one term per +/// bound under that one context. A field that names an EQL type runs the +/// type's query twin through `resolver`. Nothing is requested: the pending +/// settles without I/O, as a typed query's does. +/// +/// # Examples +/// +/// ``` +/// use stack_encrypt::dynamic::{query_term, record, NoTargets, OpSpec, Operand}; +/// use stack_encrypt::kms::FakeDataKeySource; +/// use stack_encrypt::{op, Ore, Plan, StackCipher}; +/// +/// # tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap().block_on(async { +/// let cipher = StackCipher::builder().kms(FakeDataKeySource::new()).init().await?; +/// let keyset = cipher.default_keyset(); +/// let plan = record::plan(&vitaminc_aead_frame::serde::to_vec(&serde_json::json!({ +/// "age": { "context": ["users", "age"], "outputs": ["c", "ore"], "type": "uint32" }, +/// }))?)?; +/// +/// let term = query_term(&keyset, &plan, "age", OpSpec::Lt, 40u32, &NoTargets)?.await?; +/// +/// // The typed path's term for the same query. +/// let typed_plan = Plan::context("users/age").with::(Ore).build()?; +/// let typed = cipher.query(op::Lt, &40u32).on(&typed_plan).await?; +/// assert_eq!(term.operand(), &Operand::One(typed.to_bytes())); +/// # Ok::<(), Box>(()) +/// # }).unwrap(); +/// ``` +/// +/// # Errors +/// +/// [`Error::Plan`] for a field the plan does not have +/// ([`Reason::NoSuchField`]), or a plan that takes its context from a field +/// of each record ([`Reason::QueryContextField`]): a query names the +/// context such a plan's records hold, so a binding sends the plan under +/// that context. [`Error::Source`] naming the field for an operator the +/// field does not answer ([`Reason::OperatorNotAnswered`]), an input that +/// cannot be read as the field's kind ([`Reason::FieldType`]) and a +/// `between` input that is not two values ([`Reason::NotARange`]). +/// [`Error::Cipher`] for the query refusals the typed path makes: match +/// text that cuts no token ([`TermError::EmptyTermText`]), and text the +/// index cannot normalize ([`TermError::Normalize`]). A range whose low +/// bound is above its high bound is not refused: as SQL's `BETWEEN`, it +/// matches nothing. +/// [`Error::Target`] for what the resolver refuses. +pub fn query_term<'a, K>( + cipher: &'a KeysetCipher<'_, K>, + plan: &Plan, + field: &str, + operator: OpSpec, + input: impl Encrypt, + resolver: &(impl TargetResolver + ?Sized), +) -> Result, Error> +where + K: DataKeySource + Sync + 'static, +{ + let answer = answer(plan, field, operator, resolver)?; + has_context(plan, field)?; + let input = read_input(&answer, operator, input)?; + check_input(&answer.index, &input)?; + let index = answer.index.clone(); + let made = move |domain: Option, operand| QueryTerm { + operator, + index, + domain, + operand, + }; + if let Some(target) = answer.target { + let Input::One(value) = input else { + return Err(Error::Internal); + }; + let domain = target.query_sql_domain; + return Ok(super::record::query(cipher, plan, field, value, resolver)? + .map(move |json| made(domain, Operand::One(json)))); + } + let context = answer.field.context(); + let term = |value: &ValueFrame| { + derive(cipher, value, &answer.index, context.clone(), Use::Query) + .map_err(|error| error.in_field(field)) + }; + Ok(match input { + Input::One(value) => { + term(&value)?.map(move |term| made(None, Operand::One(term.into_bytes()))) + } + Input::Pair(lo, hi) => term(&lo)?.zip(term(&hi)?).map(move |(lo, hi)| { + made( + None, + Operand::Range { + lo: lo.into_bytes(), + hi: hi.into_bytes(), + }, + ) + }), + }) +} + +/// The options of the match index that answers a probabilistic operator +/// for the field, and whether the field names an EQL type (whose query +/// term is the twin's JSON rather than the filter's bytes), or the refusal +/// for an exact operator. +fn probabilistic( + plan: &Plan, + field: &str, + operator: OpSpec, + resolver: &(impl TargetResolver + ?Sized), +) -> Result<(MatchOptions, bool), Error> { + let answer = answer(plan, field, operator, resolver)?; + let target = answer.target.is_some(); + // A match index answers `matches` alone, and `matches` is the one + // probabilistic operator, so the index says which this is. + match answer.index { + IndexSpec::Match(options) => Ok((options, target)), + _ => Err(Error::Source { + field: Some(field.to_owned()), + reason: Reason::ExactOperator, + }), + } +} + +/// Whether each of a page of decrypted values really matches a +/// probabilistic query, in order: [`Probabilistic::verify`] for every +/// value, run by the code the typed `MatchQuery` runs, under the options of +/// the field's match index. +/// +/// The query is named as it was derived, by the plan, the field, the +/// operator and the input, and the input's tokens are cut again here: they +/// are plaintext, so no query term carries them across a binding. The +/// result needs no key. +/// +/// A value that does not hold the query's tokens is `false`, and so is a +/// null (a row whose field is empty holds no token), as +/// [`Probabilistic::verify`] is `false` for every outcome but a match. +/// +/// [`Probabilistic::verify`]: crate::op::Probabilistic::verify +/// +/// # Errors +/// +/// As [`query_term`] for the field, the operator and the input, before any +/// value is read, save that a plan whose context is a field of each record +/// is taken, since verifying derives nothing; [`Error::Source`] with +/// [`Reason::ExactOperator`] for an exact operator, which has nothing to +/// verify; and [`Error::Source`] with [`Reason::FieldType`] for a value +/// that is neither a string nor null. +pub fn verify( + plan: &Plan, + field: &str, + operator: OpSpec, + input: impl Encrypt, + values: impl IntoIterator, + resolver: &(impl TargetResolver + ?Sized), +) -> Result, Error> { + let (options, _) = probabilistic(plan, field, operator, resolver)?; + let input = read(ValueKind::String, input).map_err(|error| error.in_field(field))?; + let tokens = query_tokens(&input, &options)?; + // Each value is walked in place to its one scalar: text is checked for + // the query's tokens, a null holds none, and anything else is not a + // value of the field. + values + .into_iter() + .map(|value| { + value + .visit(OneScalar::new( + |ty: Option, value: Physical<'_>| match (ty, value) { + (None, Physical::Text(text)) => Ok(tokens.verify(text, &options)), + (None, Physical::Null) => Ok(false), + _ => Err(None), + }, + )) + .map_err(|_| Error::Source { + field: Some(field.to_owned()), + reason: Reason::FieldType, + }) + }) + .collect() +} + +/// How many rows to fetch so that, at the confidence `stats` names, `want` +/// of them [`verify`]: [`Probabilistic::target_limit`] for the term +/// [`query_term`] derived, run by the code the typed `MatchQuery` runs. +/// +/// `term` is the term's bytes as [`query_term`] returned them, from which +/// the number of bits the query sets is read: a match index term's +/// positions, or for a field that names an EQL type, the `bf` of the query +/// twin's JSON (`TextMatchQuery`). The field's match index +/// declares no `expected_tokens` prior in a data plan, so a [`Stats`] with +/// no measured histogram answers [`Limit::Unbounded`]. The result needs no +/// key. +/// +/// [`Probabilistic::target_limit`]: crate::op::Probabilistic::target_limit +/// +/// # Errors +/// +/// As [`verify`] for the plan, the field and the operator; and +/// [`Error::Source`] with [`Reason::NotAQueryTerm`] for bytes that are not +/// a match query term under the field's options: not whole positions, a +/// position outside the filter, positions out of order or repeated, or +/// none at all. For a field that names an EQL type, the same for the +/// twin's `bf`, and bytes that are not a JSON object holding one. +pub fn target_limit( + plan: &Plan, + field: &str, + operator: OpSpec, + term: &[u8], + want: u64, + stats: &Stats, + resolver: &(impl TargetResolver + ?Sized), +) -> Result { + let (options, target) = probabilistic(plan, field, operator, resolver)?; + let bits = if target { + twin_query_bits(term, &options) + } else { + query_bits(term, &options) + }; + let bits = bits.ok_or_else(|| Error::Source { + field: Some(field.to_owned()), + reason: Reason::NotAQueryTerm, + })?; + Ok(match_limit(bits, &options, None, want, stats)) +} + +/// The number of positions a match query term sets, if `term` is one the +/// index derives under `options`: little-endian `u16` positions, each in +/// the filter, strictly ascending, at least one. +fn query_bits(term: &[u8], options: &MatchOptions) -> Option { + if term.is_empty() || !term.len().is_multiple_of(2) { + return None; + } + let positions: Vec = term + .chunks_exact(2) + .map(|pair| u32::from(u16::from_le_bytes([pair[0], pair[1]]))) + .collect(); + let in_filter = positions.iter().all(|&position| position < options.m); + let ascending = positions.windows(2).all(|pair| pair[0] < pair[1]); + (in_filter && ascending).then_some(positions.len()) +} + +/// The number of positions a match query twin's JSON sets, if `term` is an +/// object whose `bf` holds the positions the type derives under `options`: +/// integers, each in the filter, strictly ascending, at least one. +fn twin_query_bits(term: &[u8], options: &MatchOptions) -> Option { + let value: serde_json::Value = serde_json::from_slice(term).ok()?; + let positions = value + .as_object()? + .get("bf")? + .as_array()? + .iter() + .map(|position| { + position + .as_u64() + .filter(|&position| position < u64::from(options.m)) + }) + .collect::>>()?; + let ascending = positions.windows(2).all(|pair| pair[0] < pair[1]); + (!positions.is_empty() && ascending).then_some(positions.len()) +} + +impl Stats { + /// Read statistics from their wire form, a frame object: + /// + /// | key | value | + /// |---|---| + /// | `rows` | integer, required: the rows the query scans | + /// | `histogram` | optional, or null: a list of `[bits, rows]` pairs of integers, a measured histogram of the stored filters' set-bit counts ([`Stats::measured`]); absent, the declared prior ([`Stats::declared`]) | + /// | `confidence` | optional, or null: a float, the confidence to target instead of 99% ([`Stats::with_confidence`]) | + /// + /// Integers are read at any width up to 64 bits and must not be + /// negative; `bits` must fit a `u32`. A confidence is a float of either + /// width, never an integer. + /// + /// # Errors + /// + /// [`Error::Source`] with [`Reason::NotStats`] for anything else: not a + /// frame, not an object, no `rows`, a key given twice or not one of the + /// three, or a value of another type. + pub fn from_frame(bytes: &[u8]) -> Result { + let wire: StatsWire = vitaminc_aead_frame::serde::from_slice(bytes) + .map_err(|_| Error::bad_source(Reason::NotStats))?; + let stats = match wire.histogram { + Some(histogram) => Stats::measured(wire.rows, histogram), + None => Stats::declared(wire.rows), + }; + Ok(match wire.confidence { + Some(Confidence(confidence)) => stats.with_confidence(confidence), + None => stats, + }) + } +} + +/// [`Stats`] as a binding writes it ([`Stats::from_frame`]). +#[derive(serde::Deserialize)] +#[serde(deny_unknown_fields)] +struct StatsWire { + rows: u64, + #[serde(default)] + histogram: Option>, + #[serde(default)] + confidence: Option, +} + +/// A confidence: a float of either width. serde's own `f64` would also take +/// an integer, which the wire form refuses. +struct Confidence(f64); + +impl<'de> serde::Deserialize<'de> for Confidence { + fn deserialize>(d: D) -> Result { + struct V; + impl serde::de::Visitor<'_> for V { + type Value = Confidence; + fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str("a float") + } + fn visit_f32(self, v: f32) -> Result { + Ok(Confidence(f64::from(v))) + } + fn visit_f64(self, v: f64) -> Result { + Ok(Confidence(v)) + } + } + d.deserialize_any(V) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::dynamic::test_frame::Tree; + use crate::dynamic::test_frame::{frame_of, value_of}; + + fn operator_value(operator: OpSpec, index: &IndexSpec) -> Tree { + value_of(&OperatorEntry::new(operator, index)) + } + + /// Statistics as a binding sends them. + fn stats_frame(value: &Tree) -> Result { + Stats::from_frame(&crate::dynamic::test_frame::frame_of(value)) + } + use crate::dynamic::{record, NoTargets, TargetError}; + use crate::op::{self, Probabilistic as _}; + use crate::sem::MatchTerms; + use crate::{Equality, Label, Match, Ope, Ore, StackCipher}; + use stack_kms::FakeDataKeySource; + + async fn cipher() -> StackCipher { + StackCipher::builder() + .kms(FakeDataKeySource::new()) + .init() + .await + .expect("build cipher") + } + + fn text(s: &str) -> Tree { + Tree::String(s.into()) + } + + fn vf(value: &Tree) -> ValueFrame { + ValueFrame::of(value).expect("a value") + } + + /// One field of `users`, as a binding spells it. + fn field(name: &str, kind: &str, outputs: Vec) -> (String, Tree) { + ( + name.to_owned(), + Tree::Object(vec![ + ( + "context".into(), + Tree::Array(vec![text("users"), text(name)]), + ), + ("outputs".into(), Tree::Array(outputs)), + ("type".into(), text(kind)), + ]), + ) + } + + /// The plan every test queries: an email with equality, a name with + /// match, an age with ORE and OPE, a score with OPE alone, a nickname + /// with ORE over text, and a case-sensitive handle. + fn users() -> Plan { + let case_sensitive = Tree::Object(vec![( + "match".into(), + Tree::Object(vec![("downcase".into(), Tree::Bool(false))]), + )]); + record::plan(&frame_of(&Tree::Object(vec![ + field("email", "string", vec![text("c"), text("eq")]), + field("name", "string", vec![text("c"), text("match")]), + field("age", "uint32", vec![text("c"), text("ope"), text("ore")]), + field("score", "int64", vec![text("ope")]), + field("nickname", "string", vec![text("c"), text("ore")]), + field("handle", "string", vec![text("c"), case_sensitive]), + field("ratio", "float32", vec![text("c"), text("ore")]), + field("rating", "float64", vec![text("c"), text("ope")]), + ]))) + .expect("the plan parses") + } + + async fn query( + keyset: &KeysetCipher<'_, FakeDataKeySource>, + name: &str, + operator: OpSpec, + input: impl Encrypt, + ) -> Result { + query_term(keyset, &users(), name, operator, input, &NoTargets)? + .await + .map_err(Error::Cipher) + } + + fn reason_of(error: &Error) -> (Option<&str>, Option) { + (error.field(), error.reason()) + } + + fn term_error(error: &Error) -> Option<&TermError> { + match error { + Error::Cipher(crate::Error::Term(term)) => Some(term), + _ => None, + } + } + + #[test] + fn an_operator_reads_back_from_its_name_and_no_other() { + for op in OpSpec::ALL { + assert_eq!(OpSpec::parse(op.name()), Some(op), "{op}"); + assert_eq!(op.to_string(), op.name()); + } + let names: std::collections::BTreeSet<&str> = + OpSpec::ALL.iter().map(|op| op.name()).collect(); + assert_eq!(names.len(), OpSpec::ALL.len(), "names are distinct"); + for not_one in ["Eq", "=", "", "contains", "at_path", "matches "] { + assert_eq!(OpSpec::parse(not_one), None, "{not_one:?}"); + } + } + + #[test] + fn only_matches_is_probabilistic_and_only_between_takes_a_pair() { + for op in OpSpec::ALL { + assert_eq!( + op.fidelity() == Fidelity::Probabilistic, + op == OpSpec::Matches, + "{op}" + ); + assert_eq!(op.takes_pair(), op == OpSpec::Between, "{op}"); + } + assert_eq!(Fidelity::Exact.name(), "exact"); + assert_eq!(Fidelity::Probabilistic.name(), "probabilistic"); + } + + /// The typed path's `DefaultIndex` table, over kinds: equality answers + /// `eq`, match answers `matches` over text, and the orderings go to ORE + /// over an integer, or to OPE when there is no ORE. + #[test] + fn the_answering_index_is_the_typed_paths_default() { + let all = [ + IndexSpec::Equality, + IndexSpec::Match(MatchOptions::default()), + IndexSpec::Ope, + IndexSpec::Ore, + ]; + let answered = + |op: OpSpec, kind, indexes: &[IndexSpec]| op.answered_by(kind, indexes).cloned(); + assert_eq!( + answered(OpSpec::Eq, ValueKind::String, &all), + Some(IndexSpec::Equality) + ); + assert_eq!( + answered(OpSpec::Eq, ValueKind::Bool, &all), + None, + "a boolean has no equality term" + ); + assert_eq!( + answered(OpSpec::Matches, ValueKind::String, &all), + Some(IndexSpec::Match(MatchOptions::default())) + ); + assert_eq!(answered(OpSpec::Matches, ValueKind::UInt64, &all), None); + for op in [ + OpSpec::Lt, + OpSpec::Lte, + OpSpec::Gt, + OpSpec::Gte, + OpSpec::Between, + ] { + for kind in [ValueKind::Int8, ValueKind::UInt8, ValueKind::Bool] { + assert_eq!( + answered(op, kind, &all), + None, + "{op} {kind}: an 8-bit integer has no order term, as a boolean has none" + ); + } + for kind in [ + ValueKind::Int16, + ValueKind::Int32, + ValueKind::Int64, + ValueKind::Int128, + ValueKind::UInt16, + ValueKind::UInt32, + ValueKind::UInt64, + ValueKind::UInt128, + ValueKind::Float32, + ValueKind::Float64, + ValueKind::String, + ] { + assert_eq!( + answered(op, kind, &all), + Some(IndexSpec::Ore), + "{op} {kind}" + ); + assert_eq!( + answered(op, kind, &[IndexSpec::Ope]), + Some(IndexSpec::Ope), + "{op} {kind}" + ); + assert_eq!( + answered(op, kind, &[IndexSpec::Equality]), + None, + "{op} {kind}" + ); + } + for kind in [ + ValueKind::Bytes, + ValueKind::Bool, + ValueKind::Decimal, + ValueKind::Date, + ValueKind::Timestamp, + ] { + assert_eq!( + answered(op, kind, &all), + None, + "{op} is not answered over {kind}" + ); + } + } + // A decimal, a date and a timestamp answer `eq` through equality. + for kind in [ValueKind::Decimal, ValueKind::Date, ValueKind::Timestamp] { + assert_eq!( + answered(OpSpec::Eq, kind, &all), + Some(IndexSpec::Equality), + "{kind}" + ); + } + for op in OpSpec::ALL { + assert_eq!( + answered(op, ValueKind::UInt32, &[]), + None, + "no index answers nothing" + ); + } + } + + #[tokio::test] + async fn eq_derives_the_typed_paths_equality_term() { + let cipher = cipher().await; + let keyset = cipher.default_keyset(); + let term = query(&keyset, "email", OpSpec::Eq, text("bob@example.com")) + .await + .unwrap(); + let plan = crate::Plan::context("users/email") + .with::(Equality) + .build() + .unwrap(); + let typed = cipher + .query(op::Eq, "bob@example.com") + .on(&plan) + .await + .unwrap(); + assert_eq!(term.operand(), &Operand::One(typed.to_bytes())); + assert_eq!(term.operator(), OpSpec::Eq); + assert_eq!(term.fidelity(), Fidelity::Exact); + assert_eq!(term.index(), &IndexSpec::Equality); + assert_eq!(term.domain(), None, "a field with indexes binds bytes"); + } + + #[tokio::test] + async fn an_ordering_derives_the_typed_paths_ore_term_and_reads_the_input_as_the_fields_kind() { + let cipher = cipher().await; + let keyset = cipher.default_keyset(); + let plan = crate::Plan::context("users/age") + .with::(Ore) + .build() + .unwrap(); + let typed = cipher.query(op::Lt, &40u32).on(&plan).await.unwrap(); + for input in [Tree::UInt32(40), Tree::Float64(40.0), Tree::Int64(40)] { + let term = query(&keyset, "age", OpSpec::Lt, input).await.unwrap(); + assert_eq!(term.operand(), &Operand::One(typed.to_bytes())); + assert_eq!(term.index(), &IndexSpec::Ore, "ORE before OPE"); + } + } + + #[tokio::test] + async fn between_derives_both_bounds_under_one_context_as_the_typed_range() { + let cipher = cipher().await; + let keyset = cipher.default_keyset(); + let plan = crate::Plan::context("users/age") + .with::(Ore) + .build() + .unwrap(); + let typed = cipher + .query(op::Between, &(18u32, 65)) + .on(&plan) + .await + .unwrap(); + let term = query( + &keyset, + "age", + OpSpec::Between, + Tree::Array(vec![Tree::UInt32(18), Tree::UInt32(65)]), + ) + .await + .unwrap(); + assert_eq!( + term.operand(), + &Operand::Range { + lo: typed.lo().to_bytes(), + hi: typed.hi().to_bytes() + } + ); + let one = query( + &keyset, + "age", + OpSpec::Between, + Tree::Array(vec![Tree::UInt32(7), Tree::UInt32(7)]), + ) + .await; + assert!(one.is_ok(), "(v, v) is one value: {one:?}"); + + let plan = crate::Plan::context("users/score") + .with::(Ope) + .build() + .unwrap(); + let typed = cipher + .query(op::Between, &(-5i64, 5)) + .via(Ope) + .on(&plan) + .await + .unwrap(); + let term = query( + &keyset, + "score", + OpSpec::Between, + Tree::Array(vec![Tree::Int64(-5), Tree::Int64(5)]), + ) + .await + .unwrap(); + assert_eq!( + term.index(), + &IndexSpec::Ope, + "OPE when the field declares no ORE" + ); + assert_eq!( + term.operand(), + &Operand::Range { + lo: typed.lo().to_bytes(), + hi: typed.hi().to_bytes() + } + ); + } + + #[tokio::test] + async fn matches_derives_the_typed_paths_filter() { + let cipher = cipher().await; + let keyset = cipher.default_keyset(); + let plan = crate::Plan::context("users/name") + .with::(Match::default()) + .build() + .unwrap(); + let typed = cipher.query(op::Matches, "alice").on(&plan).await.unwrap(); + let term = query(&keyset, "name", OpSpec::Matches, text("alice")) + .await + .unwrap(); + assert_eq!(term.operand(), &Operand::One(typed.to_bytes())); + assert_eq!(term.fidelity(), Fidelity::Probabilistic); + } + + #[tokio::test] + async fn a_query_the_field_does_not_answer_is_refused_naming_the_field() { + let cipher = cipher().await; + let keyset = cipher.default_keyset(); + let cases = [ + ("name", OpSpec::Eq, text("x"), Reason::OperatorNotAnswered), + ( + "email", + OpSpec::Matches, + text("bob"), + Reason::OperatorNotAnswered, + ), + ( + "nickname", + OpSpec::Eq, + text("bob"), + Reason::OperatorNotAnswered, + ), + ( + "age", + OpSpec::Eq, + Tree::UInt32(1), + Reason::OperatorNotAnswered, + ), + ("age", OpSpec::Lt, text("40"), Reason::FieldType), + ("age", OpSpec::Lt, Tree::Float64(40.5), Reason::FieldType), + ("age", OpSpec::Between, Tree::UInt32(40), Reason::NotARange), + ( + "age", + OpSpec::Between, + Tree::Array(vec![Tree::UInt32(1)]), + Reason::NotARange, + ), + ( + "age", + OpSpec::Between, + Tree::Array(vec![Tree::UInt32(1), text("2")]), + Reason::FieldType, + ), + ]; + for (name, op, input, reason) in cases { + let what = format!("{op} on {name}"); + let error = query(&keyset, name, op, input.clone()).await.unwrap_err(); + assert!(matches!(error, Error::Source { .. }), "{what}: {error:?}"); + assert_eq!(reason_of(&error), (Some(name), Some(reason)), "{what}"); + let checked = check_query(&users(), name, op, input, &NoTargets).unwrap_err(); + assert_eq!( + reason_of(&checked), + (Some(name), Some(reason)), + "{what}: checked alike" + ); + } + let error = query(&keyset, "phone", OpSpec::Eq, text("1")) + .await + .unwrap_err(); + assert!(matches!(error, Error::Plan { .. })); + assert_eq!( + reason_of(&error), + (Some("phone"), Some(Reason::NoSuchField)) + ); + } + + #[tokio::test] + async fn the_typed_paths_query_refusals_are_made_before_any_term() { + let cipher = cipher().await; + let keyset = cipher.default_keyset(); + let one = |text: &str| ValueFrame::of(text).expect("a value"); + let two = |lo: &str, hi: &str| ValueFrame::of(vec![lo, hi]).expect("a value"); + let cases = [ + ("nickname", OpSpec::Lt, one("a\u{0378}"), "normalize"), + ( + "nickname", + OpSpec::Between, + two("a", "b\u{0378}"), + "normalize", + ), + ( + "nickname", + OpSpec::Between, + two("a\u{0378}", "b"), + "normalize", + ), + ("name", OpSpec::Matches, one("al"), "empty"), + ("name", OpSpec::Matches, one("\u{0378}abc"), "normalize"), + ("email", OpSpec::Eq, one("a\u{0378}bc"), "normalize"), + ]; + for (name, op, input, what) in cases { + for error in [ + query(&keyset, name, op, &input).await.unwrap_err(), + check_query(&users(), name, op, &input, &NoTargets).unwrap_err(), + ] { + let term = term_error(&error); + let expected = match what { + "empty" => matches!(term, Some(TermError::EmptyTermText)), + _ => matches!(term, Some(TermError::Normalize(_))), + }; + assert!(expected, "{name} {what}: {error:?}"); + } + } + // The terms of folded equivalents are one term. + let cafe = query(&keyset, "nickname", OpSpec::Lt, "cafe") + .await + .unwrap(); + let folded = query(&keyset, "nickname", OpSpec::Lt, "CAF\u{c9}") + .await + .unwrap(); + assert_eq!(folded.operand, cafe.operand); + + // A float32 orders as the f64 it widens to: `-0.0` ties `0.0`, so + // the two are one term. + let zero = query(&keyset, "ratio", OpSpec::Lt, 0.0f32).await.unwrap(); + let negative_zero = query(&keyset, "ratio", OpSpec::Lt, -0.0f32).await.unwrap(); + assert_eq!(negative_zero.operand, zero.operand); + } + + /// A plan whose context is a field of each record has no context a + /// query could derive under; the binding sends the plan under the + /// context it names. + #[tokio::test] + async fn a_plan_whose_context_is_a_record_field_is_refused() { + let cipher = cipher().await; + let keyset = cipher.default_keyset(); + let one = |name: &str, kind: &str, output: &str| { + ( + name.to_owned(), + Tree::Object(vec![ + ("context".into(), Tree::Array(vec![text(name)])), + ("outputs".into(), Tree::Array(vec![text(output)])), + ("type".into(), text(kind)), + ]), + ) + }; + let plan = record::plan(&frame_of(&Tree::Object(vec![ + ("context_field".into(), text("tenant")), + one("tenant", "string", "passthrough"), + one("email", "string", "eq"), + ]))) + .unwrap(); + let error = query_term(&keyset, &plan, "email", OpSpec::Eq, text("a"), &NoTargets) + .map(drop) + .unwrap_err(); + assert_eq!( + reason_of(&error), + (Some("email"), Some(Reason::QueryContextField)) + ); + let checked = check_query(&plan, "email", OpSpec::Eq, text("a"), &NoTargets).unwrap_err(); + assert_eq!( + reason_of(&checked), + (Some("email"), Some(Reason::QueryContextField)) + ); + // Verifying derives nothing, so it needs no context. + let error = verify( + &plan, + "email", + OpSpec::Eq, + text("a"), + Vec::::new(), + &NoTargets, + ) + .unwrap_err(); + assert_eq!( + reason_of(&error), + (Some("email"), Some(Reason::ExactOperator)), + "refused for its operator, not its context" + ); + } + + /// `verify` is the typed `MatchQuery::verify`, value for value, under + /// the options the field declares, and needs no key. + #[tokio::test] + async fn verify_answers_as_the_typed_match_query() { + let cipher = cipher().await; + let plan = crate::Plan::context("users/name") + .with::(Match::default()) + .build() + .unwrap(); + let typed = cipher.query(op::Matches, "alice").on(&plan).await.unwrap(); + let page = ["Alice Smith", "alicia", "Bob", "MALICE", "", "ali ce"]; + let values: Vec = page.iter().map(|v| text(v)).collect(); + let verified = verify( + &users(), + "name", + OpSpec::Matches, + text("alice"), + &values, + &NoTargets, + ) + .unwrap(); + let expected: Vec = page.iter().map(|v| typed.verify(v)).collect(); + assert_eq!(verified, expected); + assert!( + verified.contains(&true) && verified.contains(&false), + "{verified:?}" + ); + + let nulls = verify( + &users(), + "name", + OpSpec::Matches, + text("alice"), + &[Tree::Null], + &NoTargets, + ) + .unwrap(); + assert_eq!(nulls, [false], "a null holds no token"); + let empty = verify( + &users(), + "name", + OpSpec::Matches, + text("alice"), + Vec::::new(), + &NoTargets, + ) + .unwrap(); + assert!(empty.is_empty()); + } + + #[test] + fn verify_cuts_tokens_under_the_fields_own_options() { + let sensitive = |input: &str, value: &str| { + verify( + &users(), + "handle", + OpSpec::Matches, + text(input), + &[text(value)], + &NoTargets, + ) + .unwrap()[0] + }; + assert!(sensitive("Alice", "Alice")); + assert!( + !sensitive("Alice", "alice"), + "the handle's index does not fold case" + ); + let folding = verify( + &users(), + "name", + OpSpec::Matches, + text("Alice"), + &[text("alice")], + &NoTargets, + ) + .unwrap(); + assert_eq!(folding, [true], "the name's index folds case"); + } + + #[test] + fn verify_refuses_what_it_cannot_answer() { + let refused = |name: &str, op: OpSpec, input: Tree, values: &[Tree]| { + verify(&users(), name, op, input, values, &NoTargets).unwrap_err() + }; + let error = refused("email", OpSpec::Eq, text("a"), &[text("a")]); + assert_eq!( + reason_of(&error), + (Some("email"), Some(Reason::ExactOperator)) + ); + let error = refused("age", OpSpec::Lt, Tree::UInt32(1), &[]); + assert_eq!( + reason_of(&error), + (Some("age"), Some(Reason::ExactOperator)) + ); + let error = refused("email", OpSpec::Matches, text("abc"), &[]); + assert_eq!( + reason_of(&error), + (Some("email"), Some(Reason::OperatorNotAnswered)) + ); + let error = refused("name", OpSpec::Matches, text("alice"), &[Tree::UInt32(1)]); + assert_eq!(reason_of(&error), (Some("name"), Some(Reason::FieldType))); + let error = refused("name", OpSpec::Matches, Tree::UInt32(1), &[]); + assert_eq!(reason_of(&error), (Some("name"), Some(Reason::FieldType))); + let error = refused("name", OpSpec::Matches, text("al"), &[text("al")]); + assert!( + matches!(term_error(&error), Some(TermError::EmptyTermText)), + "{error:?}" + ); + } + + /// Match options on a field plan built by hand are not checked when the + /// plan is, so the query chain refuses them before it cuts a token: an + /// n-gram length of zero would otherwise panic in the tokenizer. + #[test] + fn invalid_match_options_are_refused_before_tokenising() { + let options = MatchOptions { + tokenizer: crate::sem::Tokenizer::Ngram { length: 0 }, + ..MatchOptions::default() + }; + let context = crate::dynamic::context( + &vitaminc_aead_frame::serde::to_vec(&("users", "name")).expect("frames"), + ) + .expect("context"); + let field = FieldPlan::new( + "name", + context, + vec![record::Output::Term(IndexSpec::Match(options))], + ) + .and_then(|field| field.with_type(ValueKind::String)) + .expect("the field"); + let plan = Plan::new(vec![field]).expect("the plan"); + let invalid = |error: Error| { + assert!( + matches!(term_error(&error), Some(TermError::InvalidOptions(_))), + "{error:?}" + ); + }; + invalid( + check_query(&plan, "name", OpSpec::Matches, text("alice"), &NoTargets).unwrap_err(), + ); + invalid( + verify( + &plan, + "name", + OpSpec::Matches, + text("alice"), + &[text("alice")], + &NoTargets, + ) + .unwrap_err(), + ); + } + + /// `target_limit` is the typed `MatchQuery::target_limit` for the term + /// `query_term` returned, read from its bytes. + #[tokio::test] + async fn target_limit_answers_as_the_typed_match_query() { + let cipher = cipher().await; + let keyset = cipher.default_keyset(); + let plan = crate::Plan::context("users/name") + .with::(Match::default()) + .build() + .unwrap(); + let typed = cipher.query(op::Matches, "ali").on(&plan).await.unwrap(); + let term = query(&keyset, "name", OpSpec::Matches, text("ali")) + .await + .unwrap(); + let Operand::One(bytes) = term.operand() else { + panic!("one term"); + }; + let measured = Stats::measured(1_000_000, [(40, 500_000), (120, 500_000)]); + for stats in [ + measured.clone(), + measured.clone().with_confidence(0.5), + Stats::declared(1_000_000), + ] { + let limit = target_limit( + &users(), + "name", + OpSpec::Matches, + bytes, + 10, + &stats, + &NoTargets, + ) + .unwrap(); + assert_eq!(limit, typed.target_limit(10, &stats), "{stats:?}"); + } + assert!(matches!( + target_limit(&users(), "name", OpSpec::Matches, bytes, 10, &measured, &NoTargets), + Ok(Limit::Rows(rows)) if rows > 10 + )); + assert_eq!( + target_limit( + &users(), + "name", + OpSpec::Matches, + bytes, + 10, + &Stats::declared(1_000_000), + &NoTargets + ) + .unwrap(), + Limit::Unbounded, + "a data plan's match index declares no prior" + ); + } + + #[test] + fn target_limit_refuses_a_term_its_index_would_not_derive() { + let stats = Stats::measured(100, [(10, 100)]); + let limit = |name: &str, op: OpSpec, term: &[u8]| { + target_limit(&users(), name, op, term, 1, &stats, &NoTargets) + }; + let positions = |p: &[u16]| p.iter().flat_map(|p| p.to_le_bytes()).collect::>(); + assert!(limit("name", OpSpec::Matches, &positions(&[1, 2, 255])).is_ok()); + for (what, bytes) in [ + ("none", positions(&[])), + ("half a position", vec![1, 0, 2]), + ("outside the filter", positions(&[1, 256])), + ("out of order", positions(&[2, 1])), + ("repeated", positions(&[2, 2])), + ] { + let error = limit("name", OpSpec::Matches, &bytes).unwrap_err(); + assert_eq!( + reason_of(&error), + (Some("name"), Some(Reason::NotAQueryTerm)), + "{what}" + ); + } + let error = limit("email", OpSpec::Eq, &[0; 32]).unwrap_err(); + assert_eq!( + reason_of(&error), + (Some("email"), Some(Reason::ExactOperator)) + ); + // A stored filter under the same options reads as a term too: the + // bytes say nothing of which side derived them, and the limit is a + // number, not a query. + let stored = MatchTerms::::from_positions(vec![3, 9]).unwrap(); + assert!(limit("name", OpSpec::Matches, &stored.to_bytes()).is_ok()); + } + + #[test] + fn statistics_read_from_their_wire_form() { + let object = |entries: Vec<(&str, Tree)>| { + Tree::Object( + entries + .into_iter() + .map(|(k, v)| (k.to_owned(), v)) + .collect(), + ) + }; + let pair = |bits: u32, rows: u64| Tree::Array(vec![Tree::UInt32(bits), Tree::UInt64(rows)]); + assert_eq!( + stats_frame(&object(vec![("rows", Tree::UInt64(9))])).unwrap(), + Stats::declared(9) + ); + assert_eq!( + stats_frame(&object(vec![ + ("rows", Tree::Int64(9)), + ("histogram", Tree::Null), + ("confidence", Tree::Null), + ])) + .unwrap(), + Stats::declared(9) + ); + assert_eq!( + stats_frame(&object(vec![ + ("histogram", Tree::Array(vec![pair(3, 4), pair(5, 6)])), + ("confidence", Tree::Float64(0.9)), + ("rows", Tree::UInt32(10)), + ])) + .unwrap(), + Stats::measured(10, [(3, 4), (5, 6)]).with_confidence(0.9) + ); + for (what, bad) in [ + ("not an object", Tree::UInt64(9)), + ("an array by position", Tree::Array(vec![Tree::UInt64(9)])), + ( + "every key by position", + Tree::Array(vec![ + Tree::UInt64(9), + Tree::Array(vec![pair(3, 4)]), + Tree::Float64(0.5), + ]), + ), + ("no rows", object(vec![])), + ("null rows", object(vec![("rows", Tree::Null)])), + ("negative rows", object(vec![("rows", Tree::Int64(-1))])), + ("float rows", object(vec![("rows", Tree::Float64(9.0))])), + ( + "rows twice", + object(vec![("rows", Tree::UInt64(1)), ("rows", Tree::UInt64(1))]), + ), + ( + "unknown key", + object(vec![("rows", Tree::UInt64(1)), ("want", Tree::Null)]), + ), + ( + "bucket not a pair", + object(vec![ + ("rows", Tree::UInt64(1)), + ("histogram", Tree::Array(vec![Tree::UInt32(3)])), + ]), + ), + ( + "bits too wide", + object(vec![ + ("rows", Tree::UInt64(1)), + ( + "histogram", + Tree::Array(vec![Tree::Array(vec![ + Tree::UInt64(u64::from(u32::MAX) + 1), + Tree::UInt64(1), + ])]), + ), + ]), + ), + ( + "confidence as text", + object(vec![ + ("rows", Tree::UInt64(1)), + ("confidence", text("high")), + ]), + ), + ( + "confidence as an integer", + object(vec![ + ("rows", Tree::UInt64(1)), + ("confidence", Tree::UInt64(1)), + ]), + ), + ] { + let error = stats_frame(&bad).unwrap_err(); + assert_eq!(reason_of(&error), (None, Some(Reason::NotStats)), "{what}"); + } + } + + /// The new kinds query as the typed path does: an `int8` field's + /// orderings are the typed `i8` ORE terms, whatever integer width the + /// host sends; an `int128` field's range is the typed `i128` range; a + /// date, timestamp and decimal answer `eq` with the equality term the + /// record path stores; and an integer reads as a decimal, so `34` + /// finds `34.00`. + #[tokio::test] + async fn the_new_kinds_derive_the_typed_paths_terms() { + use vitaminc_aead::plaintext::{Int, Logical, Physical, Raw, TimeUnit}; + let cipher = cipher().await; + let keyset = cipher.default_keyset(); + let plan = record::plan(&frame_of(&Tree::Object(vec![ + field("tiny", "int16", vec![text("c"), text("ore")]), + field("huge", "int128", vec![text("c"), text("ope")]), + field("day", "date", vec![text("c"), text("eq")]), + field("at", "timestamp", vec![text("c"), text("eq")]), + field("price", "decimal", vec![text("c"), text("eq")]), + ]))) + .expect("the plan parses"); + let frame = |ty: Option, value: Physical<'_>| { + ValueFrame::of(Raw(ty, value)).expect("a value") + }; + let int = |int: Int| frame(None, Physical::Int(int)); + let ask = |name: &'static str, operator: OpSpec, input: ValueFrame| { + let plan = &plan; + let keyset = &keyset; + async move { + query_term(keyset, plan, name, operator, input, &NoTargets)? + .await + .map_err(Error::Cipher) + } + }; + + let tiny = crate::Plan::context("users/tiny") + .with::(Ore) + .build() + .unwrap(); + let typed = cipher.query(op::Lt, &-8i16).on(&tiny).await.unwrap(); + for input in [ + int(Int::I8(-8)), + vf(&Tree::Int64(-8)), + vf(&Tree::Float64(-8.0)), + ] { + let term = ask("tiny", OpSpec::Lt, input).await.unwrap(); + assert_eq!(term.operand(), &Operand::One(typed.to_bytes())); + } + let refused = ask("tiny", OpSpec::Lt, vf(&Tree::Int64(70_000))).await; + assert!( + matches!(&refused, Err(error) if reason_of(error) == (Some("tiny"), Some(Reason::FieldType))), + "70000 is no int16: {refused:?}" + ); + + let huge = crate::Plan::context("users/huge") + .with::(Ope) + .build() + .unwrap(); + let typed = cipher + .query(op::Between, &(i128::MIN, i128::MAX)) + .via(Ope) + .on(&huge) + .await + .unwrap(); + let bounds = ValueFrame::of(vec![ + Raw(None, Physical::Int(Int::I128(i128::MIN))), + Raw(None, Physical::Int(Int::I128(i128::MAX))), + ]) + .unwrap(); + let term = ask("huge", OpSpec::Between, bounds).await.unwrap(); + assert_eq!( + term.operand(), + &Operand::Range { + lo: typed.lo().to_bytes(), + hi: typed.hi().to_bytes(), + } + ); + let inverted = ValueFrame::of(vec![ + Raw(None, Physical::Int(Int::I128(1))), + Raw(None, Physical::Int(Int::I128(0))), + ]) + .unwrap(); + assert!( + ask("huge", OpSpec::Between, inverted).await.is_ok(), + "an inverted 128-bit range is not refused" + ); + + let stored = |value: &ValueFrame, name: &'static str| { + let keyset = &keyset; + let ctx = super::super::context( + &vitaminc_aead_frame::serde::to_vec(&("users", name)).expect("frames"), + ) + .expect("context"); + let value = value.clone(); + async move { + super::super::term(keyset, &value, &IndexSpec::Equality, ctx) + .await + .unwrap() + } + }; + let day = frame(Some(Logical::Date), Physical::Int(Int::I32(19_782))); + let term = ask("day", OpSpec::Eq, day.clone()).await.unwrap(); + assert_eq!(term.operand(), &Operand::One(stored(&day, "day").await)); + let at = frame( + Some(Logical::Timestamp(TimeUnit::Nanos)), + Physical::Int(Int::I128(1_760_662_923_123_456_789)), + ); + let term = ask("at", OpSpec::Eq, at.clone()).await.unwrap(); + assert_eq!(term.operand(), &Operand::One(stored(&at, "at").await)); + let price = frame( + Some(Logical::Decimal { scale: 2 }), + Physical::Int(Int::I64(3400)), + ); + let thirty_four = stored(&price, "price").await; + for input in [ + frame( + Some(Logical::Decimal { scale: 0 }), + Physical::Int(Int::I64(34)), + ), + vf(&Tree::Int32(34)), + int(Int::U8(34)), + ] { + let term = ask("price", OpSpec::Eq, input).await.unwrap(); + assert_eq!( + term.operand(), + &Operand::One(thirty_four.clone()), + "34 is 34.00" + ); + } + for (name, operator) in [ + ("day", OpSpec::Lt), + ("at", OpSpec::Gt), + ("price", OpSpec::Between), + ] { + let refused = ask(name, operator, vf(&Tree::Int32(1))).await; + assert!( + matches!(&refused, Err(error) if reason_of(error) == (Some(name), Some(Reason::OperatorNotAnswered))), + "{name} answers no ordering: {refused:?}" + ); + } + let operators = |name: &str| { + field_operators(&plan, name, &NoTargets) + .unwrap() + .into_iter() + .map(|(op, _)| op) + .collect::>() + }; + assert_eq!(operators("day"), [OpSpec::Eq]); + assert_eq!(operators("price"), [OpSpec::Eq]); + assert_eq!( + operators("tiny"), + [ + OpSpec::Lt, + OpSpec::Lte, + OpSpec::Gt, + OpSpec::Gte, + OpSpec::Between + ] + ); + } + + /// A range whose low bound is above its high bound is not refused, as + /// SQL's `BETWEEN` is not: it is checked, and its terms derived, like + /// any other range, and matches nothing. + #[tokio::test] + async fn an_inverted_range_is_a_query_like_any_other() { + let cipher = cipher().await; + let keyset = cipher.default_keyset(); + // `score` declares OPE alone, whose terms compare as bytes. + let inverted = Tree::Array(vec![Tree::Int64(65), Tree::Int64(18)]); + assert!(check_query( + &users(), + "score", + OpSpec::Between, + vf(&inverted), + &NoTargets + ) + .is_ok()); + let term = query(&keyset, "score", OpSpec::Between, inverted) + .await + .expect("derived"); + let Operand::Range { lo, hi } = term.operand() else { + panic!("a range"); + }; + assert!(lo > hi, "the bounds as given, and the terms in their order"); + } + + #[test] + fn a_count_is_read_at_any_width_and_never_negative() { + let rows = |value: Tree| stats_frame(&Tree::Object(vec![("rows".into(), value)])); + for value in [ + Tree::Int32(7), + Tree::Int64(7), + Tree::UInt32(7), + Tree::UInt64(7), + ] { + assert_eq!(rows(value).unwrap(), Stats::declared(7)); + } + for value in [Tree::Int32(-7), Tree::Int64(-7), Tree::Float64(7.0)] { + assert!(rows(value).is_err()); + } + let confidence = stats_frame(&Tree::Object(vec![ + ("rows".into(), Tree::Int32(3)), + ("confidence".into(), Tree::Float32(0.5)), + ])) + .unwrap(); + assert_eq!(confidence, Stats::declared(3).with_confidence(0.5)); + } + + #[test] + fn a_limit_is_its_rows_or_null() { + assert!(matches!( + value_of(&Limit::Rows(11).rows()), + Tree::UInt64(11) + )); + assert!(matches!(value_of(&Limit::Unbounded.rows()), Tree::Null)); + } + + #[tokio::test] + async fn a_query_term_writes_every_key_in_order() { + let cipher = cipher().await; + let keyset = cipher.default_keyset(); + let term = query( + &keyset, + "age", + OpSpec::Between, + Tree::Array(vec![Tree::UInt32(1), Tree::UInt32(2)]), + ) + .await + .unwrap(); + let Tree::Object(entries) = value_of(&term) else { + panic!("an object"); + }; + let keys: Vec<&str> = entries.iter().map(|(k, _)| k.as_str()).collect(); + assert_eq!(keys, ["operator", "fidelity", "index", "domain", "term"]); + assert!(matches!(&entries[0].1, Tree::String(s) if s.as_bytes() == b"between")); + assert!(matches!(&entries[1].1, Tree::String(s) if s.as_bytes() == b"exact")); + assert!(matches!(&entries[2].1, Tree::String(s) if s.as_bytes() == b"ore")); + assert!(matches!(&entries[3].1, Tree::Null)); + let Operand::Range { lo, hi } = term.operand() else { + panic!("a range"); + }; + assert!(matches!( + &entries[4].1, + Tree::Array(bounds) if matches!( + bounds.as_slice(), + [Tree::Bytes(l), Tree::Bytes(h)] if l.as_slice() == lo && h.as_slice() == hi + ) + )); + } + + fn descriptor( + kind: Option, + indexes: &[&str], + query: bool, + producible: bool, + ) -> TargetDescriptor { + TargetDescriptor::new( + "Some", + "some", + "", + kind, + "public.some", + indexes.iter().map(|i| (*i).to_owned()).collect(), + query.then(|| "SomeQuery".to_owned()), + query.then(|| "eql_v3.query_some".to_owned()), + producible, + (!producible).then(|| "not yet".to_owned()), + ) + } + + /// A type answers the exact operators of one value its indexes answer, + /// and only once the engine produces it and it has a query twin. + #[test] + fn a_target_answers_the_exact_single_value_operators_of_its_indexes() { + let string = Some(ValueKind::String); + let int = Some(ValueKind::Int64); + assert_eq!( + descriptor(string, &["eq"], true, true).operators(), + [OpSpec::Eq] + ); + assert_eq!( + descriptor(int, &["eq", "ore"], true, true).operators(), + [OpSpec::Eq, OpSpec::Lt, OpSpec::Lte, OpSpec::Gt, OpSpec::Gte], + "no between: the twin is one value" + ); + assert!( + descriptor(string, &["match"], true, true) + .operators() + .is_empty(), + "no probabilistic operator until the descriptor carries the index's options" + ); + let options = eql_match(); + let with_options = + descriptor(string, &["match"], true, true).with_match_options(options.clone()); + assert_eq!(with_options.operators(), [OpSpec::Matches]); + assert_eq!( + target_operators(&with_options), + [(OpSpec::Matches, IndexSpec::Match(options))], + "the type's match index answers under the type's options" + ); + assert!(descriptor(string, &["eq"], true, false) + .operators() + .is_empty()); + assert!(descriptor(string, &["eq"], false, true) + .operators() + .is_empty()); + assert!(descriptor(None, &["eq"], true, true).operators().is_empty()); + assert!(descriptor(Some(ValueKind::Object), &["json"], true, true) + .operators() + .is_empty()); + } + + #[test] + fn a_targets_operators_are_listed_in_its_wire_form() { + let Tree::Object(entries) = + value_of(&descriptor(Some(ValueKind::Int64), &["ore"], true, true)) + else { + panic!("an object"); + }; + let (key, Tree::Array(operators)) = &entries[10] else { + panic!("a list"); + }; + assert_eq!(key, "operators"); + assert_eq!(operators.len(), 4); + let Tree::Object(first) = &operators[0] else { + panic!("an object"); + }; + let first: Vec<(&str, &[u8])> = first + .iter() + .map(|(k, v)| match v { + Tree::String(s) => (k.as_str(), s.as_bytes()), + _ => panic!("{k} is a string"), + }) + .collect(); + assert_eq!( + first, + [ + ("operator", b"lt".as_slice()), + ("fidelity", b"exact".as_slice()), + ("arity", b"one".as_slice()), + ("index", b"ore".as_slice()) + ] + ); + } + + /// What a field is said to answer is what a query on it finds: every + /// listed operator derives a term through the listed index, and every + /// other is refused as not answered. + #[tokio::test] + async fn a_fields_operators_are_exactly_the_queries_it_answers() { + let cipher = cipher().await; + let keyset = cipher.default_keyset(); + let input = |kind: &str, op: OpSpec| { + let one = if kind == "string" { + text("alice smith") + } else { + Tree::UInt32(7) + }; + if op.takes_pair() { + Tree::Array(vec![one.clone(), one]) + } else { + one + } + }; + for (name, kind, want) in [ + ("email", "string", vec![(OpSpec::Eq, IndexSpec::Equality)]), + ( + "name", + "string", + vec![(OpSpec::Matches, IndexSpec::Match(MatchOptions::default()))], + ), + ( + "age", + "uint32", + vec![ + (OpSpec::Lt, IndexSpec::Ore), + (OpSpec::Lte, IndexSpec::Ore), + (OpSpec::Gt, IndexSpec::Ore), + (OpSpec::Gte, IndexSpec::Ore), + (OpSpec::Between, IndexSpec::Ore), + ], + ), + ( + "nickname", + "string", + vec![ + (OpSpec::Lt, IndexSpec::Ore), + (OpSpec::Lte, IndexSpec::Ore), + (OpSpec::Gt, IndexSpec::Ore), + (OpSpec::Gte, IndexSpec::Ore), + (OpSpec::Between, IndexSpec::Ore), + ], + ), + ] { + let listed = field_operators(&users(), name, &NoTargets).unwrap(); + assert_eq!(listed, want, "{name}"); + for op in OpSpec::ALL { + let found = query(&keyset, name, op, input(kind, op)).await; + match (listed.iter().find(|(listed, _)| *listed == op), found) { + (Some((_, index)), Ok(term)) => { + assert_eq!(term.index(), index, "{name} {op}"); + } + (Some(_), Err(error)) => panic!("{name} {op} is listed and refused: {error}"), + (None, Ok(_)) => panic!("{name} {op} is not listed and answered"), + (None, Err(error)) => assert_eq!( + reason_of(&error), + (Some(name), Some(Reason::OperatorNotAnswered)), + "{name} {op}" + ), + } + } + } + } + + #[test] + fn a_field_the_plan_lacks_has_no_operators() { + let error = field_operators(&users(), "phone", &NoTargets).unwrap_err(); + assert_eq!( + reason_of(&error), + (Some("phone"), Some(Reason::NoSuchField)) + ); + } + + #[test] + fn an_operator_is_written_with_every_key_in_order() { + let Tree::Object(entries) = operator_value(OpSpec::Between, &IndexSpec::Ope) else { + panic!("an object"); + }; + let entries: Vec<(&str, &[u8])> = entries + .iter() + .map(|(k, v)| match v { + Tree::String(s) => (k.as_str(), s.as_bytes()), + _ => panic!("{k} is a string"), + }) + .collect(); + assert_eq!( + entries, + [ + ("operator", b"between".as_slice()), + ("fidelity", b"exact".as_slice()), + ("arity", b"pair".as_slice()), + ("index", b"ope".as_slice()) + ] + ); + let Tree::Object(entries) = + operator_value(OpSpec::Matches, &IndexSpec::Match(MatchOptions::default())) + else { + panic!("an object"); + }; + assert!(matches!(&entries[1].1, Tree::String(s) if s.as_bytes() == b"probabilistic")); + assert!(matches!(&entries[2].1, Tree::String(s) if s.as_bytes() == b"one")); + } + + /// EQL's match options: not the default, so a test that passes under + /// them did not fall back to the default by mistake. + fn eql_match() -> MatchOptions { + MatchOptions { + k: 6, + m: 2048, + ..MatchOptions::default() + } + } + + /// A resolver holding one type with a match index built under + /// [`eql_match`], whose query twin is a fixed JSON value with a `bf`. + struct MatchType; + + impl TargetResolver for MatchType { + fn targets(&self) -> Vec { + vec![descriptor(Some(ValueKind::String), &["match"], true, true) + .with_match_options(eql_match())] + } + fn encrypt<'a, K: 'static>( + &self, + _: &str, + _: &'a KeysetCipher<'_, K>, + _: &Label, + _: ValueFrame, + ) -> Result, K>, TargetError> { + unreachable!("a query encrypts nothing") + } + fn decrypt<'a, K: 'static>( + &self, + _: &str, + _: &'a crate::StackCipher, + _: &Label, + _: &[u8], + ) -> Result, TargetError> { + unreachable!("a query decrypts nothing") + } + fn query<'a, K: 'static>( + &self, + _: &str, + keyset: &'a KeysetCipher<'_, K>, + _: &Label, + _: ValueFrame, + ) -> Result, K>, TargetError> { + Ok(Pending::ready(keyset, Ok(br#"{"bf":[1,5,2047]}"#.to_vec()))) + } + } + + fn match_type_plan() -> Plan { + record::plan_with( + &frame_of(&Tree::Object(vec![( + "name".into(), + Tree::Object(vec![ + ( + "context".into(), + Tree::Array(vec![text("users"), text("name")]), + ), + ("target".into(), text("Some")), + ]), + )])), + &MatchType, + ) + .unwrap() + } + + /// A type whose match options are known answers `matches` through its + /// twin: the term is the twin's JSON under its query domain, the + /// query's refusals come first, and `verify` and `target_limit` run + /// under the type's options, reading the twin's `bf`. + #[tokio::test] + async fn a_target_with_match_options_answers_matches_through_its_twin() { + let cipher = cipher().await; + let keyset = cipher.default_keyset(); + let plan = match_type_plan(); + assert_eq!( + field_operators(&plan, "name", &MatchType).unwrap(), + [(OpSpec::Matches, IndexSpec::Match(eql_match()))] + ); + let term = query_term( + &keyset, + &plan, + "name", + OpSpec::Matches, + text("Alice"), + &MatchType, + ) + .unwrap() + .await + .unwrap(); + assert_eq!( + term.operand(), + &Operand::One(br#"{"bf":[1,5,2047]}"#.to_vec()) + ); + assert_eq!(term.domain(), Some("eql_v3.query_some")); + assert_eq!(term.fidelity(), Fidelity::Probabilistic); + + // Text that cuts no token is refused before the twin is asked for. + let error = query_term( + &keyset, + &plan, + "name", + OpSpec::Matches, + text("al"), + &MatchType, + ) + .map(drop) + .unwrap_err(); + assert!( + matches!( + error, + Error::Cipher(crate::Error::Term(TermError::EmptyTermText)) + ), + "{error:?}" + ); + let error = query_term( + &keyset, + &plan, + "name", + OpSpec::Eq, + text("Alice"), + &MatchType, + ) + .map(drop) + .unwrap_err(); + assert_eq!( + reason_of(&error), + (Some("name"), Some(Reason::OperatorNotAnswered)) + ); + + assert_eq!( + verify( + &plan, + "name", + OpSpec::Matches, + text("ALICE"), + &[text("say alice nguyen"), text("alison"), Tree::Null], + &MatchType, + ) + .unwrap(), + [true, false, false] + ); + + let stats = Stats::declared(1_000_000); + let options = eql_match(); + assert_eq!( + target_limit( + &plan, + "name", + OpSpec::Matches, + br#"{"bf":[1,5,2047]}"#, + 10, + &stats, + &MatchType + ) + .unwrap(), + match_limit(3, &options, None, 10, &stats), + "three positions read from the twin's bf" + ); + for refused in [ + br#"{"bf":[]}"#.as_slice(), + br#"{"bf":[5,1]}"#, + br#"{"bf":[5,5]}"#, + br#"{"bf":[1,2048]}"#, + br#"{"bf":[-1]}"#, + br#"{"hm":"00"}"#, + br#"[1,5]"#, + &[1, 0, 5, 0], + ] { + let error = target_limit( + &plan, + "name", + OpSpec::Matches, + refused, + 10, + &stats, + &MatchType, + ) + .unwrap_err(); + assert_eq!( + reason_of(&error), + (Some("name"), Some(Reason::NotAQueryTerm)), + "{}", + String::from_utf8_lossy(refused) + ); + } + } + + /// A resolver holding one type that answers `eq`, whose query is a + /// fixed JSON value: what a target field's query term carries. + struct OneType; + + impl TargetResolver for OneType { + fn targets(&self) -> Vec { + vec![descriptor(Some(ValueKind::String), &["eq"], true, true)] + } + fn encrypt<'a, K: 'static>( + &self, + _: &str, + _: &'a KeysetCipher<'_, K>, + _: &Label, + _: ValueFrame, + ) -> Result, K>, TargetError> { + unreachable!("a query encrypts nothing") + } + fn decrypt<'a, K: 'static>( + &self, + _: &str, + _: &'a crate::StackCipher, + _: &Label, + _: &[u8], + ) -> Result, TargetError> { + unreachable!("a query decrypts nothing") + } + fn query<'a, K: 'static>( + &self, + _: &str, + keyset: &'a KeysetCipher<'_, K>, + _: &Label, + _: ValueFrame, + ) -> Result, K>, TargetError> { + Ok(Pending::ready(keyset, Ok(br#"{"hm":"00"}"#.to_vec()))) + } + } + + #[tokio::test] + async fn a_target_field_answers_with_its_types_query_and_domain() { + let cipher = cipher().await; + let keyset = cipher.default_keyset(); + let plan = record::plan_with( + &frame_of(&Tree::Object(vec![( + "email".into(), + Tree::Object(vec![ + ( + "context".into(), + Tree::Array(vec![text("users"), text("email")]), + ), + ("target".into(), text("Some")), + ]), + )])), + &OneType, + ) + .unwrap(); + let term = query_term(&keyset, &plan, "email", OpSpec::Eq, text("a"), &OneType) + .unwrap() + .await + .unwrap(); + assert_eq!(term.operand(), &Operand::One(br#"{"hm":"00"}"#.to_vec())); + assert_eq!(term.domain(), Some("eql_v3.query_some")); + assert_eq!(term.index(), &IndexSpec::Equality); + assert_eq!( + field_operators(&plan, "email", &OneType).unwrap(), + [(OpSpec::Eq, IndexSpec::Equality)], + "a target field answers what its type lists" + ); + for op in [OpSpec::Lt, OpSpec::Matches, OpSpec::Between] { + let error = query_term(&keyset, &plan, "email", op, text("a"), &OneType) + .map(drop) + .unwrap_err(); + assert_eq!( + reason_of(&error), + (Some("email"), Some(Reason::OperatorNotAnswered)), + "{op}" + ); + } + let error = verify( + &plan, + "email", + OpSpec::Eq, + text("a"), + Vec::::new(), + &OneType, + ) + .unwrap_err(); + assert_eq!( + reason_of(&error), + (Some("email"), Some(Reason::ExactOperator)) + ); + } +} + +/// The engine's answers, pinned byte for byte: these are the frames the +/// Tree encoders wrote before the answers were written by serde, and a +/// binding reads them. +#[cfg(test)] +mod wire_bytes { + use super::*; + use crate::sem::{MatchOptions, Tokenizer}; + use vitaminc_aead_frame::serde::to_vec; + + fn hex(value: &T) -> String { + to_vec(value) + .expect("frames") + .iter() + .map(|b| format!("{b:02x}")) + .collect() + } + + fn indexes() -> Vec { + vec![ + IndexSpec::Equality, + IndexSpec::Match(MatchOptions::default()), + IndexSpec::Match(MatchOptions { + tokenizer: Tokenizer::Standard, + downcase: false, + k: 4, + m: 512, + }), + IndexSpec::Match(MatchOptions { + tokenizer: Tokenizer::Ngram { length: 4 }, + ..MatchOptions::default() + }), + IndexSpec::Ore, + IndexSpec::Ope, + ] + } + + fn descriptor( + kind: Option, + indexes: &[&str], + query: bool, + producible: bool, + ) -> TargetDescriptor { + TargetDescriptor::new( + "Some", + "some", + "", + kind, + "public.some", + indexes.iter().map(|i| (*i).to_owned()).collect(), + query.then(|| "SomeQuery".to_owned()), + query.then(|| "eql_v3.query_some".to_owned()), + producible, + (!producible).then(|| "not yet".to_owned()), + ) + } + + /// Every index, and every operator entry under it; three query terms, + /// one a range and one with a domain; four limits; three pages of + /// verdicts; four catalog entries. + #[test] + fn every_answer_writes_its_pinned_bytes() { + let mut written = Vec::new(); + for index in indexes() { + written.push(hex(&index)); + for op in OpSpec::ALL { + written.push(hex(&OperatorEntry::new(op, &index))); + } + } + for term in [ + QueryTerm { + operator: OpSpec::Eq, + index: IndexSpec::Equality, + domain: None, + operand: Operand::One(vec![1, 2, 3]), + }, + QueryTerm { + operator: OpSpec::Between, + index: IndexSpec::Ope, + domain: Some("eql_v4.query_int".to_owned()), + operand: Operand::Range { + lo: vec![4], + hi: vec![5, 6], + }, + }, + QueryTerm { + operator: OpSpec::Matches, + index: IndexSpec::Match(MatchOptions::default()), + domain: None, + operand: Operand::One(Vec::new()), + }, + ] { + written.push(hex(&term)); + } + for limit in [ + Limit::Rows(0), + Limit::Rows(11), + Limit::Rows(u64::MAX), + Limit::Unbounded, + ] { + written.push(hex(&limit.rows())); + } + for page in [vec![], vec![true], vec![true, false, true]] { + written.push(hex(&page)); + } + for target in [ + descriptor(Some(ValueKind::String), &["eq", "match"], true, true), + descriptor(Some(ValueKind::String), &["eq", "match"], true, true) + .with_match_options(MatchOptions::default()), + descriptor(Some(ValueKind::Int64), &["ore"], true, true), + descriptor(None, &[], false, false), + ] { + written.push(hex(&target)); + } + assert_eq!(written, PINNED); + } + + const PINNED: [&str; 62] = [ + "0a020000006571", + "f104000000080000006f70657261746f720a02000000657108000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a020000006571", + "f104000000080000006f70657261746f720a020000006c7408000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a020000006571", + "f104000000080000006f70657261746f720a030000006c746508000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a020000006571", + "f104000000080000006f70657261746f720a02000000677408000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a020000006571", + "f104000000080000006f70657261746f720a0300000067746508000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a020000006571", + "f104000000080000006f70657261746f720a070000006265747765656e08000000666964656c6974790a0500000065786163740500000061726974790a040000007061697205000000696e6465780a020000006571", + "f104000000080000006f70657261746f720a070000006d61746368657308000000666964656c6974790a0d00000070726f626162696c69737469630500000061726974790a030000006f6e6505000000696e6465780a020000006571", + "0a050000006d61746368", + "f104000000080000006f70657261746f720a02000000657108000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a050000006d61746368", + "f104000000080000006f70657261746f720a020000006c7408000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a050000006d61746368", + "f104000000080000006f70657261746f720a030000006c746508000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a050000006d61746368", + "f104000000080000006f70657261746f720a02000000677408000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a050000006d61746368", + "f104000000080000006f70657261746f720a0300000067746508000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a050000006d61746368", + "f104000000080000006f70657261746f720a070000006265747765656e08000000666964656c6974790a0500000065786163740500000061726974790a040000007061697205000000696e6465780a050000006d61746368", + "f104000000080000006f70657261746f720a070000006d61746368657308000000666964656c6974790a0d00000070726f626162696c69737469630500000061726974790a030000006f6e6505000000696e6465780a050000006d61746368", + "f101000000050000006d61746368f10400000009000000746f6b656e697a65720a080000007374616e6461726408000000646f776e6361736502010000006b070400000000000000010000006d070002000000000000", + "f104000000080000006f70657261746f720a02000000657108000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a050000006d61746368", + "f104000000080000006f70657261746f720a020000006c7408000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a050000006d61746368", + "f104000000080000006f70657261746f720a030000006c746508000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a050000006d61746368", + "f104000000080000006f70657261746f720a02000000677408000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a050000006d61746368", + "f104000000080000006f70657261746f720a0300000067746508000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a050000006d61746368", + "f104000000080000006f70657261746f720a070000006265747765656e08000000666964656c6974790a0500000065786163740500000061726974790a040000007061697205000000696e6465780a050000006d61746368", + "f104000000080000006f70657261746f720a070000006d61746368657308000000666964656c6974790a0d00000070726f626162696c69737469630500000061726974790a030000006f6e6505000000696e6465780a050000006d61746368", + "f101000000050000006d61746368f10400000009000000746f6b656e697a6572f101000000050000006e6772616d07040000000000000008000000646f776e6361736503010000006b070300000000000000010000006d070001000000000000", + "f104000000080000006f70657261746f720a02000000657108000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a050000006d61746368", + "f104000000080000006f70657261746f720a020000006c7408000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a050000006d61746368", + "f104000000080000006f70657261746f720a030000006c746508000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a050000006d61746368", + "f104000000080000006f70657261746f720a02000000677408000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a050000006d61746368", + "f104000000080000006f70657261746f720a0300000067746508000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a050000006d61746368", + "f104000000080000006f70657261746f720a070000006265747765656e08000000666964656c6974790a0500000065786163740500000061726974790a040000007061697205000000696e6465780a050000006d61746368", + "f104000000080000006f70657261746f720a070000006d61746368657308000000666964656c6974790a0d00000070726f626162696c69737469630500000061726974790a030000006f6e6505000000696e6465780a050000006d61746368", + "0a030000006f7265", + "f104000000080000006f70657261746f720a02000000657108000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a030000006f7265", + "f104000000080000006f70657261746f720a020000006c7408000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a030000006f7265", + "f104000000080000006f70657261746f720a030000006c746508000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a030000006f7265", + "f104000000080000006f70657261746f720a02000000677408000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a030000006f7265", + "f104000000080000006f70657261746f720a0300000067746508000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a030000006f7265", + "f104000000080000006f70657261746f720a070000006265747765656e08000000666964656c6974790a0500000065786163740500000061726974790a040000007061697205000000696e6465780a030000006f7265", + "f104000000080000006f70657261746f720a070000006d61746368657308000000666964656c6974790a0d00000070726f626162696c69737469630500000061726974790a030000006f6e6505000000696e6465780a030000006f7265", + "0a030000006f7065", + "f104000000080000006f70657261746f720a02000000657108000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a030000006f7065", + "f104000000080000006f70657261746f720a020000006c7408000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a030000006f7065", + "f104000000080000006f70657261746f720a030000006c746508000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a030000006f7065", + "f104000000080000006f70657261746f720a02000000677408000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a030000006f7065", + "f104000000080000006f70657261746f720a0300000067746508000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a030000006f7065", + "f104000000080000006f70657261746f720a070000006265747765656e08000000666964656c6974790a0500000065786163740500000061726974790a040000007061697205000000696e6465780a030000006f7065", + "f104000000080000006f70657261746f720a070000006d61746368657308000000666964656c6974790a0d00000070726f626162696c69737469630500000061726974790a030000006f6e6505000000696e6465780a030000006f7065", + "f105000000080000006f70657261746f720a02000000657108000000666964656c6974790a05000000657861637405000000696e6465780a02000000657106000000646f6d61696e00040000007465726d0b03000000010203", + "f105000000080000006f70657261746f720a070000006265747765656e08000000666964656c6974790a05000000657861637405000000696e6465780a030000006f706506000000646f6d61696e0a1000000065716c5f76342e71756572795f696e74040000007465726df0020000000b01000000040b020000000506", + "f105000000080000006f70657261746f720a070000006d61746368657308000000666964656c6974790a0d00000070726f626162696c697374696305000000696e6465780a050000006d6174636806000000646f6d61696e00040000007465726d0b00000000", + "070000000000000000", + "070b00000000000000", + "07ffffffffffffffff", + "00", + "f000000000", + "f00100000003", + "f003000000030203", + "f10b000000040000006e616d650a04000000536f6d650600000066616d696c790a04000000736f6d65060000007375666669780a0000000009000000706c61696e746578740a06000000737472696e670a00000073716c5f646f6d61696e0a0b0000007075626c69632e736f6d6507000000696e6465786573f0020000000a0200000065710a050000006d617463680500000071756572790a09000000536f6d6551756572791000000071756572795f73716c5f646f6d61696e0a1100000065716c5f76332e71756572795f736f6d650a00000070726f64756369626c650306000000726561736f6e00090000006f70657261746f7273f001000000f104000000080000006f70657261746f720a02000000657108000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a020000006571", + "f10b000000040000006e616d650a04000000536f6d650600000066616d696c790a04000000736f6d65060000007375666669780a0000000009000000706c61696e746578740a06000000737472696e670a00000073716c5f646f6d61696e0a0b0000007075626c69632e736f6d6507000000696e6465786573f0020000000a0200000065710a050000006d617463680500000071756572790a09000000536f6d6551756572791000000071756572795f73716c5f646f6d61696e0a1100000065716c5f76332e71756572795f736f6d650a00000070726f64756369626c650306000000726561736f6e00090000006f70657261746f7273f002000000f104000000080000006f70657261746f720a02000000657108000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a020000006571f104000000080000006f70657261746f720a070000006d61746368657308000000666964656c6974790a0d00000070726f626162696c69737469630500000061726974790a030000006f6e6505000000696e6465780a050000006d61746368", + "f10b000000040000006e616d650a04000000536f6d650600000066616d696c790a04000000736f6d65060000007375666669780a0000000009000000706c61696e746578740a05000000696e7436340a00000073716c5f646f6d61696e0a0b0000007075626c69632e736f6d6507000000696e6465786573f0010000000a030000006f72650500000071756572790a09000000536f6d6551756572791000000071756572795f73716c5f646f6d61696e0a1100000065716c5f76332e71756572795f736f6d650a00000070726f64756369626c650306000000726561736f6e00090000006f70657261746f7273f004000000f104000000080000006f70657261746f720a020000006c7408000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a030000006f7265f104000000080000006f70657261746f720a030000006c746508000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a030000006f7265f104000000080000006f70657261746f720a02000000677408000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a030000006f7265f104000000080000006f70657261746f720a0300000067746508000000666964656c6974790a0500000065786163740500000061726974790a030000006f6e6505000000696e6465780a030000006f7265", + "f10b000000040000006e616d650a04000000536f6d650600000066616d696c790a04000000736f6d65060000007375666669780a0000000009000000706c61696e74657874000a00000073716c5f646f6d61696e0a0b0000007075626c69632e736f6d6507000000696e6465786573f000000000050000007175657279001000000071756572795f73716c5f646f6d61696e000a00000070726f64756369626c650206000000726561736f6e0a070000006e6f7420796574090000006f70657261746f7273f000000000", + ]; +} diff --git a/packages/stack-encrypt/src/dynamic/record.rs b/packages/stack-encrypt/src/dynamic/record.rs index 0093b9f53..262e1c53c 100644 --- a/packages/stack-encrypt/src/dynamic/record.rs +++ b/packages/stack-encrypt/src/dynamic/record.rs @@ -86,10 +86,12 @@ //! //! # What a field's `"type"` decides, and what it does not //! -//! Every field lowered from data is a [`Value`]: its plaintext type is the -//! runtime value itself, and it seals in vitaminc's self-describing tagged -//! leaf encoding (`[tag] ++ payload`) whatever its declared `"type"`. The -//! type decides which indexes the field admits ([`admits`]), which values it +//! Every field lowered from data is a [`ValueFrame`]: its plaintext type is +//! the runtime value itself, held as its transport frame and walked in place +//! into the encrypting sink, and it seals in vitaminc's self-describing +//! tagged leaf encoding (`[tag] ++ payload`) whatever its declared +//! `"type"`. The +//! type decides which indexes the field admits ([`admits`](super::admits)), which values it //! seals and which it opens to (checked by kind, both ways), and nothing //! about the bytes: declaring a type on a field written without one changes //! no leaf. A field with any index declares its type, and a plan whose @@ -99,27 +101,17 @@ //! whatever tag each value arrived with (`34` sent once as a float and once //! as an integer would otherwise store two terms under one field). A field //! that only seals, or only carries its value through, may leave the type -//! out. A field's terms dispatch on the value's variant — the declared kind, -//! once checked — to the typed term operation, so they are the bytes a Rust -//! `u32` or `String` field derives under the same label. +//! out. A field's terms derive at the value's one scalar — of the declared +//! kind, once checked — by the typed path's derivation, so they are the +//! bytes a Rust `u32` or `String` field derives under the same label. //! -//! The ciphertext is where a data plan and a Rust chain over bare types part: -//! a Rust `u32` field seals four bare bytes and a `String` field its bare -//! UTF-8, a `Value` seals the tagged leaf, and the two encodings cannot be -//! told apart by inspection — a bare string that begins with U+000A is a -//! valid tagged string, and a tagged string is a valid bare one with a line -//! feed in front — so neither reader can refuse the other's leaf and a -//! mis-declared one may read as changed plaintext rather than fail. The -//! lowering therefore never chooses an encoding from the type. A Rust record -//! whose rows a binding must open declares its fields as [`Value`] -//! (`encrypt_index(pick("age", |u: &User| &u.age), (IndexSpec::Equality, -//! IndexSpec::Ore))` over a `Value` field is the same declaration as the -//! data plan's, and the two interchange, leaves included — see -//! `tests/record_lowering.rs`); a Rust `u32` field shares a data field's -//! terms and nothing else. Closing that gap — one leaf encoding both authors -//! read, or the encoding bound into the leaf's context so the wrong reader -//! fails closed — is a change to the Rust chain's bytes, and so a decision -//! tracked in #1118, not something the lowering can take on its own. +//! The ciphertext is where a data plan and a Rust chain meet too. Since +//! vitaminc ADR 0001 every leaf is tagged, a typed Rust value's as much as +//! a [`ValueFrame`]'s, so a Rust `u32` field and a `uint32` data field seal +//! the same leaf under the same context, and each opens the other's. A reader +//! of another type refuses a leaf rather than reading it as changed +//! plaintext: the tag is authenticated. The lowering still never chooses an +//! encoding from the type; it no longer has one to choose. //! //! # The stored record is wire format //! @@ -147,17 +139,26 @@ //! reported as a successful decrypt. The encrypt-side refusal is what makes //! that a round-trip invariant rather than data loss. -use vitaminc_aead_value::{FfiValue, ValueKind}; -use vitaminc_protected::Controlled; +use super::value_frame::{split_rows, FieldFault, SourceRow, SourceRows}; +use std::fmt; + +use serde::de::{Deserializer, MapAccess, Visitor}; +use serde::Deserialize; + +use super::term::{IndexWire, MatchWire}; +use super::{ValueFrame, ValueKind}; +use vitaminc_aead::frame::{Frame, FrameWriter}; +use vitaminc_aead::plaintext::{Logical, MapSink, Physical, SeqSink, Sink}; +use vitaminc_aead::{DecodeError, Encrypt}; +use vitaminc_protected::{Controlled, Protected}; use super::{ - admits, utf8, Error, NoTargets, Reason, Scalar, Scope, TargetError, TargetResolver, TermBytes, - Value, + not_admitted, Error, NoTargets, Reason, Scope, TargetError, TargetResolver, TermBytes, }; use crate::plan::{FieldValues, FieldsBuilder, Opens, Runs}; use crate::target::{CallerContext, DeclaredContext, Decryption, Encrypted, IndexSpec}; use crate::{ - BoxedPassthrough, CipherText, ContextPiece, KeysetCipher, Label, NonEmpty, Pending, + CipherText, ContextPiece, KeysetCipher, Label, NonEmpty, PassthroughFrame, Pending, StackCipherText, }; @@ -187,8 +188,7 @@ pub enum Output { impl Output { /// The output a bare key names, or `None` for a key that is not one. A /// `"match"` key names the match index under default options; a plan - /// spells other options in the object form [`from_value`](Self::from_value) - /// reads. + /// spells other options in the object form (see [`plan`]). pub fn parse(s: &str) -> Option { match s { "c" => Some(Output::Ciphertext), @@ -197,20 +197,6 @@ impl Output { } } - /// Read one entry of a plan's `"outputs"` list: `"c"`, `"passthrough"`, - /// or an index in its wire form ([`IndexSpec::from_value`]; see [`plan`]). - /// - /// # Errors - /// - /// [`Error::Plan`] for anything else. - pub fn from_value(value: &FfiValue) -> Result { - match value { - FfiValue::String(s) if utf8(s) == Some("c") => Ok(Output::Ciphertext), - FfiValue::String(s) if utf8(s) == Some("passthrough") => Ok(Output::Passthrough), - _ => IndexSpec::from_value(value).map(Output::Term), - } - } - /// The map key this output rides under. pub fn key(&self) -> &'static str { match self { @@ -238,7 +224,7 @@ enum Verb { /// A field may declare the type of its values (a [`ValueKind`]), and must /// when it has a term output: [`Plan::new_with`] refuses the plan otherwise /// ([`Error::UntypedIndex`]). A typed field admits only the indexes that -/// kind is defined for ([`admits`], checked when the plan is built), seals +/// kind is defined for ([`admits`](super::admits), checked when the plan is built), seals /// only values of that kind and opens only to one (checked per value), so /// the engine verifies what a binding hands it rather than trusting the /// binding's tagging. A field that only seals, or only carries its value @@ -351,15 +337,18 @@ impl FieldPlan { /// # Errors /// /// [`Error::Plan`] if the field asks for an index the kind is not - /// defined for ([`admits`]): match on an integer, equality on a float, - /// any index on a composite. + /// defined for ([`admits`](super::admits)), with the reason [`not_admitted`] gives: + /// [`Reason::IndexNotAdmitted`] for match on an integer, equality or an + /// order index on a boolean, any index on a composite; + /// [`Reason::OrderTermPending`] for an order index on a decimal, date or + /// timestamp, which waits for #1236. pub fn with_type(mut self, field_type: ValueKind) -> Result { for output in &self.outputs { if let Output::Term(index) = output { - if !admits(field_type, index) { + if let Some(reason) = not_admitted(field_type, index) { return Err(Error::Plan { field: Some(self.name.clone()), - reason: Reason::IndexNotAdmitted, + reason, }); } } @@ -440,7 +429,7 @@ impl FieldPlan { } /// The indexes the field declares, in output order. - fn indexes(&self) -> Vec { + pub(super) fn indexes(&self) -> Vec { self.outputs .iter() .filter_map(|output| match output { @@ -556,9 +545,11 @@ fn refusal(error: crate::Error) -> (Option, Reason) { P::IndexNotDeclared { field, .. } | P::IndexOptions { field, .. } => { (Some(field), Reason::Refused) } - P::IdentityWithoutField | P::MixedCiphers | P::TwoContextSources { .. } | P::NoContext => { - (None, Reason::Refused) - } + P::IdentityWithoutField + | P::MixedCiphers + | P::MatchCase { .. } + | P::TwoContextSources { .. } + | P::NoContext => (None, Reason::Refused), } } @@ -852,7 +843,7 @@ impl Plan { /// /// Built afresh per call: a built plan is bound to its key source type, /// and a declaration is not. Every field is declared by name, as a - /// [`Value`], read out of the [`FieldValues`] the source is converted + /// [`ValueFrame`], read out of the [`FieldValues`] the source is split /// into. A context field is declared through the builder's own /// `context_field`, which carries it as a passthrough and reads it as /// the context; the loop then skips it. @@ -860,7 +851,7 @@ impl Plan { let mut builder = match &self.context { Context::Label(label) => crate::Plan::context(label.clone()).fields::(), Context::Field(name) => { - crate::Plan::fields::().context_field::(name.as_str()) + crate::Plan::fields::().context_field::(name.as_str()) } }; for field in &self.fields { @@ -898,38 +889,40 @@ impl Plan { } } -/// One field's verb, over a [`Value`]; its indexes are the [`IndexSpec`]s -/// the plan named, each an [`Index`] of a `Value`. +/// One field's verb, over a [`ValueFrame`]; its indexes are the +/// [`IndexSpec`]s the plan named, each an [`Index`](crate::target::Index) of +/// a `ValueFrame`. fn declare( builder: FieldsBuilder, field: &FieldPlan, ) -> FieldsBuilder { let name = field.name.as_str(); match field.verb() { - Verb::Encrypt => builder.encrypt::(name), - Verb::EncryptIndex => builder.encrypt_index::(name, field.indexes()), - Verb::Index => builder.index::(name, field.indexes()), - Verb::Passthrough => builder.passthrough::(name), + Verb::Encrypt => builder.encrypt::(name), + Verb::EncryptIndex => builder.encrypt_index::(name, field.indexes()), + Verb::Index => builder.index::(name, field.indexes()), + Verb::Passthrough => builder.passthrough::(name), // `lower` never hands a target field here: the resolver runs it. Verb::Target => builder, } } -/// Read a record plan from a decoded value, for a build without EQL types: +/// Read a record plan from its frame, for a build without EQL types: /// [`plan_with`] under [`NoTargets`], so a field that names a `"target"` is /// refused ([`TargetError::NoTargets`]). /// /// # Errors /// /// As [`plan_with`]. -pub fn plan(value: FfiValue) -> Result { - plan_with(value, &NoTargets) +pub fn plan(frame: &[u8]) -> Result { + plan_with(frame, &NoTargets) } -/// Read a record plan from a decoded value, resolving each target field's -/// name through `resolver`. +/// Read a record plan from its frame, resolving each target field's name +/// through `resolver`. /// -/// The plan is an [`FfiValue::Object`]: +/// The plan is a frame object, read by serde +/// (`vitaminc_aead_frame::serde`): /// /// ```text /// { : { "context": , "outputs": [ "c" | "passthrough" | , ... ], "type": }, ... } @@ -974,7 +967,7 @@ pub fn plan(value: FfiValue) -> Result { /// a power of two in `32..=65536`, a zero n-gram length), is refused. The /// other three indexes have no options and no object form. A field names /// each output key at most once, so it carries at most one match index. -/// [`IndexSpec::to_value`] writes this form and [`IndexSpec::from_value`] +/// [`IndexSpec`] serializes to this form and [`IndexSpec::from_frame`] /// reads it. `"passthrough"` is a field's only output when it has it. /// /// [`MatchOptions::default`]: crate::sem::MatchOptions::default @@ -990,7 +983,7 @@ pub fn plan(value: FfiValue) -> Result { /// is built ([`Error::UntypedIndex`], naming the field). It is optional on a /// field whose only output is `"c"` or /// `"passthrough"`, and on a target field, whose kind is the EQL type's own. -/// Declared, it is checked against the field's outputs here ([`admits`]) and +/// Declared, it is checked against the field's outputs here ([`admits`](super::admits)) and /// decides nothing about the bytes (see the /// [module docs](self#what-a-fields-type-decides-and-what-it-does-not)). /// @@ -1001,31 +994,19 @@ pub fn plan(value: FfiValue) -> Result { /// # Examples /// /// ``` -/// use stack_encrypt::dynamic::{record, FfiValue, NoTargets, Output}; +/// use stack_encrypt::dynamic::{record, NoTargets, Output}; /// use stack_encrypt::target::IndexSpec; /// -/// // As a binding would decode it from its caller: seal `age` under the -/// // label users/age and index it for equality. -/// let plan = record::plan_with(FfiValue::Object(vec![( -/// "age".to_string(), -/// FfiValue::Object(vec![ -/// ( -/// "context".to_string(), -/// FfiValue::Array(vec![ -/// FfiValue::String("users".into()), -/// FfiValue::String("age".into()), -/// ]), -/// ), -/// ( -/// "outputs".to_string(), -/// FfiValue::Array(vec![ -/// FfiValue::String("c".into()), -/// FfiValue::String("eq".into()), -/// ]), -/// ), -/// ("type".to_string(), FfiValue::String("uint32".into())), -/// ]), -/// )]), &NoTargets)?; +/// // As a binding sends it: seal `age` under the label users/age and index +/// // it for equality. +/// let frame = vitaminc_aead_frame::serde::to_vec(&serde_json::json!({ +/// "age": { +/// "context": ["users", "age"], +/// "outputs": ["c", "eq"], +/// "type": "uint32", +/// }, +/// }))?; +/// let plan = record::plan_with(&frame, &NoTargets)?; /// /// assert_eq!(plan.fields().len(), 1); /// assert_eq!(plan.fields()[0].name(), "age"); @@ -1034,139 +1015,304 @@ pub fn plan(value: FfiValue) -> Result { /// plan.fields()[0].outputs(), /// [Output::Ciphertext, Output::Term(IndexSpec::Equality)] /// ); -/// # Ok::<(), stack_encrypt::dynamic::Error>(()) +/// # Ok::<(), Box>(()) /// ``` /// /// # Errors /// -/// [`Error::Plan`] for a plan that is not an object of field specs, an -/// empty plan, a field named twice, a spec with a key other than -/// `"context"`, `"outputs"`, `"target"` and `"type"` or with one given -/// twice, missing `"context"`, having neither `"outputs"` nor `"target"` -/// or having both, an output list that is not a list of outputs (above), -/// is empty, names an output key twice or names `"passthrough"` beside -/// another output, a `"target"` that is not a non-empty string, a `"type"` -/// that is not a string naming a [`ValueKind`], a type that does not admit -/// one of the field's index outputs, a context that is not a label of at -/// least two segments (optionally extended), fields under different -/// contexts or extensions, or a plan the builder refuses ([`Plan::new`]); -/// with `"context_field"`, a value that is not a string, given twice, -/// naming no field of the plan, or a plan [`Plan::with_context_field`] -/// refuses. [`Error::UntypedIndex`], naming the field, for a field with a -/// term output and no `"type"`. [`Error::Context`] for a `"context"` that -/// is present but is not a context at all, or renders empty. -/// [`Error::Target`] for a target the resolver refuses ([`Plan::new_with`]). -/// -/// The transport codec refuses duplicate object keys before a binding's -/// value reaches here, but an [`FfiValue`] can be built with them directly -/// and this is a public parser, so it refuses them itself rather than -/// letting the last one win. -pub fn plan_with( - value: FfiValue, - resolver: &(impl TargetResolver + ?Sized), -) -> Result { - let FfiValue::Object(entries) = value else { - return Err(Error::bad_plan(Reason::NotAnObject)); - }; - let mut fields: Vec = Vec::with_capacity(entries.len()); - let mut context_field: Option = None; - for (name, spec) in entries { - if name == "context_field" { - // Reserved: the plan-level key, never a field. A second one, or - // one that is not a string, is refused rather than read as a - // field spec. - if context_field.is_some() { - return Err(Error::bad_plan(Reason::RepeatedKey)); - } - let FfiValue::String(s) = &spec else { - return Err(Error::bad_plan(Reason::ContextField)); - }; - let s = utf8(s).ok_or(Error::bad_plan(Reason::ContextField))?; - context_field = Some(s.to_owned()); - continue; - } - let refuse = |reason| Error::Plan { +/// [`Error::Plan`] for a plan that is not an object of field specs +/// (including bytes that are not one frame, which is how a field or key +/// given twice is refused: the frame refuses it), an empty plan, a spec with +/// a key other than `"context"`, `"outputs"`, `"target"` and `"type"`, +/// missing `"context"`, having neither `"outputs"` nor `"target"` or having +/// both, an output list that is not a list of outputs (above), is empty, +/// names an output key twice or names `"passthrough"` beside another +/// output, a `"target"` that is not a non-empty string, a `"type"` that is +/// not a string naming a [`ValueKind`], a type that does not admit one of +/// the field's index outputs, a context that is not a label of at least two +/// segments (optionally extended), fields under different contexts or +/// extensions, or a plan the builder refuses ([`Plan::new`]); with +/// `"context_field"`, a value that is not a string, naming no field of the +/// plan, or a plan [`Plan::with_context_field`] refuses. +/// [`Error::UntypedIndex`], naming the field, for a field with a term output +/// and no `"type"`. [`Error::Context`] for a `"context"` that is present but +/// is not a context at all, or renders empty. [`Error::Target`] for a +/// target the resolver refuses ([`Plan::new_with`]). +pub fn plan_with(frame: &[u8], resolver: &(impl TargetResolver + ?Sized)) -> Result { + let wire: PlanWire = + vitaminc_aead_frame::serde::from_slice(frame).map_err(|e| plan_refusal(&e, frame))?; + let mut fields: Vec = Vec::with_capacity(wire.fields.len()); + for (name, spec) in wire.fields { + let spec = FieldSpec::try_from(spec).map_err(|reason| Error::Plan { field: Some(name.clone()), reason, + })?; + let context = super::context::non_empty(spec.context.0).map_err(|e| e.in_field(&name))?; + let field = match spec.what { + What::Outputs(outputs) => FieldPlan::new(name, context, outputs)?, + What::Target(target) => FieldPlan::with_target(name, context, target)?, }; - let FfiValue::Object(spec) = spec else { - return Err(refuse(Reason::NotAnObject)); - }; - let mut context: Option>> = None; - let mut outputs: Option> = None; - let mut target: Option = None; - let mut field_type: Option = None; - for (key, value) in spec { - match key.as_str() { - "context" if context.is_none() => { - context = Some(super::context(value).map_err(|error| error.in_field(&name))?); - } - "target" if target.is_none() => { - let FfiValue::String(s) = &value else { - return Err(refuse(Reason::InvalidTarget)); - }; - target = Some( - utf8(s) - .ok_or_else(|| refuse(Reason::InvalidTarget))? - .to_owned(), - ); - } - "outputs" if outputs.is_none() => { - let FfiValue::Array(items) = value else { - return Err(refuse(Reason::OutputsNotList)); - }; - let parsed = items - .iter() - .map(Output::from_value) - .collect::, _>>() - .map_err(|error| error.in_field(&name))?; - outputs = Some(parsed); - } - "type" if field_type.is_none() => { - let FfiValue::String(s) = &value else { - return Err(refuse(Reason::UnknownType)); - }; - let kind = utf8(s).ok_or_else(|| refuse(Reason::UnknownType))?; - field_type = Some(kind.parse().map_err(|_| refuse(Reason::UnknownType))?); - } - // One of the four given twice. - "context" | "target" | "outputs" | "type" => { - return Err(refuse(Reason::RepeatedKey)) - } - _ => return Err(refuse(Reason::UnknownKey)), - } - } - let context = context.ok_or_else(|| refuse(Reason::MissingContext))?; - // One form or the other: a field with both, or neither, is refused. - let field = match (outputs, target) { - (Some(outputs), None) => FieldPlan::new(name, context, outputs)?, - (None, Some(target)) => FieldPlan::with_target(name, context, target)?, - (Some(_), Some(_)) => return Err(refuse(Reason::OutputsWithTarget)), - (None, None) => return Err(refuse(Reason::MissingOutputs)), - }; - fields.push(match field_type { - Some(field_type) => field.with_type(field_type)?, + fields.push(match spec.field_type { + Some(KindName(field_type)) => field.with_type(field_type)?, None => field, }); } // The whole-plan rules are the constructors', so a parsed plan and a // hand-built one are refused alike. - match context_field { + match wire.context_field { Some(name) => Plan::with_context_field(name, fields), None => Plan::new_with(fields, resolver), } } +/// A plan as a binding writes it: an object of field specs, in order, with +/// one reserved key beside them, `"context_field"`. A visitor only to tell +/// that key from a field's name; every value below it is derived. +struct PlanWire { + context_field: Option, + fields: Vec<(String, FieldSpecWire)>, +} + +impl<'de> Deserialize<'de> for PlanWire { + fn deserialize>(d: D) -> Result { + struct V; + impl<'de> Visitor<'de> for V { + type Value = PlanWire; + fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str("a plan: an object of field specs") + } + fn visit_map>(self, mut map: A) -> Result { + let mut plan = PlanWire { + context_field: None, + fields: Vec::with_capacity(super::context::reserved(map.size_hint())), + }; + while let Some(name) = map.next_key::<&'de str>()? { + if name == CONTEXT_FIELD { + plan.context_field = Some(map.next_value()?); + } else { + plan.fields.push((name.to_owned(), map.next_value()?)); + } + } + Ok(plan) + } + } + d.deserialize_map(V) + } +} + +/// The key of the `position`th entry of the object `frame` holds, or `None` +/// when it is not an object of that many entries. +fn entry_key(frame: &[u8], position: usize) -> Option { + struct Keys(Vec); + impl<'de> Deserialize<'de> for Keys { + fn deserialize>(d: D) -> Result { + struct V; + impl<'de> Visitor<'de> for V { + type Value = Keys; + fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str("an object") + } + fn visit_map>(self, mut map: A) -> Result { + let mut keys = Vec::new(); + while let Some(key) = map.next_key::<&'de str>()? { + let _: serde::de::IgnoredAny = map.next_value()?; + keys.push(key.to_owned()); + } + Ok(Keys(keys)) + } + } + d.deserialize_map(V) + } + } + vitaminc_aead_frame::serde::from_slice::(frame) + .ok()? + .0 + .into_iter() + .nth(position) +} + +/// The keys a field's spec reads ([`FieldSpecWire`]). +const SPEC_KEYS: [&str; 4] = ["context", "outputs", "target", "type"]; + +/// The keys of the spec `field` holds in the plan `frame`, or `None` when +/// that spec is not an object (or the plan is not one frame of unique keys). +fn spec_keys(frame: &[u8], field: &str) -> Option> { + #[derive(Deserialize)] + #[serde(untagged)] + enum Spec { + Object(std::collections::BTreeMap), + Other(serde::de::IgnoredAny), + } + match vitaminc_aead_frame::serde::from_slice::>(frame) + .ok()? + .remove(field)? + { + Spec::Object(keys) => Some(keys.into_keys().collect()), + Spec::Other(_) => None, + } +} + +/// The plan-level key naming the field a plan takes its context from. +const CONTEXT_FIELD: &str = "context_field"; + +/// One field's spec: a context, and exactly one of `"outputs"` and +/// `"target"` (checked in `TryFrom`, once the field's name is known, so the +/// refusal names it), and optionally a `"type"`. A key that is present must +/// hold its kind of value: a null is refused. +struct FieldSpec { + context: super::context::Context, + what: What, + field_type: Option, +} + +enum What { + Outputs(Vec), + Target(String), +} + +#[derive(Deserialize)] +#[serde(deny_unknown_fields)] +struct FieldSpecWire { + context: super::context::Context, + #[serde(default, deserialize_with = "present")] + outputs: Option>, + #[serde(default, deserialize_with = "present")] + target: Option, + #[serde(default, deserialize_with = "present", rename = "type")] + field_type: Option, +} + +impl TryFrom for FieldSpec { + type Error = Reason; + + fn try_from(wire: FieldSpecWire) -> Result { + let what = match (wire.outputs, wire.target) { + (Some(outputs), None) => What::Outputs(outputs.into_iter().map(Output::from).collect()), + (None, Some(target)) => What::Target(target), + (Some(_), Some(_)) => return Err(Reason::OutputsWithTarget), + (None, None) => return Err(Reason::MissingOutputs), + }; + Ok(FieldSpec { + context: wire.context, + what, + field_type: wire.field_type, + }) + } +} + +/// Absent is `None`. Present, a value must be of its kind: a null is +/// refused, as any other value of the wrong kind is. +fn present<'de, D: Deserializer<'de>, T: Deserialize<'de>>(d: D) -> Result, D::Error> { + T::deserialize(d).map(Some) +} + +/// One entry of a field's `"outputs"`: `"c"`, `"passthrough"`, or an index +/// in its wire form ([`IndexSpec`'s docs](IndexSpec#wire-form)). +#[derive(Deserialize)] +#[serde(rename_all = "lowercase")] +enum OutputWire { + #[serde(rename = "c")] + Ciphertext, + Passthrough, + Eq, + Match(Option), + Ore, + Ope, +} + +impl From for Output { + fn from(output: OutputWire) -> Self { + let index = match output { + OutputWire::Ciphertext => return Output::Ciphertext, + OutputWire::Passthrough => return Output::Passthrough, + OutputWire::Eq => IndexWire::Eq, + OutputWire::Match(options) => IndexWire::Match(options), + OutputWire::Ore => IndexWire::Ore, + OutputWire::Ope => IndexWire::Ope, + }; + Output::Term(index.into()) + } +} + +/// A `"type"`: the name of a [`ValueKind`]. +#[derive(Deserialize)] +#[serde(try_from = "&str")] +struct KindName(ValueKind); + +impl TryFrom<&str> for KindName { + type Error = Reason; + + fn try_from(name: &str) -> Result { + name.parse().map(KindName).map_err(|_| Reason::UnknownType) + } +} + +/// The parser's refusal of a plan the frame reader refused: the field from +/// the error's path, and the reason from where in the field it happened, +/// or from the reason a field's own rule gave. +fn plan_refusal(error: &vitaminc_aead_frame::serde::Error, frame: &[u8]) -> Error { + use vitaminc_aead_frame::serde::PathSegment::{Entry, Key}; + + let path = error.path(); + // A plan's keys are the host's, so the adapter places an error under one + // by its position, never its text; the field is read back from the + // frame that was refused. + let field = match path.first() { + Some(Entry(position)) => entry_key(frame, *position), + _ => None, + }; + let Some(field) = field else { + // The root: not an object, or not one frame. + return Error::bad_plan(Reason::NotAnObject); + }; + let field = &field; + if field == CONTEXT_FIELD { + return Error::bad_plan(Reason::ContextField); + } + let reason = match path.get(1) { + Some(Key(key)) if key == "context" => { + return Error::bad_context(Reason::ContextKind).in_field(field) + } + Some(Key(key)) if key == "outputs" && path.len() == 2 => Reason::OutputsNotList, + Some(Key(key)) if key == "outputs" => Reason::UnknownOutput, + Some(Key(key)) if key == "target" => Reason::InvalidTarget, + // `"type"`: the one other key a spec reads, and so the only other + // key an error inside a spec's value is placed under (an unknown + // key is never on the path). + Some(_) => Reason::UnknownType, + // The spec itself: a key it does not know, a missing context, or not + // an object at all. Read from the spec's own keys, not the error's + // wording, so a reworded message cannot change the reason. An object + // of known keys refused at its own level lacks its context: a value + // under a key is refused under that key, a repeated key is not an + // object, and the outputs-or-target rule is checked after parsing. + None => match spec_keys(frame, field) { + Some(keys) if keys.iter().any(|key| !SPEC_KEYS.contains(&key.as_str())) => { + Reason::UnknownKey + } + Some(_) => Reason::MissingContext, + None => Reason::NotAnObject, + }, + }; + Error::Plan { + field: Some(field.clone()), + reason, + } +} + /// Encrypt a record — or a batch of records — per a plan. /// -/// `source` is an [`FfiValue::Object`] of `{ field: value }` (one record), -/// or an [`FfiValue::Array`] of such objects (a batch). Every plan field -/// must be present in each record, and every record field must be named by -/// the plan — silently dropping a field on either side would lose data or -/// index nothing. +/// `source` is a map of `{ field: value }` (one record), or a sequence of +/// such maps (a batch), described by any source ([`Encrypt`]): a +/// [`ValueFrame`] or a transport frame a binding was handed. Every plan +/// field must be present in each record, and every record field must be +/// named by the plan — silently dropping a field on either side would lose +/// data or index nothing. /// -/// The source is checked and converted here, with no cipher: that is -/// [`check_source`], and it is where [`Error::Source`] comes from. What +/// The source is walked once, and each field's value written into a +/// [`ValueFrame`] of its own, which is all the engine keeps of it. It is +/// checked here, with no cipher: that is [`check_source`], and it is where +/// [`Error::Source`] comes from. What /// comes back is the plan's [`Pending`], with every term /// derived and every key request queued and nothing sent: one batched /// `generate_keys` for every ciphertext leaf of every row when it is @@ -1181,7 +1327,7 @@ pub fn plan_with( /// # Examples /// /// ``` -/// use stack_encrypt::dynamic::{record, FfiValue, Scope}; +/// use stack_encrypt::dynamic::{record, Scope, ValueFrame}; /// use stack_encrypt::StackCipher; /// use stack_encrypt::kms::FakeDataKeySource; /// @@ -1193,37 +1339,21 @@ pub fn plan_with( /// let keyset = cipher.default_keyset(); /// /// // Seal `age` under users/age with an equality term beside it. -/// let plan = record::plan(FfiValue::Object(vec![( -/// "age".to_string(), -/// FfiValue::Object(vec![ -/// ( -/// "context".to_string(), -/// FfiValue::Array(vec![ -/// FfiValue::String("users".into()), -/// FfiValue::String("age".into()), -/// ]), -/// ), -/// ( -/// "outputs".to_string(), -/// FfiValue::Array(vec![ -/// FfiValue::String("c".into()), -/// FfiValue::String("eq".into()), -/// ]), -/// ), -/// ("type".to_string(), FfiValue::String("uint32".into())), -/// ]), -/// )]))?; +/// let plan = record::plan(&vitaminc_aead_frame::serde::to_vec(&serde_json::json!({ +/// "age": { "context": ["users", "age"], "outputs": ["c", "eq"], "type": "uint32" }, +/// }))?)?; /// -/// let row = FfiValue::Object(vec![("age".to_string(), FfiValue::UInt32(34))]); -/// let sealed = record::encrypt(&keyset, row, &plan)?.await?; +/// // The row as a binding hands it over: one transport frame. Here a Rust +/// // map writes it; a binding's codec writes the same bytes. +/// let row = std::collections::BTreeMap::from([("age", 34u32)]); +/// let frame = ValueFrame::of(&row)?; +/// let sealed = record::encrypt(&keyset, &frame, &plan)?.await?; /// -/// // Only the ciphertext comes back; the term is one-way. +/// // Only the ciphertext comes back, as the record's frame; the term is +/// // one-way. /// let opened = record::decrypt(Scope::Client(&cipher), sealed, &plan, None)?.await?; -/// let FfiValue::Object(fields) = opened else { -/// unreachable!("one record opens to one object"); -/// }; -/// assert!(matches!(&fields[..], [(name, FfiValue::UInt32(34))] if name == "age")); -/// # Ok::<(), stack_encrypt::dynamic::Error>(()) +/// assert_eq!(opened.risky_ref(), frame.risky_ref()); +/// # Ok::<(), Box>(()) /// # }).unwrap(); /// ``` /// @@ -1241,7 +1371,7 @@ pub fn plan_with( /// refused ([`Error::Target`]). pub fn encrypt<'a, K: 'static>( cipher: &'a KeysetCipher<'_, K>, - source: FfiValue, + source: impl Encrypt, plan: &Plan, ) -> Result, Error> { encrypt_with(cipher, source, plan, &NoTargets) @@ -1258,7 +1388,7 @@ pub fn encrypt<'a, K: 'static>( /// kind than the type takes, or a name the resolver refuses. pub fn encrypt_with<'a, K: 'static>( cipher: &'a KeysetCipher<'_, K>, - source: FfiValue, + source: impl Encrypt, plan: &Plan, resolver: &(impl TargetResolver + ?Sized), ) -> Result, Error> { @@ -1327,7 +1457,7 @@ pub fn query<'a, K: 'static>( cipher: &'a KeysetCipher<'_, K>, plan: &Plan, field: &str, - value: FfiValue, + value: impl Encrypt, resolver: &(impl TargetResolver + ?Sized), ) -> Result, K>, Error> { let field = plan @@ -1342,6 +1472,10 @@ pub fn query<'a, K: 'static>( field: Some(field.name.clone()), reason: Reason::NotATarget, })?; + let value = ValueFrame::of(value).map_err(|_| Error::Source { + field: Some(field.name.clone()), + reason: Reason::FieldType, + })?; check_field(&value, field)?; resolver .query(name, cipher, field.label(), value) @@ -1387,9 +1521,20 @@ fn name_target(error: TargetError, field: &str) -> TargetError { /// comes back is the plan's opener as a [`Pending`]: one batched /// `retrieve_keys` for every ciphertext leaf when it is awaited and, when /// opening through [`Scope::Client`], one per keyset the leaves were sealed -/// under. Its value is an [`FfiValue::Object`] per record holding the plan's -/// fields that come back, in plan order — or an [`FfiValue::Array`] of them -/// for a batch. +/// under. Its value is one [`ValueFrame`]: a map per record holding the +/// plan's fields that come back, in plan order, or a sequence of them for a +/// batch. Each field opens straight into a frame of its own, which is walked +/// into its entry of the record's frame and wiped; no value tree holds the +/// plaintext. +/// +/// A passthrough field comes back exactly as the store holds it, beside the +/// decrypted fields in the same map. It is not authenticated: anyone who can +/// write to the store can change it, and `decrypt` does not detect the +/// change. The fields a plan seals (`"c"`) are checked, and so, in effect, is +/// a plan's [context field](Plan::with_context_field), although it too is +/// stored as a passthrough: every other field was sealed under it, so a +/// changed context field either fails [`Error::ContextMismatch`](crate::Error::ContextMismatch) +/// against `expected` or leaves the sealed fields unable to open. /// /// `expected` is the context the caller expects, for a plan with a /// [context field](Plan::with_context_field): the chain's @@ -1423,7 +1568,7 @@ pub fn decrypt<'a, K: 'static>( record: StackCipherText, plan: &Plan, expected: Option

(P); + +impl Encrypt for ModeledSource

{ + fn visit(self, sink: S) -> Result { + self.0.visit(ModelOnly(sink)) + } +} + +/// [`model`] in front of any sink, keeping that sink's error: the +/// passthrough half of [`Modeled`], whose inner writer reports frame errors. +/// A map refuses a repeated key itself, naming it, before the writer can +/// refuse it as a bare frame error. +struct ModelOnly(S); + +/// A map under [`ModelOnly`], with the keys it has been given. A +/// passthrough is not plaintext, so its keys may be kept. +struct ModelOnlyMap { + inner: S, + keys: BTreeSet, +} + +impl Sink for ModelOnly { + type Ok = S::Ok; + type Error = S::Error; + type Seq = ModelOnly; + type Map = ModelOnlyMap; + + fn scalar(self, ty: Option, value: Physical<'_>) -> Result { + match model(ty, value) { + Some((ty, value)) => self.0.scalar(ty, value), + None => Err(S::Error::source(SourceError::new(DecodeError::Expected( + EXPECTED, + )))), + } + } + + fn seq(self, len: Option) -> Result { + self.0.seq(len).map(ModelOnly) + } + + fn map(self, len: Option) -> Result { + self.0.map(len).map(|inner| ModelOnlyMap { + inner, + keys: BTreeSet::new(), + }) + } + + fn passthrough(self, value: P) -> Result { + self.0.passthrough(ModeledSource(value)) + } +} + +impl SeqSink for ModelOnly { + type Ok = S::Ok; + type Error = S::Error; + type Element<'s> + = ModelOnly> + where + Self: 's; + + fn element(&mut self) -> Result, S::Error> { + self.0.element().map(ModelOnly) + } + + fn end(self) -> Result { + self.0.end() + } +} + +impl MapSink for ModelOnlyMap { + type Ok = S::Ok; + type Error = S::Error; + type Entry<'s> + = ModelOnly> + where + Self: 's; + + fn entry(&mut self, key: &str) -> Result, S::Error> { + if !self.keys.insert(key.to_owned()) { + return Err(S::Error::source(SourceError::new( + DecodeError::duplicate_key(key), + ))); + } + self.inner.entry(key).map(ModelOnly) + } + + fn end(self) -> Result { + self.inner.end() + } +} + +// ============================================================================= +// One level of a value: its children, each as a frame +// ============================================================================= + +/// One level of a value: a sequence's elements, each written into a frame of +/// its own, or what the value is when it is not a sequence. +pub(super) enum Parts { + /// A scalar. + Scalar, + /// A passthrough. + Passthrough, + /// A map. + Map, + /// A sequence's elements, in order. + Seq(Vec), +} + +/// The sink of [`ValueFrame::parts`]: at the top, it records what the value +/// is; each child is walked into its own [`Modeled`] frame writer. +struct Split; + +impl Sink for Split { + type Ok = Parts; + type Error = DecodeError; + type Seq = Children; + type Map = Skip; + + fn scalar(self, ty: Option, value: Physical<'_>) -> Result { + let _ = model(ty, value).ok_or(DecodeError::Expected(EXPECTED))?; + Ok(Parts::Scalar) + } + + fn seq(self, _: Option) -> Result, DecodeError> { + Ok(Children::new(false, parts)) + } + + fn map(self, _: Option) -> Result, DecodeError> { + Ok(Skip::ending(Parts::Map, false)) + } + + fn passthrough(self, _: P) -> Result { + Ok(Parts::Passthrough) + } +} + +fn parts(_: bool, children: Vec<(Option, ValueFrame)>) -> Result { + Ok(Parts::Seq( + children.into_iter().map(|(_, value)| value).collect(), + )) +} + +/// What a container's children become when it ends: whether it is a map, +/// and each child's key (for a map) and frame. +type Finish = fn(bool, Vec<(Option, ValueFrame)>) -> Result; + +/// The children of one container, each written into its own frame as it is +/// walked, and handed to `finish` when the container ends. The map form +/// keeps a repeated key for `finish` to refuse. +pub struct Children { + map: bool, + children: Vec<(Option, Protected>)>, + finish: Finish, +} + +impl Children { + fn new(map: bool, finish: Finish) -> Self { + Self { + map, + children: Vec::new(), + finish, + } + } + + fn next(&mut self, key: Option<&str>) -> Modeled> { + self.children + .push((key.map(str::to_owned), Protected::new(Vec::new()))); + let buffer = match self.children.last_mut() { + Some((_, buffer)) => buffer, + // Pushed on the line above. + None => unreachable!(), + }; + Modeled::new(FrameWriter::new(buffer.risky_inner_mut())) + } + + fn finish(self) -> Result { + let children = self + .children + .into_iter() + .map(|(key, buffer)| (key, ValueFrame(buffer))) + .collect(); + (self.finish)(self.map, children) + } +} + +impl SeqSink for Children { + type Ok = T; + type Error = DecodeError; + type Element<'s> + = Modeled> + where + Self: 's; + + fn element(&mut self) -> Result>, DecodeError> { + Ok(self.next(None)) + } + + fn end(self) -> Result { + self.finish() + } +} + +impl MapSink for Children { + type Ok = T; + type Error = DecodeError; + type Entry<'s> + = Modeled> + where + Self: 's; + + fn entry(&mut self, key: &str) -> Result>, DecodeError> { + Ok(self.next(Some(key))) + } + + fn end(self) -> Result { + self.finish() + } +} + +// ============================================================================= +// Opening into a frame +// ============================================================================= + +/// The [`Decrypt`] sink of a [`ValueFrame`]: writes the opened value into a +/// frame through the value model. A scalar or a passthrough is written +/// directly; a container's children are written into frames of their own as +/// they are opened (the sink owns no buffer for a child writer to borrow +/// until the container exists), and the container is written around them +/// when it ends, by walking each child's frame into vitaminc's +/// [`FrameWriter`]. +pub struct Opening; + +impl Sink for Opening { + type Ok = ValueFrame; + type Error = DecodeError; + type Seq = Children; + type Map = Children; + + fn scalar(self, ty: Option, value: Physical<'_>) -> Result { + write(|writer| Modeled::new(writer).scalar(ty, value)) + } + + fn seq(self, _: Option) -> Result, DecodeError> { + Ok(Children::new(false, join)) + } + + fn map(self, _: Option) -> Result, DecodeError> { + Ok(Children::new(true, join)) + } + + fn passthrough(self, value: P) -> Result { + write(|writer| Modeled::new(writer).passthrough(value)) + } +} + +/// Write a container around its children's frames. A repeated key is +/// refused, as an object holds each key once. +fn join(map: bool, children: Vec<(Option, ValueFrame)>) -> Result { + write(|writer| { + let count = Some(children.len()); + if map { + let mut entries = Modeled::new(writer).map(count)?; + let mut keys = BTreeSet::new(); + for (key, child) in &children { + let key = key.as_deref().unwrap_or_default(); + if !keys.insert(key) { + return Err(DecodeError::duplicate_key(key)); + } + child.visit(entries.entry(key)?)?; + } + entries.end() + } else { + let mut elements = Modeled::new(writer).seq(count)?; + for (_, child) in &children { + child.visit(elements.element()?)?; + } + elements.end() + } + }) +} + +// ============================================================================= +// Reading without copying: a value's kind, and its passthroughs +// ============================================================================= + +/// A sink that reads nothing and accepts everything, or everything but a +/// passthrough: for walking past a value, or checking one holds none. +pub(super) struct Skip { + refuse_passthrough: bool, + ok: PhantomData T>, + value: Option, +} + +impl Skip { + fn ending(value: T, refuse_passthrough: bool) -> Self { + Self { + refuse_passthrough, + ok: PhantomData, + value: Some(value), + } + } +} + +impl Skip<()> { + fn refusing_passthrough() -> Self { + Self::ending((), true) + } +} + +impl Skip { + fn done(self) -> Result { + self.value.ok_or(DecodeError::Expected("a value")) + } + + fn child(&self) -> Skip<()> { + Skip::ending((), self.refuse_passthrough) + } +} + +impl Sink for Skip { + type Ok = T; + type Error = DecodeError; + type Seq = Self; + type Map = Self; + + fn scalar(self, _: Option, _: Physical<'_>) -> Result { + self.done() + } + + fn seq(self, _: Option) -> Result { + Ok(self) + } + + fn map(self, _: Option) -> Result { + Ok(self) + } + + fn passthrough(self, _: P) -> Result { + if self.refuse_passthrough { + return Err(DecodeError::Expected("no passthrough")); + } + self.done() + } +} + +impl SeqSink for Skip { + type Ok = T; + type Error = DecodeError; + type Element<'s> + = Skip<()> + where + Self: 's; + + fn element(&mut self) -> Result, DecodeError> { + Ok(self.child()) + } + + fn end(self) -> Result { + self.done() + } +} + +impl MapSink for Skip { + type Ok = T; + type Error = DecodeError; + type Entry<'s> + = Skip<()> + where + Self: 's; + + fn entry(&mut self, _: &str) -> Result, DecodeError> { + Ok(self.child()) + } + + fn end(self) -> Result { + self.done() + } +} + +/// The sink of [`ValueFrame::kind`]: a scalar's kind, or a container's, +/// walking past its children. +struct KindOf; + +impl Sink for KindOf { + type Ok = Option; + type Error = DecodeError; + type Seq = Skip>; + type Map = Skip>; + + fn scalar(self, ty: Option, value: Physical<'_>) -> Result { + Ok(scalar_kind(ty, &value)) + } + + fn seq(self, _: Option) -> Result { + Ok(Skip::ending(Some(ValueKind::Array), false)) + } + + fn map(self, _: Option) -> Result { + Ok(Skip::ending(Some(ValueKind::Object), false)) + } + + fn passthrough(self, _: P) -> Result { + Ok(None) + } +} + +/// The kind of one scalar in the value model, or `None` for a null, an +/// `undefined`, or a scalar outside the model. +pub(super) fn scalar_kind(ty: Option, value: &Physical<'_>) -> Option { + let (ty, value) = model(ty, *value)?; + Some(match (ty, value) { + (Some(Logical::Date), _) => ValueKind::Date, + (Some(Logical::Timestamp(_)), _) => ValueKind::Timestamp, + (Some(Logical::Decimal { .. }), _) => ValueKind::Decimal, + (Some(_), _) | (None, Physical::Null) => return None, + (None, Physical::Bool(_)) => ValueKind::Bool, + (None, Physical::Int(int)) => match int { + Int::I8(_) => ValueKind::Int8, + Int::I16(_) => ValueKind::Int16, + Int::I32(_) => ValueKind::Int32, + Int::I64(_) => ValueKind::Int64, + Int::I128(_) => ValueKind::Int128, + Int::U8(_) => ValueKind::UInt8, + Int::U16(_) => ValueKind::UInt16, + Int::U32(_) => ValueKind::UInt32, + Int::U64(_) => ValueKind::UInt64, + Int::U128(_) => ValueKind::UInt128, + }, + (None, Physical::Float(Float::F32(_))) => ValueKind::Float32, + (None, Physical::Float(Float::F64(_))) => ValueKind::Float64, + (None, Physical::Text(_)) => ValueKind::String, + (None, Physical::Bytes(_)) => ValueKind::Bytes, + }) +} + +// ============================================================================= +// A record source, split into its rows and each row's fields +// ============================================================================= + +/// One row of a record source: its entries, each value written into its +/// own frame as the source is walked, in source order with a repeated key +/// kept; or `None` for a row that is not a map. +pub(super) type SourceRow = Option>; + +/// A record source split by [`split_rows`]: one row, or a batch. +pub(super) enum SourceRows { + /// A map: one row. + One(SourceRow), + /// A sequence: each element a row. + Batch(Vec), +} + +/// Walk a record source once, writing each field's value into a frame of its +/// own through the value model. The source is a map (one row) or a sequence +/// of maps (a batch); anything else, at the top or as a batch element, is a +/// row that is not a map. A value the model refuses fails the walk with a +/// [`FieldFault`] naming its field. +pub(super) fn split_rows(source: P) -> Result { + source.visit(RowsSink) +} + +/// Where a finished row goes: back to the caller, or into a batch. +pub(super) trait PutRow { + type Ok; + fn put(self, row: SourceRow) -> Self::Ok; +} + +/// The top of a source: the row is the result. +pub(super) struct TopRow; + +impl PutRow for TopRow { + type Ok = SourceRows; + fn put(self, row: SourceRow) -> SourceRows { + SourceRows::One(row) + } +} + +/// The next row of a batch. +pub(super) struct BatchRow<'s>(&'s mut Vec); + +impl PutRow for BatchRow<'_> { + type Ok = (); + fn put(self, row: SourceRow) { + self.0.push(row); + } +} + +/// The top of a record source. +struct RowsSink; + +impl Sink for RowsSink { + type Ok = SourceRows; + type Error = DecodeError; + type Seq = BatchSink; + type Map = RowMap; + + fn scalar(self, _: Option, _: Physical<'_>) -> Result { + Ok(SourceRows::One(None)) + } + + fn seq(self, _: Option) -> Result { + Ok(BatchSink(Vec::new())) + } + + fn map(self, _: Option) -> Result, DecodeError> { + Ok(RowMap::new(TopRow)) + } + + fn passthrough(self, _: P) -> Result { + Ok(SourceRows::One(None)) + } +} + +/// A batch: one row per element. +pub(super) struct BatchSink(Vec); + +impl SeqSink for BatchSink { + type Ok = SourceRows; + type Error = DecodeError; + type Element<'s> + = RowSink<'s> + where + Self: 's; + + fn element(&mut self) -> Result, DecodeError> { + Ok(RowSink(BatchRow(&mut self.0))) + } + + fn end(self) -> Result { + Ok(SourceRows::Batch(self.0)) + } +} + +/// One element of a batch: a row if it is a map, a row that is not a map +/// otherwise, whose content is walked past. +pub(super) struct RowSink<'s>(BatchRow<'s>); + +impl<'s> Sink for RowSink<'s> { + type Ok = (); + type Error = DecodeError; + type Seq = NotARow<'s>; + type Map = RowMap>; + + fn scalar(self, _: Option, _: Physical<'_>) -> Result<(), DecodeError> { + self.0.put(None); + Ok(()) + } + + fn seq(self, _: Option) -> Result, DecodeError> { + Ok(NotARow(self.0)) + } + + fn map(self, _: Option) -> Result>, DecodeError> { + Ok(RowMap::new(self.0)) + } + + fn passthrough(self, _: P) -> Result<(), DecodeError> { + self.0.put(None); + Ok(()) + } +} + +/// A batch element that is a sequence: not a row. Its elements are walked +/// past, and it is recorded when it ends. +pub(super) struct NotARow<'s>(BatchRow<'s>); + +impl SeqSink for NotARow<'_> { + type Ok = (); + type Error = DecodeError; + type Element<'e> + = Skip<()> + where + Self: 'e; + + fn element(&mut self) -> Result, DecodeError> { + Ok(Skip::ending((), false)) + } + + fn end(self) -> Result<(), DecodeError> { + self.0.put(None); + Ok(()) + } +} + +/// One row's entries, each written into its own frame by a writer that +/// names the entry's key in any refusal. +pub(super) struct RowMap { + out: O, + entries: Vec<(String, Protected>)>, +} + +impl RowMap { + fn new(out: O) -> Self { + Self { + out, + entries: Vec::new(), + } + } +} + +impl MapSink for RowMap { + type Ok = O::Ok; + type Error = DecodeError; + type Entry<'s> + = Modeled> + where + Self: 's; + + fn entry(&mut self, key: &str) -> Result>, DecodeError> { + self.entries + .push((key.to_owned(), Protected::new(Vec::new()))); + let buffer = match self.entries.last_mut() { + Some((_, buffer)) => buffer, + // Pushed on the line above. + None => unreachable!(), + }; + Ok(Modeled::in_field( + FrameWriter::new(buffer.risky_inner_mut()), + key, + )) + } + + fn end(self) -> Result { + let row = self + .entries + .into_iter() + .map(|(key, buffer)| (key, ValueFrame(buffer))) + .collect(); + Ok(self.out.put(Some(row))) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::dynamic::test_frame::Tree; + + fn s(value: &str) -> Tree { + Tree::String(value.into()) + } + + fn frame_of(value: &Tree) -> ValueFrame { + ValueFrame::of(value).expect("in the model") + } + + fn every_variant() -> Tree { + Tree::Object(vec![ + ("n".to_string(), Tree::Null), + ("u".to_string(), Tree::Undefined), + ("b".to_string(), Tree::Bool(true)), + ("i32".to_string(), Tree::Int32(-3)), + ("i64".to_string(), Tree::Int64(-4)), + ("u32".to_string(), Tree::UInt32(34)), + ("u64".to_string(), Tree::UInt64(u64::MAX)), + ("f32".to_string(), Tree::Float32(-0.0)), + ("f64".to_string(), Tree::Float64(f64::NAN)), + ("s".to_string(), s("alice")), + ("bytes".to_string(), Tree::Bytes(vec![1, 2, 3])), + ( + "list".to_string(), + Tree::Array(vec![s("a"), Tree::Passthrough(Box::new(s("p")))]), + ), + ("empty".to_string(), Tree::Array(vec![])), + ("none".to_string(), Tree::Object(vec![])), + ]) + } + + /// A value's frame is the frame vitaminc writes for it, byte for byte, + /// and reads back as the value. + #[test] + fn a_value_frame_is_the_values_own_frame() { + let value = every_variant(); + let frame = frame_of(&value); + assert_eq!( + frame.risky_ref(), + value.to_frame().expect("frames").risky_ref() + ); + let back = Tree::from_frame(frame.risky_ref()).expect("reads back"); + assert_eq!(back, value); + let copy = frame.clone(); + assert_eq!(copy.risky_ref(), frame.risky_ref()); + assert_ne!(copy.risky_ref().as_ptr(), frame.risky_ref().as_ptr()); + let bytes = copy.into_inner(); + assert_eq!( + bytes.risky_ref(), + frame.risky_ref(), + "the frame, still protected" + ); + } + + /// Every integer keeps its own width, at any depth: an `i8` is the + /// `INT8` leaf, not the 32-bit one. + #[test] + fn every_integer_keeps_its_width() { + use vitaminc_aead::plaintext::Raw; + use vitaminc_aead::tags; + for (int, tag) in [ + (Int::I8(-8), tags::INT8), + (Int::I16(-8), tags::INT16), + (Int::I128(-8), tags::INT128), + (Int::U8(8), tags::UINT8), + (Int::U16(8), tags::UINT16), + (Int::U128(8), tags::UINT128), + ] { + let frame = ValueFrame::of(Raw(None, Physical::Int(int))).expect("in the model"); + assert_eq!(frame.risky_ref()[0], tag); + let back = ValueFrame::from_bytes(frame.risky_ref()).expect("in the model"); + assert_eq!( + back.risky_ref(), + frame.risky_ref(), + "read back at its width" + ); + } + let nested = ValueFrame::of(vec![vec![300u16]]).expect("in the model"); + let inner = ValueFrame::of(300u16).expect("in the model"); + assert!(nested.risky_ref().ends_with(inner.risky_ref())); + } + + /// A date, a decimal and a timestamp are in the model; a timestamp in + /// any unit is the same instant in nanoseconds, under the `TIMESTAMP` + /// tag; a decimal keeps its scale. + #[test] + fn the_logical_types_of_the_model_are_kept() { + use vitaminc_aead::plaintext::Raw; + let date = ValueFrame::of(Raw(Some(Logical::Date), Physical::Int(Int::I32(19_782)))) + .expect("a date"); + assert_eq!(date.kind(), Some(ValueKind::Date)); + assert_eq!(date.risky_ref()[0], vitaminc_aead::tags::DATE); + let decimal = ValueFrame::of(Raw( + Some(Logical::Decimal { scale: 2 }), + Physical::Int(Int::I64(150)), + )) + .expect("a decimal"); + assert_eq!(decimal.kind(), Some(ValueKind::Decimal)); + let one_point_five = ValueFrame::of(Raw( + Some(Logical::Decimal { scale: 1 }), + Physical::Int(Int::I64(15)), + )) + .expect("a decimal"); + assert_ne!( + decimal.risky_ref(), + one_point_five.risky_ref(), + "1.50 is not 1.5" + ); + let nanos = ValueFrame::of(Raw( + Some(Logical::Timestamp(TimeUnit::Nanos)), + Physical::Int(Int::I128(-2_000_000_000)), + )) + .expect("an instant"); + assert_eq!(nanos.kind(), Some(ValueKind::Timestamp)); + for (unit, count) in [ + (TimeUnit::Seconds, -2i64), + (TimeUnit::Millis, -2_000), + (TimeUnit::Micros, -2_000_000), + ] { + let other = ValueFrame::of(Raw( + Some(Logical::Timestamp(unit)), + Physical::Int(Int::I64(count)), + )) + .expect("an instant"); + assert_eq!(other.risky_ref(), nanos.risky_ref(), "{unit:?}"); + } + } + + /// A scalar outside the model is refused wherever it is, a passthrough + /// included, and so is a repeated key. + /// `check` refuses exactly what `from_bytes` refuses, and hands back the + /// bytes it was given. + #[test] + fn check_refuses_what_from_bytes_refuses_without_a_copy() { + let good = every_variant(); + let bytes = ValueFrame::of(&good).expect("frames"); + let checked = ValueFrame::check(bytes.risky_ref()).expect("checks"); + assert_eq!(checked.as_bytes().as_ptr(), bytes.risky_ref().as_ptr()); + assert_eq!(checked.as_bytes(), bytes.risky_ref()); + let hidden = vitaminc_aead::to_frame(Hidden(vitaminc_aead::plaintext::Raw( + Some(Logical::Uuid), + Physical::Bytes(&[7; 16]), + ))) + .expect("frames"); + let uuid = vitaminc_aead::to_frame(vitaminc_aead::plaintext::Raw( + Some(Logical::Uuid), + Physical::Bytes(&[7; 16]), + )) + .expect("frames"); + for refused in [hidden.risky_ref(), uuid.risky_ref()] { + assert!(matches!( + ValueFrame::check(refused), + Err(super::FromFrameError::Value(DecodeError::Expected(_))) + )); + assert!(matches!( + ValueFrame::from_bytes(refused), + Err(super::FromFrameError::Value(DecodeError::Expected(_))) + )); + } + assert!(matches!( + ValueFrame::check(&[]), + Err(super::FromFrameError::Frame(_)) + )); + } + + /// A value that travels as a passthrough subtree. + #[derive(Clone)] + struct Hidden

(P); + + impl Encrypt for Hidden

{ + fn visit(self, sink: S) -> Result { + sink.passthrough(self.0) + } + } + + #[test] + fn what_the_model_does_not_hold_is_refused() { + use vitaminc_aead::plaintext::kinds::{MAX_DATE_DAYS, MAX_TIMESTAMP_NANOS}; + use vitaminc_aead::plaintext::Raw; + let refused = + |value: Raw<'_>| matches!(ValueFrame::of(value), Err(DecodeError::Expected(_))); + assert!(refused(Raw(Some(Logical::Uuid), Physical::Bytes(&[7; 16])))); + let unknown = Logical::from_wire(200, 0).expect("an unknown logical type"); + assert!(refused(Raw(Some(unknown), Physical::Int(Int::I32(1))))); + assert!(refused(Raw( + Some(Logical::Date), + Physical::Int(Int::I64(i64::from(MAX_DATE_DAYS) + 1)) + ))); + assert!(refused(Raw( + Some(Logical::Date), + Physical::Text("2024-01-01") + ))); + assert!(refused(Raw( + Some(Logical::Timestamp(TimeUnit::Nanos)), + Physical::Int(Int::I128(MAX_TIMESTAMP_NANOS + 1)) + ))); + assert!(refused(Raw( + Some(Logical::Timestamp(TimeUnit::Seconds)), + Physical::Int(Int::I128(i128::MAX)) + ))); + assert!(refused(Raw( + Some(Logical::Decimal { scale: 0 }), + Physical::Int(Int::I128(1 << 96)) + ))); + assert!(refused(Raw(Some(Logical::Undefined), Physical::Bool(true)))); + assert!(matches!( + ValueFrame::of(vec![Raw(Some(Logical::Uuid), Physical::Bytes(&[7; 16]))]), + Err(DecodeError::Expected(_)) + )); + let hidden = Tree::Passthrough(Box::new(Tree::Null)); + assert!(ValueFrame::of(&hidden).is_ok()); + // Inside a passthrough too, and refused the same way. + let hidden = Hidden(vitaminc_aead::plaintext::Raw( + Some(Logical::Uuid), + Physical::Bytes(&[7; 16]), + )); + assert!(matches!( + ValueFrame::of(hidden), + Err(DecodeError::Expected(_)) + )); + let repeated = Tree::Object(vec![("k".into(), Tree::Null), ("k".into(), Tree::Null)]); + assert!(matches!( + ValueFrame::of(&repeated), + Err(DecodeError::DuplicateKey(key)) if key == "k" + )); + assert!(matches!( + ValueFrame::from_bytes(&[]), + Err(super::FromFrameError::Frame(_)) + )); + let uuid = vitaminc_aead::to_frame(Raw(Some(Logical::Uuid), Physical::Bytes(&[7; 16]))) + .expect("frames"); + assert!(matches!( + ValueFrame::from_bytes(uuid.risky_ref()), + Err(super::FromFrameError::Value(DecodeError::Expected(_))) + )); + } + + /// Every value opens to the frame it was written as, through a walk of + /// any source into the decrypt sink. + #[test] + fn opening_writes_the_frame_it_reads() { + let value = every_variant(); + let opened = (&value).visit(ValueFrame::sink()).expect("opens"); + assert_eq!(opened.risky_ref(), frame_of(&value).risky_ref()); + for scalar in [s("x"), Tree::Null, Tree::Int64(1)] { + let opened = (&scalar).visit(ValueFrame::sink()).expect("opens"); + assert_eq!(opened.risky_ref(), frame_of(&scalar).risky_ref()); + } + let passthrough = Tree::Passthrough(Box::new(s("p"))); + let opened = (&passthrough).visit(ValueFrame::sink()).expect("opens"); + assert_eq!(opened.risky_ref(), frame_of(&passthrough).risky_ref()); + let repeated = Tree::Object(vec![("k".into(), Tree::Null), ("k".into(), Tree::Null)]); + assert!(matches!( + (&repeated).visit(ValueFrame::sink()), + Err(DecodeError::DuplicateKey(key)) if key == "k" + )); + } + + #[test] + fn a_frame_names_its_kind() { + let cases = [ + (Tree::Null, None), + (Tree::Undefined, None), + (Tree::Bool(true), Some(ValueKind::Bool)), + (Tree::Int32(1), Some(ValueKind::Int32)), + (Tree::Int64(1), Some(ValueKind::Int64)), + (Tree::UInt32(1), Some(ValueKind::UInt32)), + (Tree::UInt64(1), Some(ValueKind::UInt64)), + (Tree::Float32(1.0), Some(ValueKind::Float32)), + (Tree::Float64(1.0), Some(ValueKind::Float64)), + (s("a"), Some(ValueKind::String)), + (Tree::Bytes(vec![1]), Some(ValueKind::Bytes)), + (Tree::Array(vec![s("a")]), Some(ValueKind::Array)), + ( + Tree::Object(vec![("k".into(), s("a"))]), + Some(ValueKind::Object), + ), + (Tree::Passthrough(Box::new(s("p"))), None), + ]; + for (value, kind) in cases { + assert_eq!(frame_of(&value).kind(), kind, "{value:?}"); + assert_eq!(value.kind(), kind, "the tree agrees: {value:?}"); + } + use vitaminc_aead::plaintext::Raw; + for (int, kind) in [ + (Int::I8(1), ValueKind::Int8), + (Int::I16(1), ValueKind::Int16), + (Int::I128(1), ValueKind::Int128), + (Int::U8(1), ValueKind::UInt8), + (Int::U16(1), ValueKind::UInt16), + (Int::U128(1), ValueKind::UInt128), + ] { + let frame = ValueFrame::of(Raw(None, Physical::Int(int))).expect("in the model"); + assert_eq!(frame.kind(), Some(kind)); + } + let undefined = + ValueFrame::of(Raw(Some(Logical::Undefined), Physical::Null)).expect("in the model"); + assert_eq!(undefined.kind(), None); + } + + /// A sequence's parts are its elements' own frames, in order. + #[test] + fn parts_are_the_childrens_frames() { + let Parts::Seq(items) = frame_of(&Tree::Array(vec![s("a"), Tree::Int32(1)])) + .parts() + .expect("parts") + else { + panic!("a sequence"); + }; + assert_eq!(items.len(), 2); + assert_eq!(items[0].risky_ref(), frame_of(&s("a")).risky_ref()); + assert!(matches!( + frame_of(&Tree::Object(vec![("k".into(), s("a"))])).parts(), + Ok(Parts::Map) + )); + assert!(matches!(frame_of(&s("a")).parts(), Ok(Parts::Scalar))); + assert_eq!( + frame_of(&Tree::Array(vec![s("a")])) + .elements() + .map(|items| items.len()), + Some(1) + ); + assert!(frame_of(&s("a")).elements().is_none()); + assert!(matches!( + frame_of(&Tree::Passthrough(Box::new(s("p")))).parts(), + Ok(Parts::Passthrough) + )); + } + + #[test] + fn a_passthrough_is_found_at_any_depth() { + assert!(frame_of(&every_variant()).kind().is_some()); + assert!(frame_of(&every_variant()).has_passthrough()); + assert!(!frame_of(&s("a")).has_passthrough()); + assert!(frame_of(&Tree::Passthrough(Box::new(s("p")))).has_passthrough()); + assert!(!frame_of(&Tree::Object(vec![("k".into(), s("a"))])).has_passthrough()); + } + + #[test] + fn text_reads_as_a_label_and_nothing_else_does() { + assert_eq!( + frame_of(&s("tenants/acme")).into_label().expect("a label"), + Label::parse("tenants/acme").expect("a label") + ); + assert!(matches!( + frame_of(&Tree::UInt32(7)).into_label(), + Err(LabelError::NotText) + )); + assert!(frame_of(&s("")).into_label().is_err()); + } + + #[test] + fn debug_redacts_the_frame() { + let shown = format!("{:?}", frame_of(&s("secret"))); + assert!(shown.ends_with("ValueFrame(\"***\")"), "{shown}"); + assert!(!shown.contains("secret"), "{shown}"); + } +} diff --git a/packages/stack-encrypt/src/lib.rs b/packages/stack-encrypt/src/lib.rs index 37b36ba4f..8afe073e5 100644 --- a/packages/stack-encrypt/src/lib.rs +++ b/packages/stack-encrypt/src/lib.rs @@ -26,9 +26,10 @@ //! the cipher bound to one of that client's keysets, from //! [`default_keyset`](StackCipher::default_keyset) or //! [`keyset`](StackCipher::keyset) — encrypts any value that implements -//! [`Encrypt`] (`String`, `Vec`, `HashMap`, `Option`, -//! `Protected`, your own types, and any nesting of them). Either cipher -//! decrypts back into any [`Decrypt`] type. Every scalar inside the value is +//! vitaminc's [`Encrypt`] (`String`, `Vec`, `HashMap`, +//! `Option`, `Protected`, your own types through +//! `#[derive(vitaminc_aead::Encrypt)]`, and any nesting of them). Either +//! cipher decrypts back into any [`Decrypt`] type. Every scalar inside the value is //! sealed under its **own** ZeroKMS data key, so each value access is an //! individually auditable key retrieval — there is no long-lived key in your //! process. @@ -225,8 +226,9 @@ endpoint — are `StackKmsBuilder`'s, and the two keyset-cache knobs are //! //! Besides your AAD, the *shape* of a value is authenticated: an element cannot //! be spliced out of a sequence and passed off as a scalar, a map value cannot -//! be moved under a different key, and "absent" / "empty" are themselves -//! sealed markers rather than inferable from structure. A tampered or +//! be moved under a different key, "empty" is itself a sealed marker rather +//! than inferable from structure, and "absent" is a sealed null leaf. Every +//! leaf records its own type, so a leaf cannot be read back as another. A tampered or //! re-homed ciphertext fails with [`Error::Aead`]; a failed or denied key //! retrieval surfaces as [`Error::Kms`]. A ciphertext opened under the //! *wrong context* is refused by ZeroKMS first: every data key is bound to @@ -236,18 +238,14 @@ endpoint — are `StackKmsBuilder`'s, and the two keyset-cache knobs are //! source that ignores descriptors (`FakeDataKeySource`, in tests) lets a //! wrong context reach the AEAD, where it is [`Error::Aead`]. //! -//! For one-row reads of a batch-encrypted collection, decrypt as -//! [`Element`](Element) under the same AAD used for the whole collection: -//! the derivation that binds an element to its position is applied by the -//! type, not by the caller. That is the general rule here — every leaf's AAD -//! is derived from the context its key was minted under, and there is no -//! entry point that lets a caller supply one of its own. +//! Every leaf's AAD is derived from the context its key was minted under, +//! and there is no entry point that lets a caller supply one of its own. //! //! # Relationship to vitaminc //! -//! A `KeysetCipher` is a vitaminc [`Cipher`]; everything a vitaminc cipher can -//! encrypt, it can encrypt, and the AEAD, AAD derivations and leaf wire format -//! are vitaminc's (`vitaminc_encrypt::Aes256Cipher`, AES-256-GCM under a random +//! A `KeysetCipher` seals through a vitaminc `Cipher`; everything vitaminc +//! can encrypt, it can encrypt, and the data model, the AAD derivations and +//! the leaf wire format are vitaminc's (`vitaminc_encrypt::Aes256Cipher`, AES-256-GCM under a random //! per-leaf nonce vitaminc generates itself). The ZeroKMS `iv` a [`SealedValue`] //! carries is *not* that nonce: it identifies the data key, and is sent back to //! ZeroKMS with the key `tag` to re-derive it — under the same [`Descriptor`] @@ -277,13 +275,14 @@ pub mod descriptor; #[cfg(feature = "dynamic")] pub mod dynamic; pub mod keyset; +pub mod op; pub mod plan; pub mod sem; pub mod target; pub use cipher::{ - BoxedPassthrough, Error, FromEnv, LeafBytesError, PendingStackCipherText, SealedValue, - StackCipher, StackCipherBuilder, StackCipherText, StackDecipher, + Error, FromEnv, LeafBytesError, PendingStackCipherText, SealedValue, StackCipher, + StackCipherBuilder, StackCipherText, }; pub use descriptor::{Describe, Description, Descriptor, Label, LabelError}; pub use keyset::KeysetCipher; @@ -306,13 +305,14 @@ pub use target::{ }; // Re-export the vitaminc AEAD surface callers need to drive the cipher, so they -// don't have to depend on `vitaminc-aead` directly for the common path. A -// context type of your own implements `IntoContext` once; `IntoAad` and -// `IntoPrfContext` are vitaminc's blankets over it, so both derivations see -// the same bytes. +// don't have to depend on `vitaminc-aead` directly for the common path: a +// value describes itself once (`Encrypt`) and names the sink that reads it +// back (`Decrypt`). A context type of your own implements `IntoContext` once; +// `IntoAad` and `IntoPrfContext` are vitaminc's blankets over it, so both +// derivations see the same bytes. pub use vitaminc_aead::{ - Cipher, CipherText, Context, ContextPiece, ContextTag, Decipher, Decrypt, Element, Encrypt, - IntoAad, IntoContext, Unspecified, + CipherText, Context, ContextPiece, ContextTag, Decrypt, Encrypt, IntoAad, IntoContext, Node, + PassthroughFrame, Unspecified, }; // The vitaminc 0.4 names, deprecated there; re-exported for one transition so // a caller that spelled them keeps compiling with a warning. diff --git a/packages/stack-encrypt/src/op/mod.rs b/packages/stack-encrypt/src/op/mod.rs new file mode 100644 index 000000000..d749707cd --- /dev/null +++ b/packages/stack-encrypt/src/op/mod.rs @@ -0,0 +1,933 @@ +//! Operators: what a query asks of the server, as a type. +//! +//! A query names an *operator* ([`Eq`](struct@Eq), [`Lt`], [`Lte`], +//! [`Gt`], [`Gte`], [`Between`], [`Matches`](struct@Matches), and the +//! JSON operators [`Contains`], [`ContainedBy`] and [`AtPath`]), and the +//! plan it runs on finds the index that answers it. The operator is a unit +//! type passed by value, as an index is (`.via(Ore)`), and it decides what +//! the query takes: one value for most, a pair of bounds for `Between`, a +//! path and the leaf operator's input for `AtPath`. No index answers the +//! JSON operators yet: this crate has no JSON index, so a query with one +//! does not compile until that index exists. +//! +//! ``` +//! # async fn example() -> Result<(), stack_encrypt::Error> { +//! use stack_encrypt::kms::FakeDataKeySource; +//! use stack_encrypt::{op, Equality, Match, Ore, Plan, StackCipher}; +//! +//! let cipher = StackCipher::builder().kms(FakeDataKeySource::new()).init().await?; +//! let email_plan = Plan::context("users/email") +//! .with::((Equality, Match)) +//! .build()?; +//! let age_plan = Plan::context("users/age").with::(Ore).build()?; +//! +//! let exact = cipher.query(op::Eq, "bob@example.com").on(&email_plan).await?; +//! let search = cipher.query(op::Matches, "bob").on(&email_plan).await?; +//! let under = cipher.query(op::Lt, &40u32).on(&age_plan).await?; +//! let range = cipher.query(op::Between, &(18u32, 65)).on(&age_plan).await?; +//! # let _ = (exact, search, under, range); +//! # Ok(()) +//! # } +//! # tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap().block_on(example()).unwrap(); +//! ``` +//! +//! Three traits connect an operator to an index, and ADR-0009 records why: +//! +//! - [`Supports`] is on an index, for each operator it can answer +//! and the input `In` the query takes, and names the [`QueryTerm`] it +//! sends. That term is not the stored term: an equality index sends the +//! same HMAC it stores, but a match index sends a filter over the query's +//! value ([`MatchQuery`]), where it stores a filter over the stored value +//! ([`MatchTerms`]), and an ORE index sends one [`RangeQuery`] for +//! `Between`, carrying both bounds, where it stores one term per value. +//! - [`Answers`] is on a target type, a domain type such as an EQL +//! type, and names the index that answers `Op` for it. It is written by +//! hand per type, because the choice decides what the query term reveals. +//! - [`DefaultIndex`] is on an operator, and names the index a plan that +//! declares its indexes, rather than a target type, answers it with. +//! +//! What a query takes is the operator's [`Arity`]: [`One`] plaintext, a +//! [`Pair`] of them as a tuple, or for an accessor a path and its leaf +//! operator's input ([`Pathed`](Pathed), where `A` is the leaf's arity). +//! [`Input`] says, for the value a query is given, which plaintext the +//! index is declared over (`S` for `(S, S)`), so the plan's type is checked +//! against it. No input of a `Pathed` arity exists until the JSON index +//! does. +//! +//! What the types can see is checked at compile time: a match query on an +//! integer, an ordering on bytes, an operator a target type does not answer, +//! and, on a one-value plan, an index the plan does not hold or a +//! case-sensitive match against a case-folding index. A field of a fields +//! plan is data, so there an index the field does not declare, or declares +//! with other options, is refused when the query is awaited, before any +//! key is requested. So is a match configuration whose [`MatchCase`] +//! disagrees with its options, and so is the one query value the library +//! refuses: match text that cuts no token under the index's tokenizer, +//! whose filter would match every row ([`TermError::EmptyTermText`]). The +//! stored side has no such refusal: a value with no tokens is stored as +//! the empty filter, which no query matches. A `Between` whose low bound is +//! above its high bound is not refused either: as SQL's `BETWEEN`, it +//! matches nothing. +//! +//! [`TermError::EmptyTermText`]: crate::sem::TermError::EmptyTermText +//! [`RangeQuery`]: crate::sem::RangeQuery +//! +//! The module is meant to be used by path (`op::Eq`): an imported `Eq` +//! would shadow the prelude's `Eq` trait. +//! +//! [`MatchQuery`]: crate::sem::MatchQuery +//! [`MatchTerms`]: crate::sem::MatchTerms +use std::fmt; +use std::marker::PhantomData; + +use stack_kms::MaybeSend; + +pub(crate) mod stats; +pub use stats::{Limit, Stats, DEFAULT_CONFIDENCE, MAX_ROWS}; + +use crate::sem::{ + DefaultMatch, EqualityTerm, MatchConfig, MatchQuery, MatchTerms, OpeTerm, Orderable, OreTerm, + QueryTokens, RangeQuery, +}; +use crate::target::{DeclaredContext, Equality, Index, Match, Ope, Ore, Owned, Pending}; +use crate::{Error, KeysetCipher, Label, NonEmpty, PlanError}; + +/// A query operator: a unit type naming what a query asks of the server, +/// and how many plaintexts it asks about ([`Arity`]). +/// +/// The trait is open, as [`Index`] is: an operator defined in another crate +/// is answered by the indexes that implement [`Supports`] for it. +pub trait Operator: Copy + 'static { + /// What a query for this operator takes: [`One`] plaintext, a + /// [`Pair`] of them as a tuple, or for [`AtPath`] a path and its leaf + /// operator's input ([`Pathed`]). + type Arity: Arity; +} + +/// Equality: rows whose value equals the query's. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] +pub struct Eq; + +impl Operator for Eq { + type Arity = One; +} + +/// Less than: rows whose value is below the query's. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] +pub struct Lt; + +/// Less than or equal: rows whose value is at or below the query's. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] +pub struct Lte; + +/// Greater than: rows whose value is above the query's. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] +pub struct Gt; + +/// Greater than or equal: rows whose value is at or above the query's. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] +pub struct Gte; + +/// A range: rows whose value is between the query's two bounds, inclusive +/// at both ends. It takes a [`Pair`], `cipher.query(op::Between, &(lo, hi))`, +/// derives both bounds under one context, and sends them as one term +/// ([`RangeQuery`]), so no statement can pair the +/// low bound of one query with the high bound of another. One value is +/// `(v, v)`. A pair whose low bound is above its high bound is not +/// refused: as SQL's `BETWEEN`, it matches nothing. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] +pub struct Between; + +impl Operator for Lt { + type Arity = One; +} +impl Operator for Lte { + type Arity = One; +} +impl Operator for Gt { + type Arity = One; +} +impl Operator for Gte { + type Arity = One; +} +impl Operator for Between { + type Arity = Pair; +} + +/// JSON containment: rows whose document contains the query's document +/// (`@>`). Exact. Declared by ADR-0009 and answered by no index yet: this +/// crate has no JSON index, so a query with it does not compile until one +/// exists. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] +pub struct Contains; + +/// JSON containment the other way: rows whose document is contained by +/// the query's (`<@`). Exact, and answered by no index yet, as +/// [`Contains`] is. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] +pub struct ContainedBy; + +/// The accessor: `Op` applied at a JSON path, `op::AtPath(op::Eq)`. It +/// takes a path and `Op`'s input, and inherits the fidelity of `Op` +/// ([`TermFor`]): `AtPath` and `AtPath` are exact, and an accessor +/// over a probabilistic leaf operator would be `Probabilistic`. +/// +/// `Op` is a [`Leaf`] operator, one that compares a single value at the +/// path: `AtPath` and `AtPath>` are not operators, +/// since neither is one selector and value. +/// +/// Its arity is [`Pathed`](Pathed), so `AtPath` (a path and +/// a value) and `AtPath` (a path and a pair of bounds) take +/// different inputs. No input of it exists yet: the path becomes a +/// selector only a JSON index can derive, and this crate has none, so a +/// query with `AtPath` does not compile until that index exists. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] +pub struct AtPath(pub Op); + +impl Operator for Contains { + type Arity = One; +} +impl Operator for ContainedBy { + type Arity = One; +} +impl Operator for AtPath { + type Arity = Pathed; +} + +/// An operator that compares one value, or one pair of bounds, and so can +/// be applied at a JSON path ([`AtPath`]): [`Eq`](struct@Eq), [`Lt`], +/// [`Lte`], [`Gt`], [`Gte`], [`Between`] and [`Matches`](struct@Matches). +/// Containment compares whole documents and an accessor already has a +/// path, so neither is a leaf. +/// +/// The trait is open, as [`Operator`] is, but its arity is [`One`] or +/// [`Pair`] ([`LeafArity`], sealed), so an accessor never nests. +#[diagnostic::on_unimplemented( + message = "`{Self}` is not a leaf operator, so it cannot be applied at a path", + label = "`op::AtPath` takes a leaf operator", + note = "`op::AtPath` applies `op::Eq`, `Lt`, `Lte`, `Gt`, `Gte`, `Between` or `Matches` at a path; `op::Contains` and `op::ContainedBy` compare whole documents, and an accessor does not nest" +)] +pub trait Leaf: Operator {} + +impl Leaf for Eq {} +impl Leaf for Lt {} +impl Leaf for Lte {} +impl Leaf for Gt {} +impl Leaf for Gte {} +impl Leaf for Between {} +impl Leaf for Matches {} + +/// How many plaintexts a query for an operator takes: [`One`] or a +/// [`Pair`], or for an accessor a path and its leaf's input ([`Pathed`]). +/// Sealed: the chain derives a term per plaintext and joins them as the +/// arity says, so there are exactly these. +pub trait Arity: sealed::Sealed + 'static {} + +/// The arity of a [`Leaf`] operator: [`One`] or [`Pair`], never +/// [`Pathed`]. Sealed. +pub trait LeafArity: Arity {} + +/// One plaintext: the query is given an `S` (`Eq`, `Lt`, `Matches`). +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] +pub struct One; + +/// Two plaintexts: the query is given an `(S, S)` (`Between`). +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] +pub struct Pair; + +/// A path and a leaf operator's input, of the leaf's arity `A`: what +/// [`AtPath`] takes. `Pathed` is a path and a value, +/// `Pathed` a path and a pair of bounds, so an input can derive one +/// term or two as the leaf needs. No [`Input`] of this arity exists yet; +/// it arrives with the JSON index, whose selector the path becomes. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] +pub struct Pathed(PhantomData); + +impl Arity for One {} +impl Arity for Pair {} +impl Arity for Pathed {} +impl LeafArity for One {} +impl LeafArity for Pair {} + +/// What a query of arity `A` is given, and the plaintext its index is +/// declared over: an `S` is an input of [`One`] over `S`, and an `(S, S)` +/// an input of [`Pair`] over `S`. The chain's value type is the input, and +/// the plan is checked against the plaintext. +/// +/// Those are the two impls; an input of [`Pathed`] arrives with the JSON +/// index. The arity decides how the chain derives terms from the input, +/// which is what [`derive`](Self::derive) does. +#[diagnostic::on_unimplemented( + message = "`{Self}` is not what a query of arity `{A}` takes", + label = "the operator takes another input", + note = "an operator of arity `One` takes one value, `op::Between` (arity `Pair`) takes a pair, `&(lo, hi)`, and `op::AtPath` (arity `Pathed`) takes no input yet: it arrives with the JSON index" +)] +pub trait Input: Sized + 'static { + /// The plaintext the index is declared over. + type Plaintext: 'static; + /// The index's terms for this input: one, or a pair of them. + type Terms: 'static; + + /// Derive the index's term for each plaintext of the input under + /// `label`, as one pending. Only a query chain calls this. + #[doc(hidden)] + fn derive<'a, 'p, I, K>( + self, + index: &I, + keyset: &'p KeysetCipher<'a, K>, + label: Label, + extend: DeclaredContext, + ) -> Pending<'p, Self::Terms, K> + where + I: Index, + K: 'static; +} + +impl Input for S { + type Plaintext = S; + type Terms = T; + + fn derive<'a, 'p, I, K>( + self, + index: &I, + keyset: &'p KeysetCipher<'a, K>, + label: Label, + extend: DeclaredContext, + ) -> Pending<'p, I::Term, K> + where + I: Index, + K: 'static, + { + keyset.run( + index.operation::().under(NonEmpty::from(label)), + self, + extend, + ) + } +} + +/// Both bounds under the one label, settled together. +impl Input for (S, S) { + type Plaintext = S; + type Terms = (T, T); + + fn derive<'a, 'p, I, K>( + self, + index: &I, + keyset: &'p KeysetCipher<'a, K>, + label: Label, + extend: DeclaredContext, + ) -> Pending<'p, (I::Term, I::Term), K> + where + I: Index, + K: 'static, + { + let (lo, hi) = self; + let lo = keyset.run( + index + .operation::() + .under(NonEmpty::from(label.clone())), + lo, + extend.clone(), + ); + let hi = keyset.run( + index.operation::().under(NonEmpty::from(label)), + hi, + extend, + ); + lo.zip(hi) + } +} + +/// A plaintext the ordering operators ([`Lt`], [`Lte`], [`Gt`], [`Gte`], +/// [`Between`]) are answered over: the integers of 16 bits and wider, the +/// floats (`f32` and `f64`) and text (`String`). Not `u8` or `i8`, which +/// have no order term ([`Orderable`] says why), as `bool` has none. Each is +/// encoded as its [`Orderable`] target and its terms order as cllw-ore +/// orders that encoding: integers as numbers; floats as Postgres's `float8` +/// does, `-0.0` tied with `0.0` and every NaN one value above `+Infinity`, +/// an `f32` as the `f64` it widens to; text by the system ADR-0002's fold, +/// Unicode 16 NFC with case and accents folded, so `Café`, `cafe` and +/// `CAFÉ` tie and `alice` orders before `Zoe` (ADR-0009). +/// +/// Sealed: a type joins only when the order its terms compare in is the +/// one its operators promise, so a type whose terms could order otherwise +/// (a newtype over folded text, say) must not be able to join. A type that +/// meets every other bound is still refused: +/// +/// ```compile_fail +/// use stack_encrypt::op::Ordered; +/// +/// struct Folded(u32); +/// +/// impl Ordered for Folded {} // `Ordered` is sealed +/// ``` +/// +/// [`Orderable`]: crate::sem::Orderable +#[diagnostic::on_unimplemented( + message = "`{Self}` is not ordered: the ordering operators are answered over the integers of 16 bits and wider, the floats and text", + label = "no ordering operator over this type", + note = "`Lt`, `Lte`, `Gt`, `Gte` and `Between` take `u16` to `u128`, `i16` to `i128`, `f32`, `f64` or a `String`; a `u8`, an `i8` and a `bool` have no order term" +)] +pub trait Ordered: sealed::Sealed + Orderable {} + +macro_rules! ordered { + ($($ty:ty),+ $(,)?) => {$( + impl sealed::Sealed for $ty {} + impl Ordered for $ty {} + )+}; +} +ordered!(u16, u32, u64, u128, i16, i32, i64, i128, f32, f64, String); + +/// Text search: rows whose text contains the query's tokens, under the +/// match index's tokenizer. Not containment: a Bloom match is order- and +/// multiplicity-insensitive. +/// +/// `C` is the case the query is asked in, [`CaseInsensitive`] unless named +/// otherwise. A match index answers only the case its configuration fixes +/// ([`MatchCase`]), so asking a case-folding index for a case-sensitive +/// match is a compile error rather than a query that quietly folds case. +/// +/// The value [`Matches`](constant@Matches) is the case-insensitive operator, +/// as `PhantomData` is a value of its type; [`case_sensitive`](Matches::case_sensitive) +/// is the other. +pub struct Matches { + case: PhantomData C>, +} + +/// The case-insensitive text search operator, as a value: +/// `cipher.query(op::Matches, "ali")`. +#[allow(non_upper_case_globals)] +pub const Matches: Matches = Matches::new(); + +impl Matches { + /// The operator in the case `C`: `Matches::::new()`. + pub const fn new() -> Self { + Self { case: PhantomData } + } +} + +impl Matches { + /// The case-sensitive text search operator: + /// `cipher.query(op::Matches.case_sensitive(), "Ali")`. Only a match + /// index whose configuration does not fold case answers it. + pub const fn case_sensitive(self) -> Matches { + Matches::new() + } +} + +// By hand, so `C` (a marker type) need not implement them. +impl Clone for Matches { + fn clone(&self) -> Self { + *self + } +} +impl Copy for Matches {} +impl Default for Matches { + fn default() -> Self { + Self::new() + } +} +impl PartialEq for Matches { + fn eq(&self, _: &Self) -> bool { + true + } +} +impl std::cmp::Eq for Matches {} +impl std::hash::Hash for Matches { + fn hash(&self, _: &mut H) {} +} +impl fmt::Debug for Matches { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "Matches<{}>", C::NAME) + } +} + +impl Operator for Matches { + type Arity = One; +} + +mod sealed { + pub trait Sealed {} + impl Sealed for super::CaseInsensitive {} + impl Sealed for super::CaseSensitive {} + impl Sealed for super::One {} + impl Sealed for super::Pair {} + impl Sealed for super::Pathed {} +} + +/// The case a text operator is asked in: [`CaseInsensitive`] or +/// [`CaseSensitive`]. Sealed: there are exactly two. +pub trait Case: sealed::Sealed + 'static { + /// Whether text is lower-cased before it is tokenised. + const FOLDS: bool; + /// The case's name, for `Debug`. + const NAME: &'static str; +} + +/// Case-insensitive: text is lower-cased before it is tokenised. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] +pub struct CaseInsensitive; + +/// Case-sensitive: text is tokenised as written. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] +pub struct CaseSensitive; + +impl Case for CaseInsensitive { + const FOLDS: bool = true; + const NAME: &'static str = "CaseInsensitive"; +} +impl Case for CaseSensitive { + const FOLDS: bool = false; + const NAME: &'static str = "CaseSensitive"; +} + +/// The case a match configuration fixes, as a type, so the operators its +/// index answers are known at compile time. +/// +/// `Case::FOLDS` must equal the configuration's +/// [`MatchOptions::downcase`](crate::sem::MatchOptions::downcase): the type +/// cannot see the options, so a query through a configuration whose two +/// disagree is refused when it is awaited, with +/// [`PlanError::MatchCase`]. A configuration +/// that does not implement this can still store match terms, but nothing +/// queries them: [`Matches`](struct@Matches) needs this impl, and there is +/// no index-level query. Implementing it is one line, `type Case = +/// CaseSensitive;` or `type Case = CaseInsensitive;`, matching `downcase`. +pub trait MatchCase: MatchConfig { + /// The case the configuration's index answers. + type Case: Case; +} + +impl MatchCase for DefaultMatch { + type Case = CaseInsensitive; +} + +/// A value a query sends to the server to compare against stored terms. +/// +/// This trait says only that a value is a query term. How far the server's +/// answer can be trusted is said by the traits that refine it: a term that +/// can return false positives says how a row is checked (ADR-0009, +/// decision 4), and one that refines nothing is exact. +pub trait QueryTerm {} + +impl QueryTerm for EqualityTerm {} +impl QueryTerm for MatchQuery {} +impl QueryTerm for OreTerm {} +impl QueryTerm for OpeTerm {} +impl QueryTerm for RangeQuery {} + +/// A query term whose answer can hold **false positives and no false +/// negatives**: a row the server returns may not match, and a row that +/// matches is always returned. +/// +/// [`verify`](Self::verify) is the operator's own meaning, run on a +/// decrypted value: it decides whether a row the server returned is a real +/// match. The library never runs a query, so it cannot drop the false +/// positives itself; a caller filters the decrypted rows with `verify`. +/// +/// An exact term does not implement this, so `verify` on one is a compile +/// error rather than a method that is always `true`. +pub trait Probabilistic: QueryTerm { + /// The decrypted value `verify` reads: the plaintext the index was + /// declared over, which is not always the value the user wrote. + type Plaintext: ?Sized; + + /// Whether `value`, a row's decrypted value, really matches the query. + /// + /// Infallible: it runs on a value already decrypted and already the type + /// the index was declared over, so every outcome other than a match is + /// `false`, never an error. + fn verify(&self, value: &Self::Plaintext) -> bool; + + /// How many candidate rows to fetch so that, at the confidence `stats` + /// names, `want` of them [`verify`](Self::verify), when the table holds + /// that many matches. + /// + /// A probabilistic bound, not a guarantee: at 99% confidence one query + /// in a hundred draws more false positives than it allows for, and the + /// model assumes a non-matching row shares no token with the query, + /// which natural text does not honour, so the confidence is nominal. + /// The candidate count says which case a fetch is in. If the server + /// returned fewer rows than the limit, the predicate is exhausted, and + /// fewer than `want` verified rows means fewer than `want` matches. If + /// it returned exactly the limit and fewer than `want` verified, the + /// result is a page: carry on from its last row with a cursor. + fn target_limit(&self, want: u64, stats: &Stats) -> Limit; +} + +/// The query terms that may answer the operator `Op`: what +/// [`Supports::Query`] must be. +/// +/// Most operators take any [`QueryTerm`]. One whose answer is inherently +/// approximate requires more: a term that answers [`Matches`](struct@Matches) must be +/// [`Probabilistic`], so none of this crate's indexes can claim a text +/// match without saying how its answer is checked. +/// +/// The rule binds this crate's terms, through the blanket impls below. A +/// term defined in another crate can implement this for an operator by +/// hand, and coherence lets it; the bound is a guide there, not a proof. An +/// operator defined in another crate states its requirement the same way, +/// one term type at a time. +#[diagnostic::on_unimplemented( + message = "`{Self}` cannot answer `{Op}`", + label = "this query term does not meet the operator's requirement", + note = "a term that answers `op::Matches` must implement `op::Probabilistic`" +)] +pub trait TermFor: QueryTerm {} + +impl TermFor for T {} +impl TermFor for T {} +impl TermFor for T {} +impl TermFor for T {} +impl TermFor for T {} +impl TermFor for T {} +impl TermFor for T {} +impl TermFor for T {} +impl TermFor> for T {} +/// An accessor inherits its leaf's requirement: what answers `Op` at a +/// path is held to what answers `Op`. +impl> TermFor> for T {} + +/// An index that answers the operator `Op` for the input `In`, and the +/// query term it sends for it. +/// +/// `In` is what the query is given: the plaintext the index is declared +/// over for an operator of arity [`One`] (`Supports`), a pair of +/// them for [`Between`] (`Supports`); [`Input`] relates +/// the two. +/// +/// [`Index::Term`] is what the index derives, once per plaintext of the +/// input; [`query`](Self::query) makes the query term from those and from +/// the query's [`Verifier`](Self::Verifier). For an equality index the two +/// are the same HMAC and there is nothing to verify. For a match index they +/// are not: the query is a filter over the query's value, which matches +/// some rows that do not hold the value, so the query keeps that value's +/// tokens to [`verify`](Probabilistic::verify) each decrypted row. +/// For `Between` the two terms of the bounds become one +/// [`RangeQuery`]. +#[diagnostic::on_unimplemented( + message = "`{Self}` does not answer `{Op}` given `{In}`", + label = "this index cannot answer the operator for this input", + note = "an equality index answers `op::Eq`; a match index answers `op::Matches` over text, in the case its configuration fixes; an ORE or OPE index answers `op::Lt`, `Lte`, `Gt` and `Gte` over an integer, and `op::Between` over a pair of them" +)] +pub trait Supports>: Index { + /// What this index sends for `Op`. + type Query: TermFor; + /// What the query term keeps of its input so that it can later check a + /// decrypted row, taken before the input is consumed. + /// + /// An exact term checks nothing, so its verifier is `()`. A match + /// query's is [`crate::sem::QueryTokens`]: `Supports for Match` cuts `"alice"` into `ali`, `lic`, `ice`, and + /// [`MatchQuery::verify`](Probabilistic::verify) passes a row only if + /// its own text holds all three. The filter cannot give the tokens back, + /// so without the verifier a Bloom false positive would reach the caller. + type Verifier: MaybeSend + 'static; + /// Why this index cannot answer `Op` as configured, or for `input`, if + /// it cannot: a match index whose [`MatchCase`] disagrees with its + /// options ([`PlanError::MatchCase`]), a match query of text that cuts + /// no token ([`TermError::EmptyTermText`](crate::sem::TermError::EmptyTermText)), + /// whose filter would match every row. + /// Run when the query is awaited, before any key is requested; an + /// index that refuses nothing returns `Ok(())`. + fn check(&self, input: &In) -> Result<(), Error>; + /// The verifier of the query's `input`. + fn verifier(&self, input: &In) -> Self::Verifier; + /// [`check`](Self::check), then [`verifier`](Self::verifier): the query's + /// verifier of `input`, or why the index refuses it. A query chain + /// calls this when it derives the term. An index whose check and verifier + /// do the same work overrides it to do that work once: a match index + /// tokenises the query's value for both. + fn admit(&self, input: &In) -> Result { + self.check(input)?; + Ok(self.verifier(input)) + } + /// The query term, from the verifier and the terms the index derived + /// for the input's plaintexts. Only a query chain calls this: + /// `QueryToken` cannot be made outside this crate, so no caller can + /// pair one query's tokens with another value's filter, or pass a + /// stored term off as a query. + fn query( + verifier: Self::Verifier, + terms: In::Terms, + token: QueryToken, + ) -> Self::Query; +} + +/// Proof that [`Supports::query`] is called by a query chain. Only this +/// crate can make one, so an index in another crate can implement +/// [`Supports`] but no caller can turn a term into a query term by hand. +#[derive(Debug)] +pub struct QueryToken(()); + +impl QueryToken { + pub(crate) fn new() -> Self { + Self(()) + } +} + +impl Supports for Equality { + type Query = EqualityTerm; + type Verifier = (); + fn check(&self, _: &S) -> Result<(), Error> { + Ok(()) + } + fn verifier(&self, _: &S) {} + fn query((): (), term: EqualityTerm, _: QueryToken) -> EqualityTerm { + term + } +} + +impl Supports, S> for Match +where + S: AsRef + 'static, + O: MatchCase, +{ + type Query = MatchQuery; + type Verifier = QueryTokens; + fn check(&self, value: &S) -> Result<(), Error> { + self.admit(value).map(drop) + } + fn verifier(&self, value: &S) -> QueryTokens { + // `admit` refuses text the index cannot normalize, so this is the + // query's tokens; a query that got here otherwise verifies nothing. + QueryTokens::of::(value.as_ref()).unwrap_or_default() + } + fn admit(&self, value: &S) -> Result { + let folds = O::options().downcase; + if folds != O::Case::FOLDS { + return Err(PlanError::MatchCase { + declared: O::Case::NAME, + folds, + } + .into()); + } + // Options the index cannot use, checked before the text is + // tokenised (an n-gram length of zero would otherwise reach the + // tokenizer), then a query with no tokens, which would match every + // row: the stored side keeps such a value as the empty filter, the + // query side refuses it here, before any term is derived. + Ok(QueryTokens::of_query(value.as_ref(), &O::options())?) + } + fn query(tokens: QueryTokens, term: MatchTerms, _: QueryToken) -> MatchQuery { + MatchQuery::new(term, tokens) + } +} + +/// The ordering operators on the ORE and OPE indexes, over the integer +/// types ([`Ordered`]). The query term for a comparison is the index's own +/// term for the value: this crate's ORE is CLLW, whose ciphertext has no +/// left half to send alone, so what is sent is what is stored, as for an +/// HMAC. `Between` sends both bounds' terms as one `RangeQuery`. +macro_rules! orders { + ($($index:ident => $term:ident),+ $(,)?) => {$( + orders!(@one $index => $term; Lt, Lte, Gt, Gte); + impl Supports for $index { + type Query = RangeQuery<$term>; + type Verifier = (); + fn check(&self, _: &(S, S)) -> Result<(), Error> { + Ok(()) + } + fn verifier(&self, _: &(S, S)) {} + fn query((): (), (lo, hi): ($term, $term), _: QueryToken) -> Self::Query { + RangeQuery::new(lo, hi) + } + } + impl Answers for $term { + type Via = $index; + } + )+}; + (@one $index:ident => $term:ident; $($op:ident),+) => {$( + impl Supports<$op, S> for $index { + type Query = $term; + type Verifier = (); + fn check(&self, _: &S) -> Result<(), Error> { + Ok(()) + } + fn verifier(&self, _: &S) {} + fn query((): (), term: $term, _: QueryToken) -> $term { + term + } + } + impl Answers<$op, S> for $term { + type Via = $index; + } + )+}; +} +orders!(Ore => OreTerm, Ope => OpeTerm); + +/// The ordering operators default to the ORE index; an OPE index is named +/// with `.via(Ope)`. +macro_rules! default_ore { + ($($op:ident),+ $(,)?) => {$( + impl DefaultIndex for $op { + type Via = Ore; + } + )+}; +} +default_ore!(Lt, Lte, Gt, Gte); + +impl DefaultIndex<(S, S)> for Between { + type Via = Ore; +} + +/// A target type that answers the operator `Op` for the input `In`, and +/// the index it answers it with. +/// +/// Written by hand per type: a type with two indexes that both answer an +/// operator chooses the cheaper or the more private, as the indexes in play +/// dictate, and that choice decides what the query term reveals. A type +/// that does not answer an operator has no impl, and the query does not +/// compile. +#[diagnostic::on_unimplemented( + message = "`{Self}` does not answer `{Op}` given `{In}`", + label = "this target type does not answer the operator", + note = "a target answers the operators its type implements `Answers` for; `.via(index)` names an index the target declares" +)] +pub trait Answers> { + /// The index that answers `Op` for this type. An index is a unit type, + /// so its `Default` is the index. + type Via: Supports + Default; +} + +impl Answers for EqualityTerm { + type Via = Equality; +} + +impl Answers, S> for MatchTerms +where + S: AsRef + 'static, + O: MatchCase, +{ + type Via = Match; +} + +/// A ciphertext with one term beside it, the shape of a `plaintext = ..` +/// record without the struct, answers what its term answers. +impl, T: Answers> Answers + for (crate::StackCipherText, T) +{ + type Via = T::Via; +} + +/// A ciphertext with one term, as [`indexed`](crate::target::indexed) +/// produces it, answers what its term answers. One with several terms +/// names the index with `.via(index)`. +impl, T: Answers> Answers + for crate::target::Encrypted +{ + type Via = T::Via; +} + +/// The index a plan that declares its indexes answers an operator with: +/// a field of a fields plan, or a one-value plan built `with` indexes. +/// +/// A plan that declares a different index for the operator, such as a +/// match index with its own configuration, names it with `.via(index)`. +/// So does a typed field of a fields plan (`encrypt_into::(name)`): +/// the field's type is not known where the query is written, so its +/// [`Answers`] impl is not consulted, and a field whose type answers +/// through another index needs `via`. +#[diagnostic::on_unimplemented( + message = "`{Self}` has no default index given `{In}`", + label = "no default index answers this operator here", + note = "`op::Eq` defaults to `Equality`; `op::Matches` defaults to `Match` with the default configuration, which is case-insensitive and over text only; `op::Lt`, `Lte`, `Gt`, `Gte` and `Between` default to `Ore` over an integer, and `Between` takes a pair; name another index, such as `Ope`, with `.via(index)`; no index answers `op::Contains`, `op::ContainedBy` or `op::AtPath` yet, since this crate has no JSON index" +)] +pub trait DefaultIndex>: Operator { + /// The index. An index is a unit type, so its `Default` is the index. + type Via: Supports + Default; +} + +impl DefaultIndex for Eq { + type Via = Equality; +} + +impl + 'static> DefaultIndex for Matches<::Case> { + type Via = Match; +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn the_default_match_configuration_folds_case_as_its_type_says() { + assert_eq!( + ::Case::FOLDS, + DefaultMatch::options().downcase + ); + } + + /// A match index's verifier is the query's tokens: a query built from + /// it verifies a row that holds them and no other. A query chain takes + /// them through `admit`, so this is the one test that calls `verifier`. + #[test] + fn a_match_verifier_is_the_query_tokens() { + let index = Match::::default(); + let verifier = + Supports::, String>::verifier(&index, &"alice".to_owned()); + let filter = MatchTerms::::from_positions(vec![1]).expect("in range"); + let query = MatchQuery::new(filter, verifier); + assert!(Probabilistic::verify(&query, "say hi to Alice")); + assert!(!Probabilistic::verify(&query, "bob")); + } + + #[test] + fn an_operator_is_equal_to_itself() { + assert_eq!(Matches::::new(), Matches); + assert_eq!(Eq, Eq); + } + + #[test] + fn an_operator_debugs_with_its_case() { + assert_eq!( + format!("{:?}", Matches.case_sensitive()), + "Matches" + ); + assert_eq!(format!("{:?}", Eq), "Eq"); + assert_eq!(format!("{:?}", Between), "Between"); + assert_eq!(format!("{:?}", AtPath(Gte)), "AtPath(Gte)"); + assert_eq!(AtPath(Matches.case_sensitive()).0, Matches.case_sensitive()); + } + + /// An accessor is held to its leaf's requirement: an exact term + /// answers `AtPath` and `AtPath`, and only a probabilistic one + /// answers `AtPath`. Containment takes any term. + #[test] + fn an_accessor_inherits_the_fidelity_of_its_leaf() { + fn answers>() {} + answers::, EqualityTerm>(); + answers::, OreTerm>(); + answers::, RangeQuery>>(); + answers::, MatchQuery>(); + answers::(); + answers::(); + // `answers::, EqualityTerm>()` does not compile: + // `tests/ui/op_at_path_inherits_fidelity.rs`. Nor does an accessor + // over a non-leaf: `tests/ui/op_at_path_not_a_leaf.rs`. + } + + /// An accessor's arity carries its leaf's, so an input can tell a path + /// and a value from a path and a pair of bounds. + #[test] + fn an_accessor_takes_its_leafs_arity_under_a_path() { + fn arity, A: Arity>() {} + arity::, Pathed>(); + arity::, Pathed>(); + arity::, Pathed>(); + } + + /// An ordering refuses no value: a range whose bounds are the wrong way + /// round matches nothing, as SQL's `BETWEEN` does. + #[test] + fn an_ordering_refuses_no_value() { + let ok = |pair: (u32, u32)| Supports::::check(&Ore, &pair).is_ok(); + assert!(ok((1, 2))); + assert!(ok((2, 2))); + assert!(ok((3, 2))); + assert!(Supports::::check(&Ope, &(1, -1)).is_ok()); + assert!(Supports::::check(&Ore, &7).is_ok()); + assert!(Supports::::check(&Ope, &-7).is_ok()); + } +} diff --git a/packages/stack-encrypt/src/op/stats.rs b/packages/stack-encrypt/src/op/stats.rs new file mode 100644 index 000000000..e1c7a46e3 --- /dev/null +++ b/packages/stack-encrypt/src/op/stats.rs @@ -0,0 +1,507 @@ +//! How many rows to fetch for a probabilistic query: [`Stats`] in, +//! [`Limit`] out (ADR-0009, decision 5). +//! +//! A Bloom match returns every real match and some rows that matched by +//! chance. A non-matching row whose stored filter has fill `f` (the +//! fraction of its bits set) passes a query that sets `b` bits with +//! probability about `f^b`. Over a table the pass rate `p` is the *mean* of +//! each row's `f^b`, and the false positives a query scanning `N` rows +//! draws are `Poisson(λ = p·N)`. To expect `want` real matches at a given +//! confidence, fetch +//! +//! ```text +//! want + Poisson_quantile(λ, confidence) +//! ``` +//! +//! rows. The bound is probabilistic: at 99% confidence one query in a +//! hundred draws more false positives than the quantile. + +/// What a probabilistic query's [`target_limit`] knows of the table: how +/// many rows the predicate scans, how full their stored filters are, and +/// the confidence the fetch should meet. +/// +/// The numbers come from the server, read by the application at startup or +/// on a timer and kept as plain numbers. None of them is secret: the server +/// holds the filters and the catalog holds the row count. A stale `Stats` +/// moves the confidence, never the correctness, because +/// [`verify`](super::Probabilistic::verify) still decides every row. +/// +/// [`target_limit`]: super::Probabilistic::target_limit +#[derive(Clone, Debug, PartialEq)] +pub struct Stats { + rows: u64, + fill: Fill, + confidence: f64, +} + +/// Where a [`Stats`] takes the stored filters' fill from. +#[derive(Clone, Debug, PartialEq)] +enum Fill { + /// The index's declared `expected_tokens` prior. + Declared, + /// A histogram of set-bit counts: `(bits, rows)` pairs. + Measured(Vec<(u32, u64)>), +} + +/// The confidence a [`Stats`] targets unless told otherwise. +pub const DEFAULT_CONFIDENCE: f64 = 0.99; + +/// The largest fetch a [`Limit`] names: PostgreSQL's `LIMIT` is a signed +/// 64-bit integer. +pub const MAX_ROWS: u64 = i64::MAX as u64; + +impl Stats { + /// Statistics from the index's declared prior + /// ([`MatchConfig::expected_tokens`](crate::sem::MatchConfig::expected_tokens)) + /// and an estimate of the rows the query scans. + /// + /// `rows` counts the rows the predicate can match: those whose value is + /// not NULL, since a NULL stores no filter and never passes. One catalog + /// read gives it, and gives no row while the count is unknown: + /// + /// ```sql + /// SELECT (c.reltuples * (1 - coalesce(s.null_frac, 0)))::bigint + /// FROM pg_class c + /// LEFT JOIN pg_stats s + /// ON s.schemaname = 'public' AND s.tablename = 'users' AND s.attname = 'name' + /// WHERE c.oid = 'users'::regclass AND c.reltuples >= 0 + /// ``` + /// + /// `reltuples` is −1 for a table never vacuumed or analysed, such as one + /// just bulk-loaded. That is an unknown count, not an empty table: a + /// count of 0 would promise a fetch of exactly `want`. With no row, + /// build no `Stats`; page with a cursor ([`Limit::Unbounded`]) or run + /// `ANALYZE` first. + /// + /// The prior knows nothing about the spread of value lengths, so it + /// underestimates a column of mixed lengths; measure the column + /// ([`measured`](Self::measured)) once it holds data. An index that + /// declares no prior gives [`Limit::Unbounded`]. + pub fn declared(rows: u64) -> Self { + Self { + rows, + fill: Fill::Declared, + confidence: DEFAULT_CONFIDENCE, + } + } + + /// Statistics from a measured histogram of the stored filters' set-bit + /// counts, as `(bits, rows)` pairs, and an estimate of the rows the + /// query scans, read as [`declared`](Self::declared) says. + /// + /// One aggregate over the column gives the histogram, with at most `m` + /// buckets; a page sample bounds its cost on a large table: + /// + /// ```sql + /// SELECT cardinality(eql_v4.match_term(name)) AS bits, count(*) + /// FROM users TABLESAMPLE SYSTEM (1) + /// WHERE name IS NOT NULL + /// GROUP BY 1 + /// ``` + /// + /// A page sample can select no page of a small table, so drop the + /// `TABLESAMPLE` there. An empty histogram falls back to the declared + /// prior. + pub fn measured(rows: u64, histogram: impl IntoIterator) -> Self { + Self { + rows, + fill: Fill::Measured(histogram.into_iter().collect()), + confidence: DEFAULT_CONFIDENCE, + } + } + + /// Target `confidence` instead of 99%: the probability that the fetch + /// holds `want` real matches when the table has that many. Outside the + /// open interval `(0, 1)` there is no finite fetch to promise, and + /// [`target_limit`](super::Probabilistic::target_limit) answers + /// [`Limit::Unbounded`]. So it does past ten million expected false + /// positives for a confidence above `1 − 1e-15`, which the conservative + /// bound used there cannot meet. + pub fn with_confidence(mut self, confidence: f64) -> Self { + self.confidence = confidence; + self + } + + /// The rows the query scans. + pub fn rows(&self) -> u64 { + self.rows + } + + /// The confidence the fetch targets. + pub fn confidence(&self) -> f64 { + self.confidence + } + + /// The probability that one non-matching row passes a query that sets + /// `bits` of an `m`-bit filter, or `None` when nothing is known of the + /// stored filters' fill. `declared` is the fill of one stored filter + /// under the index's prior, if it declares one. + pub(crate) fn pass_rate(&self, bits: u32, m: u32, declared: Option) -> Option { + let measured = match &self.fill { + Fill::Measured(histogram) => mean_power(histogram, bits, m), + Fill::Declared => None, + }; + measured.or_else(|| declared.map(|fill| fill.powi(bits as i32))) + } + + /// The fetch for `want` real matches at pass rate `p`. Wanting none + /// is a fetch of none, whatever is known of the table. + pub(crate) fn limit(&self, want: u64, pass_rate: Option) -> Limit { + if want == 0 { + return Limit::Rows(0); + } + let Some(p) = pass_rate else { + return Limit::Unbounded; + }; + let promisable = self.confidence > 0.0 && self.confidence < 1.0; + if !promisable || !p.is_finite() { + return Limit::Unbounded; + } + let lambda = p.clamp(0.0, 1.0) * self.rows as f64; + match poisson_quantile(lambda, self.confidence) { + Some(extra) => Limit::Rows(want.saturating_add(extra).min(MAX_ROWS)), + None => Limit::Unbounded, + } + } +} + +/// The mean of `(bits_i / m)^b` over a histogram of set-bit counts, or +/// `None` for an empty one. A count above `m` (a histogram from another +/// configuration) is a full filter. +fn mean_power(histogram: &[(u32, u64)], b: u32, m: u32) -> Option { + // Summed as floats: counts from a caller need not fit a `u64` total. + let rows: f64 = histogram.iter().map(|&(_, rows)| rows as f64).sum(); + if rows == 0.0 || m == 0 { + return None; + } + let total: f64 = histogram + .iter() + .map(|&(bits, rows)| { + let fill = (f64::from(bits) / f64::from(m)).min(1.0); + rows as f64 * fill.powi(b as i32) + }) + .sum(); + Some(total / rows) +} + +/// The fill of one stored filter of `tokens` tokens, each setting `k` of +/// `m` bits: `1 − e^(−k·tokens/m)`. +pub(crate) fn expected_fill(tokens: u32, k: usize, m: u32) -> f64 { + 1.0 - (-(k as f64) * f64::from(tokens) / f64::from(m)).exp() +} + +/// How many rows a probabilistic query should fetch. Never more than +/// [`MAX_ROWS`], the largest `LIMIT` PostgreSQL takes. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Limit { + /// Fetch this many rows: `want` and the false positives expected at the + /// stated confidence. + Rows(u64), + /// No finite fetch can be promised: the statistics say nothing about + /// the stored filters, or the confidence is not below 1 (or, past ten + /// million expected false positives, not below `1 − 1e-15`). Page through + /// the candidates with a cursor until `want` rows verify. + Unbounded, +} + +impl Limit { + /// The rows to fetch, if a finite fetch can be promised. + pub fn rows(self) -> Option { + match self { + Self::Rows(rows) => Some(rows), + Self::Unbounded => None, + } + } + + /// The rows to fetch, or `page` when no finite fetch can be promised, + /// for a caller that pages either way. Never more than [`MAX_ROWS`]: + /// a larger `page` is cut to it. + pub fn fetch_or(self, page: u64) -> u64 { + self.rows().unwrap_or(page.min(MAX_ROWS)) + } +} + +/// The smallest `q` with `P(X ≤ q) ≥ confidence` for `X ~ Poisson(λ)`. +/// +/// The probabilities are summed over a window from `λ − 10√λ` (or 0) that is +/// `22√λ + 50` wide, which holds all but about `1e-23` of the mass, and +/// normalised by the window's total. Each term is kept as a log relative to +/// the window's first, so no term carries the cancellation of `−λ + k·ln λ − ln k!` at a +/// large `λ`, and the sums run from the small end, so a confidence close to +/// 1 compares against a tail summed without losing it to rounding. The +/// answer is exact to within one at any confidence below `1 − 1e-12`. The +/// work is about `22√λ` terms. +/// Past `1e7` expected false positives the query is hopeless anyway and the +/// answer is the conservative `λ + 8√λ`, which covers any confidence up to +/// [`FALLBACK_CONFIDENCE`]; above it there is no answer (`None`), since an +/// eight-sigma tail is about `6e-16`. +/// +/// `λ ≤ 0` and NaN have a window of one term at 0, so the answer is 0. +pub(crate) fn poisson_quantile(lambda: f64, confidence: f64) -> Option { + if lambda > 1e7 { + return (confidence <= FALLBACK_CONFIDENCE) + .then(|| (lambda + 8.0 * lambda.sqrt()).ceil() as u64); + } + let spread = lambda.sqrt(); + // A float-to-integer cast saturates, and maps NaN to 0. + let start = (lambda - 10.0 * spread).floor().max(0.0) as u64; + // `22√λ + 50` past `start` reaches `λ + 12√λ + 50`. Capped, so no input + // makes the window large: below `1e7` it is at most about 70,000 terms. + let width = ((22.0 * spread + 50.0).ceil() as u64).min(MAX_WINDOW); + let ln_lambda = lambda.ln(); + // Each term is `e^log` with `log` relative to the window's first term. + // From `λ − 10√λ` to the mode that ratio is at most about `e^50`, and + // from 0 to the mode of a `λ` below 100 about `e^λ`, so no term + // overflows and none of the mass is lost to underflow. + let mut weights = Vec::with_capacity(width as usize + 1); + let mut log_term = 0.0; + for offset in 0..=width { + if offset > 0 { + log_term += ln_lambda - ((start + offset) as f64).ln(); + } + weights.push(log_term.exp()); + } + // Summed from the top down, where the terms are smallest, so the tail a + // high confidence compares against is not lost to rounding. + let total: f64 = weights.iter().rev().sum(); + let allowed = (1.0 - confidence) * total; + // Walking down from the top, `above` is the mass strictly above `k`. + // The answer is the lowest `k` whose mass above is within what the + // confidence allows. + let mut answer = start + width; + let mut above = 0.0; + for (offset, weight) in weights.iter().enumerate().rev() { + if above <= allowed { + answer = start + offset as u64; + above += weight; + } else { + break; + } + } + Some(answer) +} + +/// The highest confidence [`poisson_quantile`]'s bound past `1e7` meets: +/// `λ + 8√λ` leaves about `6e-16` of the mass above it. +const FALLBACK_CONFIDENCE: f64 = 1.0 - 1e-15; + +/// The most terms [`poisson_quantile`] sums: far more than any `λ` below +/// `1e7` needs, and a bound on the work whatever it is handed. +const MAX_WINDOW: u64 = 1 << 20; + +#[cfg(test)] +mod tests { + use super::*; + + /// Reference quantiles, computed exactly with `math.lgamma` in log space. + #[test] + fn the_poisson_quantile_matches_reference_values() { + for (lambda, confidence, expected) in [ + (0.034, 0.99, 1), + (0.439, 0.99, 3), + (1.0, 0.5, 1), + (1.0, 0.99, 4), + (10.0, 0.99, 18), + (57.8, 0.99, 76), + (100.0, 0.99, 124), + (245.0, 0.99, 282), + (1000.0, 0.999, 1099), + (3800.0, 0.99, 3944), + (7600.0, 0.99, 7804), + (1e6, 0.99, 1_002_327), + ] { + assert_eq!( + poisson_quantile(lambda, confidence), + Some(expected), + "λ = {lambda}, confidence = {confidence}" + ); + } + assert_eq!(poisson_quantile(0.0, 0.99), Some(0)); + assert_eq!(poisson_quantile(-1.0, 0.99), Some(0)); + } + + #[test] + fn past_ten_million_the_quantile_is_conservative() { + let lambda = 4e7; + let q = poisson_quantile(lambda, 0.999_999).unwrap(); + assert!(q as f64 >= lambda + 4.9 * lambda.sqrt(), "{q}"); + assert!(q as f64 <= lambda + 8.0 * lambda.sqrt() + 1.0, "{q}"); + } + + /// The bound past ten million covers an eight-sigma tail and no more: + /// a confidence it cannot meet has no finite fetch. + #[test] + fn past_ten_million_a_confidence_beyond_eight_sigma_is_unbounded() { + let at = (4e7 + 8.0 * 4e7f64.sqrt()).ceil() as u64; + assert_eq!(poisson_quantile(4e7, FALLBACK_CONFIDENCE), Some(at)); + let beyond = FALLBACK_CONFIDENCE.next_up(); + assert_eq!(poisson_quantile(4e7, beyond), None); + assert_eq!(poisson_quantile(4e7, 1.0f64.next_down()), None); + assert_eq!( + Stats::declared(u64::MAX) + .with_confidence(beyond) + .limit(10, Some(0.5)), + Limit::Unbounded + ); + assert_eq!( + Stats::declared(u64::MAX) + .with_confidence(FALLBACK_CONFIDENCE) + .limit(10, Some(0.5)), + Limit::Rows(MAX_ROWS) + ); + } + + #[test] + fn a_confidence_at_one_still_ends() { + // A float CDF may never reach 1; the window's end ends the sum. + let q = poisson_quantile(5.0, 1.0).unwrap(); + // The window starts at 0 and is `⌈22√5 + 50⌉` wide. + assert!((20..=100).contains(&q), "{q}"); + assert_eq!(poisson_quantile(f64::NAN, 0.99), Some(0)); + // A confidence above 1 allows no mass at all: the window's end. + assert_eq!(poisson_quantile(5.0, 1.5), Some(100)); + assert_eq!(poisson_quantile(7600.0, 1.5), Some(6728 + 1968)); + } + + /// High confidences over a large `λ`, where summing from `e^(−λ)` + /// loses precision: the window is normalised instead. References are + /// exact (mpmath's regularised incomplete gamma); the sum may land one + /// above, never below. + #[test] + fn the_quantile_holds_at_high_confidence_and_large_lambda() { + for (lambda, confidence, exact) in [ + (3.4e6, 0.9999, 3_406_860), + (4_750_922.0, 1.0 - 1e-12, 4_766_263), + (1e7, 0.99, 10_007_357), + ] { + let q = poisson_quantile(lambda, confidence).unwrap(); + assert!( + q == exact || q == exact + 1, + "λ = {lambda}, confidence = {confidence}: {q}, exact {exact}" + ); + } + } + + /// ADR-0009 decision 5's worked table: EQL v4 defaults (`k = 6`, + /// `m = 2048`), a million rows, 99%. + #[test] + fn the_declared_prior_reproduces_the_worked_table() { + let stats = Stats::declared(1_000_000); + for (tokens, bits, want_extra) in [(20, 6, 1), (200, 6, 7805), (200, 18, 3)] { + let fill = expected_fill(tokens, 6, 2048); + let p = stats.pass_rate(bits, 2048, Some(fill)); + assert_eq!( + stats.limit(10, p), + Limit::Rows(10 + want_extra), + "{tokens} stored tokens, {bits} query bits" + ); + } + } + + /// The mixed-length column of decision 5: half the rows hold 20 tokens, + /// half 200. The mean of `f^b` is what the bound needs; the mean fill + /// raised to `b` would promise a fetch about fifteen times too small. + #[test] + fn a_measured_histogram_uses_the_mean_of_the_power_not_the_power_of_the_mean() { + let short = (expected_fill(20, 6, 2048) * 2048.0).round() as u32; + let long = (expected_fill(200, 6, 2048) * 2048.0).round() as u32; + let stats = Stats::measured(1_000_000, [(short, 500_000), (long, 500_000)]); + let p = stats.pass_rate(6, 2048, None).unwrap(); + let lambda = p * 1e6; + assert!((3700.0..3900.0).contains(&lambda), "λ = {lambda}"); + + let mean_fill = (f64::from(short) + f64::from(long)) / 2.0 / 2048.0; + assert!(mean_fill.powi(6) * 1e6 < 300.0); + let Limit::Rows(rows) = stats.limit(10, Some(p)) else { + panic!("a measured column has a finite fetch"); + }; + assert!(rows > 3800, "{rows}"); + } + + #[test] + fn nothing_known_is_unbounded() { + let stats = Stats::declared(1_000_000); + assert_eq!( + stats.limit(10, stats.pass_rate(6, 2048, None)), + Limit::Unbounded + ); + + let empty = Stats::measured(1_000_000, []); + assert_eq!(empty.pass_rate(6, 2048, None), None); + assert_eq!( + empty.pass_rate(6, 2048, Some(0.5)), + Some(0.5f64.powi(6)), + "an empty histogram falls back to the prior" + ); + } + + #[test] + fn a_confidence_outside_the_open_interval_is_unbounded() { + for confidence in [0.0, 1.0, -0.5, 1.5, f64::NAN] { + let stats = Stats::declared(1000).with_confidence(confidence); + assert_eq!( + stats.limit(10, Some(0.01)), + Limit::Unbounded, + "{confidence}" + ); + } + let stats = Stats::declared(1000).with_confidence(0.5); + assert_eq!(stats.confidence(), 0.5); + assert_eq!(stats.rows(), 1000); + assert_eq!(stats.limit(10, Some(0.01)), Limit::Rows(10 + 10)); + } + + #[test] + fn a_count_above_the_filter_size_is_a_full_filter() { + let stats = Stats::measured(100, [(5000, 1)]); + assert_eq!(stats.pass_rate(6, 2048, None), Some(1.0)); + // Every row passes: λ = 100, whose 99% quantile is 124. + assert_eq!(stats.limit(1, Some(1.0)), Limit::Rows(1 + 124)); + } + + #[test] + fn a_limit_reads_back_as_rows_or_a_page() { + assert_eq!(Limit::Rows(12).rows(), Some(12)); + assert_eq!(Limit::Rows(12).fetch_or(50), 12); + assert_eq!(Limit::Unbounded.rows(), None); + assert_eq!(Limit::Unbounded.fetch_or(50), 50); + assert_eq!(Limit::Unbounded.fetch_or(MAX_ROWS), MAX_ROWS); + assert_eq!( + Limit::Unbounded.fetch_or(u64::MAX), + MAX_ROWS, + "a page is cut to a SQL LIMIT" + ); + } + + /// Wanting no rows is a fetch of none, even over a table whose every + /// row passes and whose filters nothing is known about. + #[test] + fn wanting_no_rows_fetches_none() { + let stats = Stats::declared(1_000_000); + assert_eq!(stats.limit(0, Some(1.0)), Limit::Rows(0)); + assert_eq!(stats.limit(0, None), Limit::Rows(0)); + assert_eq!(stats.limit(1, Some(1.0)).rows().map(|r| r > 1), Some(true)); + } + + #[test] + fn a_limit_fits_a_sql_limit() { + assert_eq!( + Stats::declared(10).limit(u64::MAX, Some(0.5)), + Limit::Rows(MAX_ROWS) + ); + // The largest count there is: what `reltuples` −1 becomes if a + // caller casts it to a `u64`, rather than treating it as unknown as + // `Stats::declared` says. Still a valid `LIMIT`. + assert_eq!( + Stats::declared(u64::MAX).limit(10, Some(0.5)), + Limit::Rows(MAX_ROWS) + ); + } + + #[test] + fn histogram_counts_do_not_overflow() { + let stats = Stats::measured(10, [(1024, u64::MAX), (2048, u64::MAX)]); + let p = stats.pass_rate(1, 2048, None).unwrap(); + assert!((p - 0.75).abs() < 1e-12, "{p}"); + } +} diff --git a/packages/stack-encrypt/src/plan/build.rs b/packages/stack-encrypt/src/plan/build.rs index d8537f64a..3cbf85ca1 100644 --- a/packages/stack-encrypt/src/plan/build.rs +++ b/packages/stack-encrypt/src/plan/build.rs @@ -244,7 +244,7 @@ pub(crate) fn check_declared( /// # struct User { email: String, id: u64 } /// # async fn example() -> Result<(), stack_encrypt::Error> { /// use stack_encrypt::kms::FakeDataKeySource; -/// use stack_encrypt::{Equality, Plan, StackCipher}; +/// use stack_encrypt::{op, Equality, Plan, StackCipher}; /// /// let cipher = StackCipher::builder().kms(FakeDataKeySource::new()).init().await?; /// let user = User { email: "bob@example.com".into(), id: 42 }; @@ -259,10 +259,9 @@ pub(crate) fn check_declared( /// // A query and a read name the same context. /// let email_plan = users_plan.field("email")?; /// let query_value = cipher -/// .query("bob@example.com") +/// .query(op::Eq, "bob@example.com") /// .context("tenants/acme/users") -/// .using(&email_plan) -/// .equality() +/// .on(&email_plan) /// .await?; /// # let _ = query_value; /// let back = cipher.open(record).context("tenants/acme/users").using(&users_plan).await?; @@ -604,7 +603,7 @@ fn stored(field: &str, slot: Slot) -> Result { /// Open a sealed field's ciphertext as an `F`. fn open_sealed(ciphertext: StackCipherText, context: CallerContext) -> Decryption where - F: crate::Decrypt<'static> + Send + 'static, + F: crate::Decrypt + Send + 'static, K: 'static, { open::(ciphertext, AeadContext::from(context)).map(Slot::new) @@ -728,7 +727,7 @@ impl FieldsBuilder { /// `/`. Lowers to [`ciphertext`]`().under(label)`. pub fn encrypt(self, field: impl FieldRef) -> Self where - F: crate::Encrypt + crate::Decrypt<'static> + Clone + Send + 'static, + F: crate::Encrypt + crate::Decrypt + Clone + Send + 'static, { let (name, access) = resolve(field); let read = Arc::clone(&access.read); @@ -765,14 +764,14 @@ impl FieldsBuilder { indexes: impl Indexes + Clone + Send + Sync + 'static, ) -> Self where - F: crate::Encrypt + crate::Decrypt<'static> + Clone + Send + 'static, + F: crate::Encrypt + crate::Decrypt + Clone + Send + 'static, { self.encrypt_index_of(field, indexes) } fn encrypt_index_of(self, field: impl FieldRef, indexes: X) -> Self where - F: crate::Encrypt + crate::Decrypt<'static> + Clone + Send + 'static, + F: crate::Encrypt + crate::Decrypt + Clone + Send + 'static, X: Indexes + Clone + Send + Sync + 'static, X::Terms: Send, { @@ -915,7 +914,7 @@ impl FieldsBuilder { /// # async fn example() -> Result<(), stack_encrypt::Error> { /// use stack_encrypt::kms::FakeDataKeySource; /// use stack_encrypt::sem::{EqualityTerm, MatchTerms}; - /// use stack_encrypt::{Encrypted, Plan, StackCipher}; + /// use stack_encrypt::{op, Encrypted, Plan, StackCipher}; /// /// let cipher = StackCipher::builder().kms(FakeDataKeySource::new()).init().await?; /// let users_plan = Plan::context("users") @@ -928,7 +927,7 @@ impl FieldsBuilder { /// let email: Encrypted<(EqualityTerm, MatchTerms)> = record.take("email")?; /// /// // The target declares an equality index, so the field answers it. - /// let query_value = cipher.query("bob@example.com").using(&users_plan.field("email")?).equality().await?; + /// let query_value = cipher.query(op::Eq, "bob@example.com").on(&users_plan.field("email")?).await?; /// assert_eq!(query_value, email.terms.0); /// # Ok(()) /// # } diff --git a/packages/stack-encrypt/src/plan/chain.rs b/packages/stack-encrypt/src/plan/chain.rs index abe9b4622..a6842d175 100644 --- a/packages/stack-encrypt/src/plan/chain.rs +++ b/packages/stack-encrypt/src/plan/chain.rs @@ -11,9 +11,10 @@ use super::build::{FieldPlan, FieldsBuilder, IntoLabel, Opens, PlanContext, Runs use super::field_ref::FieldRef; use super::value::{Indexed, Typed, ValuePlan, ValueShape}; use super::PlanError; +use crate::op::{Answers, DefaultIndex, Input, Operator, QueryToken, Supports}; use crate::target::{ ciphertext, Borrowed, CallerContext, DeclaredContext, DecryptField, Decryptable, EncryptFrom, - Equality, Index, Indexes, Owned, Pending, PendingFuture, Select, + Index, Indexes, Pending, PendingFuture, Select, Whole, }; use crate::{Error, KeysetCipher, Label, LabelError, NonEmpty, StackCipher, StackCipherText}; @@ -278,19 +279,28 @@ impl StackCipher { } } - /// Start a chain that derives a query term for `value`, to match terms - /// a plan wrote. Name the plan with [`using`](QueryBuilder::using) and - /// the index with `equality()` or `index(..)`. + /// Start a chain that derives the query term for the operator `op` over + /// `value`, to match terms a plan wrote. Name the plan with + /// [`on`](QueryBuilder::on): `cipher.query(op::Eq, "bob@example.com").on(&plan)`. + /// The plan chooses the index that answers the operator there; an + /// index the plan declares beside that one is named first, with + /// [`via`](QueryBuilder::via). /// - /// The value is copied once (`to_owned`), so `query("bob@example.com")` + /// The value is what the operator takes ([`Input`]): one plaintext, or + /// for `op::Between` a pair of them, `cipher.query(op::Between, &(18, 65))`. + /// It is copied once (`to_owned`), so `query(op::Eq, "bob@example.com")` /// queries a `String` field. - pub fn query<'a, Q>(&'a self, value: &Q) -> QueryBuilder<'a, Q::Owned, K> + pub fn query<'a, Op, Q>(&'a self, op: Op, value: &Q) -> QueryBuilder<'a, Op, F, K> where + Op: Operator, Q: ToOwned + ?Sized, + F: Input, { + let _: Op = op; QueryBuilder { common: Common::new(self), value: value.to_owned(), + op: PhantomData, } } @@ -473,7 +483,7 @@ impl<'a, S: 'static, K: 'static> EncryptFields<'a, S, K> { /// [`FieldsBuilder::encrypt`]. pub fn encrypt(mut self, field: impl FieldRef) -> Self where - F: crate::Encrypt + crate::Decrypt<'static> + Clone + Send + 'static, + F: crate::Encrypt + crate::Decrypt + Clone + Send + 'static, { self.plan = self.plan.encrypt::(field); self @@ -485,7 +495,7 @@ impl<'a, S: 'static, K: 'static> EncryptFields<'a, S, K> { indexes: impl Indexes + Clone + Send + Sync + 'static, ) -> Self where - F: crate::Encrypt + crate::Decrypt<'static> + Clone + Send + 'static, + F: crate::Encrypt + crate::Decrypt + Clone + Send + 'static, { self.plan = self.plan.encrypt_index::(field, indexes); self @@ -588,13 +598,18 @@ where } } -/// A chain deriving a query term, before its plan is named. -pub struct QueryBuilder<'a, F, K> { +/// The owned form of a queried value: `String` for a `str` query. +type F = ::Owned; + +/// A chain deriving the query term for an operator, before its plan is +/// named. +pub struct QueryBuilder<'a, Op, F, K> { common: Common<'a, K>, value: F, + op: PhantomData Op>, } -impl<'a, F, K: 'static> QueryBuilder<'a, F, K> { +impl<'a, Op: Operator, F: Input, K: 'static> QueryBuilder<'a, Op, F, K> { /// Name the context the term is derived under, for a plan built /// without one: the context the write's call named, or for a plan with /// a context field, the value that field held. A plan built with its @@ -604,127 +619,221 @@ impl<'a, F, K: 'static> QueryBuilder<'a, F, K> { self } - /// Query through `plan`: a field of a fields plan - /// ([`Plan::field`](super::Plan::field)), or a one-value plan ([`ValuePlan`]). The term is - /// derived under exactly the label the write used. - pub fn using

(self, plan: &'a P) -> QueryUsing<'a, F, P, K> { - QueryUsing { + /// Answer the operator through `index` rather than the index the plan + /// chooses for it ([`Chooses`]): a match index with its own + /// configuration, an OPE index where ORE is the default, or an index + /// of a target type that has no [`Answers`] impl for the operator. The + /// plan named next must declare it, as [`on`](Self::on) says. + pub fn via>(self, index: I) -> QueryVia<'a, Op, F, I, K> { + QueryVia { common: self.common, value: self.value, - plan, + op: self.op, + index, } } + + /// Query on `plan`: a field of a fields plan + /// ([`Plan::field`](super::Plan::field)), or a one-value plan + /// ([`ValuePlan`]). The plan chooses the index that answers the + /// operator ([`Chooses`]), and the term is derived under exactly the + /// label the write used. + /// + /// What the plan's type can see is checked here: an operator it does + /// not answer, a value that is not what the operator takes over the + /// plan's plaintext, or a one-value plan without the index, does not + /// compile. A field of a fields plan is data, so there an index the + /// field does not declare, or declares with other options, is refused + /// when the query is awaited ([`PlanError::IndexNotDeclared`], + /// [`PlanError::IndexOptions`]), before any key is requested. + pub fn on(self, plan: &P) -> QueryOp<'a, F, Op, P::Via, K> + where + P: Chooses, + { + self.via(P::Via::default()).on(plan) + } } -/// A chain deriving a query term through a plan, before its index is -/// chosen. -pub struct QueryUsing<'a, F, P, K> { +/// A chain deriving the query term for an operator through a named index, +/// before its plan is named. +pub struct QueryVia<'a, Op, F, I, K> { common: Common<'a, K>, value: F, - plan: &'a P, + op: PhantomData Op>, + index: I, } -impl<'a, F: 'static, K: 'static> QueryUsing<'a, F, FieldPlan, K> { - /// The equality term: sugar for `index(Equality)`. - pub fn equality(self) -> QueryIndex<'a, F, Equality, K> - where - Equality: Index, - { - self.index(Equality) +impl<'a, Op, F, I, K: 'static> QueryVia<'a, Op, F, I, K> +where + Op: Operator, + F: Input, + I: Supports, +{ + /// Name the context the term is derived under, as + /// [`QueryBuilder::context`], before or after the index. + pub fn context(mut self, context: impl IntoLabel) -> Self { + self.common.context = Some(context.into_label()); + self } - /// The term of `index`. The field must have declared it, and the query's - /// plaintext must be the field's type; otherwise awaiting is - /// [`PlanError::IndexNotDeclared`] or [`PlanError::FieldType`], never a - /// term that matches nothing. - pub fn index>(mut self, index: I) -> QueryIndex<'a, F, I, K> { - let label = self - .common - .call_context() - .and_then(|call| self.plan.query_label::(&index.spec(), call)); - QueryIndex { - common: self.common, - value: self.value, + /// Query on `plan` through the named index, which the plan must + /// declare ([`Resolves`]): a one-value plan without it does not + /// compile; a field of a fields plan without it is refused when the + /// query is awaited. A one-value plan built `with` indexes uses its + /// own index of that type, so the named index says only which. + pub fn on(self, plan: &P) -> QueryOp<'a, F, Op, I, K> + where + P: Resolves, + { + let QueryVia { + mut common, + value, + op, + index, + } = self; + let (index, label) = match common.call_context() { + Ok(call) => plan.resolve(index, call), + Err(error) => (index, Err(error)), + }; + QueryOp { + common, + value, index, label, + op, } } } -impl<'a, F: 'static, X: Indexes, K: 'static> QueryUsing<'a, F, ValuePlan>, K> { - /// The equality term, selected from the plan's indexes by type: a plan - /// with no `Equality` index does not compile here. - pub fn equality(self) -> QueryIndex<'a, F, Equality, K> - where - Equality: Index, - X: Select, - { - self.index::() - } +/// A plan a query for the operator `Op`, given `In`, runs on, and the +/// index it answers the operator with. Sealed: the three plan shapes +/// implement it. +/// +/// A field of a fields plan and a one-value plan built `with` indexes +/// answer through the operator's [`DefaultIndex`]; a one-value plan for a +/// target type answers through the type's [`Answers`] impl. The plan's +/// plaintext is the input's ([`Input::Plaintext`]): `S` for a query given +/// an `S`, and for a `Between` given an `(S, S)`. `At` is the position of +/// that index in a plan built `with` several, and is inferred. +#[diagnostic::on_unimplemented( + message = "`{Self}` does not answer `{Op}` given `{In}`", + label = "no index answers this operator on this plan", + note = "a field of a fields plan or a plan built `with` indexes answers an operator through its default index (`op::Eq`: `Equality`; `op::Matches`: `Match` with the default configuration, case-insensitive and over text only; `op::Lt`, `Lte`, `Gt`, `Gte` and `Between`: `Ore` over an integer, `Between` given a pair); a typed plan answers the operators its target type implements `Answers` for; `.via(index)` names an index the plan declares" +)] +pub trait Chooses, At>: + Resolves +{ + /// The index that answers `Op` on this plan. + type Via: Supports + Default; +} - /// The term of the plan's index of type `I`, selected by type - /// ([`Indexes::select`]); `At` is inferred: `.index::()`. - pub fn index(mut self) -> QueryIndex<'a, F, I, K> - where - I: Index + Clone, - X: Select, - { - let index = self.plan.indexes().select::().clone(); - let label = self - .common - .call_context() - .and_then(|call| self.plan.resolve(call)); - QueryIndex { - common: self.common, - value: self.value, - index, - label, - } +impl, In: Input> Chooses for FieldPlan { + type Via = Op::Via; +} + +impl Chooses for ValuePlan> +where + Op: DefaultIndex, + Op::Via: Clone, + In: Input, + S: 'static, + X: Indexes + Select, +{ + type Via = Op::Via; +} + +impl Chooses for ValuePlan> +where + Op: Operator, + In: Input, + S: 'static, + T: Answers, + T::Via: Default, + Typed: ValueShape, +{ + type Via = T::Via; +} + +mod plan_sealed { + use super::{FieldPlan, Indexed, Typed, ValuePlan}; + pub trait Sealed {} + impl Sealed for FieldPlan {} + impl Sealed for ValuePlan> {} + impl Sealed for ValuePlan> {} +} + +/// A plan the index `I` over the plaintext `S` can be queried on. Sealed: +/// the three plan shapes implement it, and each finds the label the write +/// used. +/// +/// A field of a fields plan ([`Plan::field`](super::Plan::field)) and a +/// one-value plan for a target type take the index as given, and refuse +/// one the plan does not declare when the query is awaited +/// ([`PlanError::IndexNotDeclared`]). A one-value plan built `with` +/// indexes selects its own index of that type ([`Indexes::select`]), at +/// the position `At`, which is inferred; a plan without that index does +/// not compile. +#[diagnostic::on_unimplemented( + message = "`{Self}` cannot be queried through `{I}` over `{S}`", + label = "this plan does not declare the index, or is not a plan a query runs on", + note = "query on a field of a fields plan (`plan.field(..)`) or on a one-value plan; a plan built `with` indexes must hold one of this type" +)] +pub trait Resolves: plan_sealed::Sealed { + /// The index the query runs through on this plan, and the label the + /// write used, or why the plan refuses the query. `call` is the context + /// the call named, if any. + fn resolve(&self, index: I, call: Option

for Encrypted { +impl DecryptInto

for Encrypted { type Context = AeadContext; fn decryption(self, context: Self::Context) -> Decryption { open(self.ciphertext, context) @@ -542,7 +551,7 @@ pub trait TermSet: Sized + 'static { /// Those indexes, as a value. const INDEXES: Self::Indexes; } -impl TermSet for EqualityTerm { +impl TermSet for EqualityTerm { type Indexes = Equality; const INDEXES: Equality = Equality; } @@ -552,16 +561,14 @@ impl, O: MatchConfig + 'static> TermSet for MatchTerms { } impl TermSet for OreTerm where - S: cllw_ore::CllwOreEncrypt + Send + 'static, - S::Output: Send + 'static, + S: crate::sem::Orderable, { type Indexes = Ore; const INDEXES: Ore = Ore; } impl TermSet for OpeTerm where - S: cllw_ore::CllwOpeEncrypt + Send + 'static, - S::Output: Send + 'static, + S: crate::sem::Orderable, { type Indexes = Ope; const INDEXES: Ope = Ope; diff --git a/packages/stack-encrypt/src/target/mod.rs b/packages/stack-encrypt/src/target/mod.rs index 565e370d1..349cc34ce 100644 --- a/packages/stack-encrypt/src/target/mod.rs +++ b/packages/stack-encrypt/src/target/mod.rs @@ -95,7 +95,7 @@ mod source; pub mod transcode; mod tuples; -pub(crate) use self::core::{decipher_pending, seal_pending}; +pub(crate) use self::core::{bind_pending, seal_pending}; pub use context::{AeadContext, CallerContext, DeclaredContext, ExpectedContext, Extends}; pub use index::{ indexed, At, Encrypted, Equality, Index, IndexSpec, Indexes, Match, Ope, Ore, Select, TermSet, diff --git a/packages/stack-encrypt/src/target/operations.rs b/packages/stack-encrypt/src/target/operations.rs index ce772f9a9..cbe026b1e 100644 --- a/packages/stack-encrypt/src/target/operations.rs +++ b/packages/stack-encrypt/src/target/operations.rs @@ -535,8 +535,9 @@ macro_rules! term_operation { } term_operation!( /// The equality term of `S` under the context the tree hands it. Requires - /// only `S`'s PRF contract, not recoverable encryption. - equality, crate::sem::EqualityTerm, consume, [], [S: vitaminc_prf::PrfValue] + /// only that `S` describes itself (`Encrypt`), as one scalar with an + /// equality domain; not recoverable encryption. + equality, crate::sem::EqualityTerm, consume, [], [S: crate::Encrypt] ); term_operation!( /// The match term of any text `S` under the context the tree hands it, @@ -545,16 +546,15 @@ term_operation!( ); term_operation!( /// The order-revealing term of `S` under the context the tree hands it. - /// The bounds are the leaf's own: they say which `S` the CLLW ORE scheme - /// can order. + /// The bound is the leaf's own: it says which `S` has an order target. ore, crate::sem::OreTerm, consume, [], - [S: cllw_ore::CllwOreEncrypt + Send + 'static, S::Output: Send + 'static] + [S: crate::sem::Orderable] ); term_operation!( /// The order-preserving term of `S` under the context the tree hands it, /// with the same bounds as [`ore`]. ope, crate::sem::OpeTerm, consume, [], - [S: cllw_ore::CllwOpeEncrypt + Send + 'static, S::Output: Send + 'static] + [S: crate::sem::Orderable] ); impl Decryption { @@ -647,7 +647,7 @@ impl Decryption { } /// The canonical opening operation: retrieve the tree's keys and decode `P` /// through its own Vitamin C `Decrypt` implementation, under `context`. -pub fn open + 'static, K: 'static>( +pub fn open( tree: StackCipherText, context: impl Into, ) -> Decryption { @@ -887,13 +887,13 @@ impl EncryptFrom for StackCipherText { ciphertext() } } -impl + 'static> DecryptInto

for StackCipherText { +impl DecryptInto

for StackCipherText { type Context = AeadContext; fn decryption(self, context: Self::Context) -> Decryption { open(self, context) } } -impl EncryptFrom for crate::sem::EqualityTerm { +impl EncryptFrom for crate::sem::EqualityTerm { type Context = CallerContext; fn encryption<'s, K: 'static>() -> Encryption<'s, S, Self, K, Self::Context> where @@ -921,8 +921,7 @@ impl, O: crate::sem::MatchConfig + 'static> EncryptFrom } impl EncryptFrom for crate::sem::OreTerm where - S: cllw_ore::CllwOreEncrypt + Clone + Send + 'static, - S::Output: Send + 'static, + S: crate::sem::Orderable + Clone, { type Context = CallerContext; fn encryption<'s, K: 'static>() -> Encryption<'s, S, Self, K, Self::Context> @@ -937,8 +936,7 @@ where } impl EncryptFrom for crate::sem::OpeTerm where - S: cllw_ore::CllwOpeEncrypt + Clone + Send + 'static, - S::Output: Send + 'static, + S: crate::sem::Orderable + Clone, { type Context = CallerContext; fn encryption<'s, K: 'static>() -> Encryption<'s, S, Self, K, Self::Context> diff --git a/packages/stack-encrypt/src/target/source.rs b/packages/stack-encrypt/src/target/source.rs index 30c11d92d..09318e1ff 100644 --- a/packages/stack-encrypt/src/target/source.rs +++ b/packages/stack-encrypt/src/target/source.rs @@ -29,7 +29,7 @@ mod sealed { /// How a description receives its plaintext: the `M` parameter of /// [`Encryption`](super::Encryption). /// -/// Vitamin C's `Encrypt`, `PrfValue` and `CllwOreEncrypt` consume the value +/// Vitamin C's `Encrypt` and `PrfValue`, and the order terms, consume the value /// they are given, so an operation needs the plaintext by value. A /// description can be handed it two ways, and because the mode is a type /// parameter the difference is settled at compile time: diff --git a/packages/stack-encrypt/src/target/transcode.rs b/packages/stack-encrypt/src/target/transcode.rs index c99071d09..64552fe40 100644 --- a/packages/stack-encrypt/src/target/transcode.rs +++ b/packages/stack-encrypt/src/target/transcode.rs @@ -10,7 +10,7 @@ //! leaf or marker is authenticated ciphertext, but passthrough metadata and //! terms are not, and a visitor must not present them as such. use crate::sem::{EqualityTerm, MatchConfig, MatchTerms, OpeTerm, OreTerm}; -use crate::{BoxedPassthrough, CipherText, Error, SealedValue, StackCipherText}; +use crate::{CipherText, Error, PassthroughFrame, SealedValue, StackCipherText}; /// An encrypted output that can drive a destination visitor. /// @@ -36,7 +36,9 @@ pub trait Reader: Sized { pub trait Visitor: Sized { /// The destination this visitor builds. type Value; - /// One sealed leaf: a scalar's ciphertext. + /// One sealed leaf: a scalar's ciphertext. An absent optional is one + /// too, a sealed null, so opening it under the wrong context fails + /// like any leaf. /// /// # Errors /// @@ -60,15 +62,6 @@ pub trait Visitor: Sized { fn map(self, _: R) -> Result { Err(Error::UnsupportedShape) } - /// The sealed marker of an absent optional. It is ciphertext, not a - /// null: opening it under the wrong context fails like any leaf. - /// - /// # Errors - /// - /// Refuses with [`Error::UnsupportedShape`] unless overridden. - fn absent(self, _: SealedValue) -> Result { - Err(Error::UnsupportedShape) - } /// The sealed marker of an empty sequence. /// /// # Errors @@ -86,12 +79,13 @@ pub trait Visitor: Sized { Err(Error::UnsupportedShape) } /// Passthrough metadata the plaintext carried alongside its encrypted - /// fields. Not authenticated: the reader hands it over as it was given. + /// fields, as the frame of its subtree. Not authenticated: the reader + /// hands it over as it was given. /// /// # Errors /// /// Refuses with [`Error::UnsupportedShape`] unless overridden. - fn passthrough(self, _: BoxedPassthrough) -> Result { + fn passthrough(self, _: PassthroughFrame) -> Result { Err(Error::UnsupportedShape) } /// An equality term. One-way, and not authenticated. @@ -115,7 +109,7 @@ pub trait Visitor: Sized { /// # Errors /// /// Refuses with [`Error::UnsupportedShape`] unless overridden. - fn ore(self, _: OreTerm) -> Result { + fn ore(self, _: OreTerm) -> Result { Err(Error::UnsupportedShape) } /// An order-preserving term. One-way, and not authenticated. @@ -123,7 +117,7 @@ pub trait Visitor: Sized { /// # Errors /// /// Refuses with [`Error::UnsupportedShape`] unless overridden. - fn ope(self, _: OpeTerm) -> Result { + fn ope(self, _: OpeTerm) -> Result { Err(Error::UnsupportedShape) } } @@ -183,7 +177,6 @@ impl Reader for StackCipherText { CipherText::Single(leaf) => visitor.sealed(leaf), CipherText::Sequence(items) => visitor.sequence(items.into_iter()), CipherText::Map(entries) => visitor.map(entries.into_iter()), - CipherText::None(marker) => visitor.absent(marker), CipherText::EmptySequence(marker) => visitor.empty_sequence(marker), CipherText::EmptyMap(marker) => visitor.empty_map(marker), CipherText::Passthrough(value) => visitor.passthrough(value), @@ -200,12 +193,12 @@ impl Reader for MatchTerms { visitor.matching(self) } } -impl Reader for OreTerm { +impl Reader for OreTerm { fn read(self, visitor: V) -> Result { visitor.ore(self) } } -impl Reader for OpeTerm { +impl Reader for OpeTerm { fn read(self, visitor: V) -> Result { visitor.ope(self) } diff --git a/packages/stack-encrypt/tests/common/mod.rs b/packages/stack-encrypt/tests/common/mod.rs index 8f0af0ea9..f2454edd1 100644 --- a/packages/stack-encrypt/tests/common/mod.rs +++ b/packages/stack-encrypt/tests/common/mod.rs @@ -233,3 +233,58 @@ pub async fn deterministic_cipher(seed: [u8; 32]) -> StackCipher(value: P) -> stack_encrypt::PassthroughFrame { + use vitaminc_protected::Controlled; + stack_encrypt::PassthroughFrame( + vitaminc_aead::to_frame(value) + .expect("a passthrough value frames") + .risky_unwrap(), + ) +} + +/// The `u32` a passthrough payload carries. +pub fn passthrough_u32(payload: &stack_encrypt::PassthroughFrame) -> u32 { + use vitaminc_aead::Decrypt; + let frame = payload.parse().expect("one frame"); + vitaminc_aead::Encrypt::visit(frame, u32::sink()).expect("a u32") +} + +/// Values as a binding sends them: Rust values written as frames, and an +/// object of them in the order a test writes it. +#[cfg(feature = "dynamic")] +pub mod frames { + use stack_encrypt::dynamic::ValueFrame; + use stack_encrypt::Encrypt; + use vitaminc_aead::plaintext::{visit_map, Sink}; + use vitaminc_protected::Controlled; + + /// A Rust value as its frame. + pub fn frame(value: T) -> ValueFrame { + ValueFrame::of(value).expect("a value in the model") + } + + /// An object of `entries`, in order. + pub fn object>(entries: Vec<(K, ValueFrame)>) -> ValueFrame { + frame(Object(entries)) + } + + /// A value as a passthrough node's payload: its frame, in the clear. + pub fn payload(value: T) -> Vec { + frame(value).into_inner().risky_unwrap() + } + + struct Object(Vec<(K, ValueFrame)>); + + impl> Encrypt for Object { + fn visit(self, sink: S) -> Result { + let len = Some(self.0.len()); + visit_map( + sink, + len, + self.0.iter().map(|(key, value)| (key.as_ref(), value)), + ) + } + } +} diff --git a/packages/stack-encrypt/tests/derive.rs b/packages/stack-encrypt/tests/derive.rs index d5b87a823..37fcd0e01 100644 --- a/packages/stack-encrypt/tests/derive.rs +++ b/packages/stack-encrypt/tests/derive.rs @@ -8,9 +8,9 @@ mod common; use std::sync::atomic::Ordering as AtomicOrdering; -use cllw_ore::CllwOreEncrypt; use common::{counting_cipher, recording_cipher, stack_cipher}; -use stack_encrypt::sem::{EqualityTerm, MatchTerms, OreTerm}; +use stack_encrypt::sem::Orderable; +use stack_encrypt::sem::{EqualityTerm, MatchConfig, MatchOptions, MatchTerms, OreTerm, TermError}; use stack_encrypt::target::{AeadContext, DecryptFrom, EncryptInto, Encrypted}; use stack_encrypt::{ nonempty, ContextPiece, DecryptField, DecryptInto, Decryptable, EncryptFrom, Error, @@ -105,7 +105,7 @@ struct BorrowedSource<'__source, '__source_> { /// by its source. A generic record's one-ciphertext check runs when the /// record is first used rather than where it is defined. #[derive(EncryptFrom, DecryptInto)] -struct Tagged { +struct Tagged { c: StackCipherText, ob: OreTerm, } @@ -436,20 +436,50 @@ async fn a_ciphertext_only_record_accepts_an_aead_only_context_like_the_leaf_doe assert!(matches!(result, Err(Error::Aead)), "{result:?}"); } +/// A match configuration whose options fail the scheme's bounds, so its +/// leaf fails during the synchronous build. +struct TooManyHashes; +impl MatchConfig for TooManyHashes { + fn options() -> MatchOptions { + MatchOptions { + k: 17, + ..Default::default() + } + } +} + +#[derive(EncryptFrom, DecryptInto)] +struct BadlyIndexedText { + c: StackCipherText, + m: MatchTerms, +} + #[tokio::test] async fn a_failed_field_fails_the_derived_record_before_any_io() { let (cipher, generates, _) = counting_cipher().await; let keyset = cipher.default_keyset(); - // Text that yields no match tokens fails that leaf during the - // synchronous build; the derived record is the zip of its fields, so it - // fails the same way and never mints the data key its ciphertext field - // would have wanted. - let result: Result = String::new() + // Invalid match options fail that leaf during the synchronous build; + // the derived record is the zip of its fields, so it fails the same way + // and never mints the data key its ciphertext field would have wanted. + let result: Result = "alice" + .to_string() .encrypt_into_with_context(&keyset, nonempty!("users/name")) .await; - assert!(matches!(result, Err(Error::Term(_)))); + assert!(matches!( + result, + Err(Error::Term(TermError::InvalidOptions(_))) + )); assert_eq!(generates.load(AtomicOrdering::SeqCst), 0); + + // Text with no match tokens is not a failure: the leaf is the empty + // filter, and the record seals as any other. + let stored: SearchableText = String::new() + .encrypt_into_with_context(&keyset, nonempty!("users/name")) + .await + .unwrap(); + assert!(stored.m.positions().is_empty()); + assert_eq!(generates.load(AtomicOrdering::SeqCst), 1); } // --- Structs: each field from one field of the plaintext, under its own context diff --git a/packages/stack-encrypt/tests/derive_plan.rs b/packages/stack-encrypt/tests/derive_plan.rs index 408543f82..26ae77162 100644 --- a/packages/stack-encrypt/tests/derive_plan.rs +++ b/packages/stack-encrypt/tests/derive_plan.rs @@ -11,6 +11,7 @@ use std::sync::atomic::Ordering as AtomicOrdering; use common::{counting_cipher, recording_cipher, stack_cipher}; use stack_encrypt::kms::FakeDataKeySource; +use stack_encrypt::op; use stack_encrypt::plan::{pick, FieldValues}; use stack_encrypt::sem::{EqualityTerm, MatchTerms, OpeTerm, OreTerm}; use stack_encrypt::target::{ @@ -129,9 +130,8 @@ async fn a_derived_record_as_a_typed_field_answers_its_queries() { let mut record = cipher.encrypt(&user).using(&users_plan).await.unwrap(); let email: Email = record.take("email").unwrap(); let query_value = cipher - .query("bob@example.com") - .using(&users_plan.field("email").unwrap()) - .equality() + .query(op::Eq, "bob@example.com") + .on(&users_plan.field("email").unwrap()) .await .unwrap(); assert_eq!(query_value, email.hm); diff --git a/packages/stack-encrypt/tests/fixtures/README.md b/packages/stack-encrypt/tests/fixtures/README.md index 13c8fa4c4..6fb6ac18c 100644 --- a/packages/stack-encrypt/tests/fixtures/README.md +++ b/packages/stack-encrypt/tests/fixtures/README.md @@ -2,7 +2,7 @@ One declaration, two authors, one engine. A Rust chain (`cipher.encrypt(&user).context("users").fields()…`, over fields of type -`stack_encrypt::dynamic::Value`, the plaintext type a binding's values have) +`stack_encrypt::dynamic::ValueFrame`, the frame a binding's values arrive as) and the data-plan lowering (`stack_encrypt::dynamic::record`, what a language binding calls) each sealed the same plaintext under the same declaration. The fixture holds both records, with their term bytes, sealed @@ -11,10 +11,9 @@ same seed. `tests/record_lowering.rs` opens each record with the other author and checks that both derive the terms it holds. That cross-opening is the proof that `dynamic::record` is a lowering into the plan builder and not a second executor (ADR-0007, amended 2026-10-06). A Go test reads the -same file later, once the Go SDK's generated code is the third author. A -chain over bare `u32` or `String` fields derives the same terms but a -different leaf encoding, which the other reader cannot open or tell apart; -`dynamic::record`'s docs say why the lowering does not bridge that. +same file later, once the Go SDK's generated code is the third author. A +chain over bare `u32` or `String` fields seals the same leaves too: every +leaf is tagged with its type (vitaminc ADR 0001), whoever wrote it. Regenerate with `STACK_ENCRYPT_UPDATE_FIXTURES=1 cargo test -p stack-encrypt --all-features --test record_lowering`. Only the sealed bytes @@ -87,3 +86,213 @@ by hand. `label_segments.json` beside this file is a different fixture: the one rule for a plain label segment, read by the Rust, derive and Go tests. + +# Query fixture: `query_operators.json` + +Queries named by operator through the data path +(`stack_encrypt::dynamic::query_term`, what a language binding calls), each +term equal to the one the typed query chain (`cipher.query(op::Lt, +&40u32).on(&plan)`) derives for the same query, with a page `verify` +answered and fetch limits `target_limit` sized (ADR-0009; ADR-0007, amended +2026-10-16). `tests/query_operators.rs` derives every entry and checks it +against the typed path; the Go SDK's `encrypt` tests derive, verify and size +the same queries through the guest's `se_query_term`, `se_verify` and +`se_target_limit` exports and compare. No entry depends on a nonce, so the +file changes only when a derivation does: regenerate it with +`STACK_ENCRYPT_UPDATE_FIXTURES=1 cargo test -p stack-encrypt --all-features +--test query_operators`, and do not edit it by hand. + +```json +{ + "_comment": "what this file is", + "key_source": { "kind": "deterministic-sha256", "seed": "<32 bytes, hex>" }, + "keyset_id": "", + "plan": { "": { "context": [...], "outputs": [...], "type": "" }, ... }, + "queries": [ + { "field": "", "operator": "", "input": , + "term": { "operator": "", "fidelity": "exact" | "probabilistic", + "index": "", "domain": null, "term": "" | ["", ""] } } + ], + "verify": { "field": "", "operator": "matches", "input": "", + "values": [, ...], "verified": [, ...] }, + "target_limit": [ + { "field": "", "operator": "matches", "input": "", "term": "", + "want": , "stats": { "rows": , "histogram": [[, ], ...], + "confidence": }, "limit": } + ] +} +``` + +- **`key_source`**, **`keyset_id`.** As in the record fixture: terms derive + under `FakeDataKeySource`'s index key for the nil keyset, whatever the + seed, so the Go tests run the deterministic guest built from the same + source. +- **`queries`.** Each query as a binding sends it, and its term in the wire + form `QueryTerm::to_value` writes, the bytes in hex: one term, or for + `between` the low bound's then the high's. An input is JSON, read as the + field's declared type, so `40` queries the `uint32` field `age` and + `1.5` the `float64` field `score`, whose terms are cllw-ore's + encryption of the float's ADR-0002 order key. +- **`verify`.** A page of decrypted values, null for an empty field, and the + boolean `verify` answers for each, which is what the typed `MatchQuery` + answers. +- **`target_limit`.** A match term's bytes, the statistics in the wire form + `Stats::from_frame` reads (an absent histogram is the declared prior), and + the limit, null when no finite fetch can be promised, which is what the + typed `MatchQuery` answers. + +# Value-kinds fixture: `value_kinds.json` + +One field of each value kind a plan gained in #1144: `int8`, `int16`, +`uint8`, `uint16`, `int128`, `uint128`, `date`, `timestamp` and `decimal`. +The data-plan lowering sealed one record of them under the deterministic key +source, and the file holds that record, each value's transport frame, and two +equality queries whose input differs from the stored value but whose term is +the stored one. `tests/value_kinds.rs` checks that the record opens to the +values exactly, that the record path, the data query path +(`dynamic::query_term`) and the typed path derive the same terms, and that +the committed terms are today's. The Go SDK's `encrypt` tests read the same +file: the generated `testusers.ValueKinds` type, under the same context and +identities, parses each `text` into its Go type, writes it as the same +`frame`, opens the sealed record, and derives the same terms through the +deterministic guest. + +Regenerate with `STACK_ENCRYPT_UPDATE_FIXTURES=1 cargo test -p stack-encrypt +--all-features --test value_kinds`. Only the sealed leaves change between +runs; the frames and the terms must not. Do not edit the file by hand. + +```json +{ + "_comment": "what this file is", + "key_source": { "kind": "deterministic-sha256", "seed": "<32 bytes, hex>" }, + "keyset_id": "", + "plan": { "": { "context": ["value_kinds", ""], "outputs": [...], "type": "" }, ... }, + "values": [ + { "field": "", "type": "", "text": "", "frame": "" } + ], + "record": { "": { "c": "", "eq": "", "ore" | "ope": "" }, ... }, + "queries": [ + { "field": "", "operator": "eq", "text": "", "frame": "", "term": "" } + ] +} +``` + +- **`values`.** Each field's value, in the order the plan lists the fields. + `text` is how a test spells it: a decimal integer for the integer kinds, + `YYYY-MM-DD` for a date, RFC 3339 with nanoseconds in UTC for a timestamp, + and a decimal with its scale (`-1234.5600` has scale 4) for a decimal. + `frame` is the value's transport frame, hex: vitaminc's tag and payload + (ADR-0002's table), which is also the plaintext a sealed leaf holds. A + date's payload counts days from 0001-01-01 as day 1, a timestamp's is + Unix seconds then nanoseconds, and a decimal's is rust_decimal's flags + word and 96-bit mantissa, so the scale is kept. +- **`record`.** The stored record: `"c"` is the frozen `SealedValue` leaf, + and each term its frozen bytes, as in the record fixture. Every field has + an equality term; the integer fields have an ORE or OPE term too. A date, + timestamp and decimal have no order term until #1236. +- **`queries`.** Equality queries vitaminc-normalize folds onto a stored + term: `-1234.56` finds the stored `-1234.5600` (the scale is normalised), + and `…03.123456Z` finds the stored `…03.123456789Z` (a timestamp's term is + truncated to the microsecond; the ciphertext keeps every nanosecond). + Each `term` equals the stored field's `eq`. + +# Stored-rows fixture: `stored_rows_v1.json` (FROZEN) + +Rows the `next` build stored, which every later build must still read. The +fixtures above prove that two authors of one record agree *today*, and are +regenerated when the encoding moves. This one is the opposite: it is written +once and **never regenerated**, and edited only as the exception below allows. +A change that alters the bytes of a stored row (the leaf encoding, the AAD, a +term derivation, the stored tree's shape) fails `tests/stored_rows.rs` instead +of being regenerated away. + +`tests/stored_rows.rs` checks every case two ways: + +- the stored tree opens, through `dynamic::record::decrypt`, to exactly the + `opened` frame; and +- sealing `source` again under `plan` gives the same tree, apart from the + sealed leaves (which carry a fresh nonce): the same shape and map keys in + order, the same terms and the same passthroughs. + +Nothing reads `STACK_ENCRYPT_UPDATE_FIXTURES` for this file. The one test that +creates it, `write_stored_rows_v1`, is `#[ignore]`d and refuses to run when the +file exists. The check rewrites it only under +`STACK_ENCRYPT_REFREEZE_ORDER_TERMS=1`, for the exception below. The rows +depend on `stack_kms::DeterministicSource` and the seed below; both are part +of the frozen contract. + +**If this test fails, the change broke stored data.** Do not regenerate the +file. Either fix the change, or, for a deliberate change to the stored +format, add `stored_rows_v2.json` (and a `write_stored_rows_v2`) beside this +one, keep v1, and say in the CHANGELOG how v1 rows migrate. + +**Order terms are the one exception, until stack-encrypt 1.0.** +Until then a deliberate change to how an ORE or OPE term is derived may +re-freeze the `ore` and `ope` passthroughs that moved, and nothing else: +the leaves, the AAD, every other term and the shape stay as written. Run + +```bash +STACK_ENCRYPT_REFREEZE_ORDER_TERMS=1 mise x --env test -- \ + cargo nextest run -p stack-encrypt --all-features --test stored_rows +``` + +It checks that every row opens as it did and that the resealed tree matches +the stored one in everything but its order terms' bytes, and only then +copies the new order terms over the old. Any other difference fails it and +nothing is written. + +The change must also say in the CHANGELOG's `Breaking` section that its +order terms changed bytes, which released versions wrote the old ones, and +that a column holding them is to be encrypted again. That matters more than +the word "exception" suggests. An order term is never opened, only +compared, so a stale one is not refused: every `<`, `BETWEEN` and +`ORDER BY` over the column silently misses or misplaces rows, where a leaf +that no longer opens fails loudly. stack-encrypt 0.1.0 and 0.2.0 and the Go +module's v0.1.0-alpha.1 already shipped order terms. The exception rests on +those being pre-1.0 and pre-release, not on nobody holding one. + +The exception has been used once beyond re-freezing: when `u8` and `i8` +lost their order term (a 256-value domain ranks every row, the leak a +`bool`'s order term is refused for), the `every_kind` case dropped the +`ore` terms of its `i8` and `u8` fields and its `i8_ope` and `u8_ope` +twin fields, which held only an OPE term. Its plan and source lost those +entries with them; every leaf, equality term and other order term is as it +was written. + +## Schema + +```json +{ + "_comment": "what this file is", + "key_source": { "kind": "deterministic-sha256", "seed": "<32 bytes, hex>" }, + "keyset_id": "", + "cases": [ + { + "name": "", + "about": "", + "plan": { "": { "context": [...], "outputs": [...], "type": "" }, ... }, + "source": "", + "expected_context": "" | null, + "stored": , + "opened": "" + } + ] +} +``` + +A `` is one stored-tree node, an object with one key: `{"leaf": hex}` +(a `SealedValue`'s frozen bytes), `{"seq": [, ...]}`, `{"empty_seq": +hex}`, `{"map": [[key, ], ...]}` (in stored order), `{"empty_map": +hex}`, or `{"passthrough": hex}` (the payload's frame; a term is a +passthrough of its bytes). + +The cases: + +| Case | Covers | +| --- | --- | +| `every_kind` | one field per value kind with every index it admits (OPE on a twin field), the non-default match options, an array and an object (with empty containers), an untyped field, a field whose key is not its label's last segment, and a passthrough | +| `three_segment_label` | labels of three segments | +| `one_extension_part` | every label extended by an integer part | +| `two_extension_parts` | every label extended by an integer part, then a text part | +| `context_field` | a plan whose context is the record's tenant field, opened expecting it | +| `batch` | a batch of two records under one plan | diff --git a/packages/stack-encrypt/tests/fixtures/query_operators.json b/packages/stack-encrypt/tests/fixtures/query_operators.json new file mode 100644 index 000000000..d0630eba4 --- /dev/null +++ b/packages/stack-encrypt/tests/fixtures/query_operators.json @@ -0,0 +1,324 @@ +{ + "_comment": "Query terms derived by operator through the data path (stack_encrypt::dynamic::query_term), each equal to the typed query chain's, with a verified page and fetch limits. Read by tests/query_operators.rs and the Go SDK's tests; the schema is in README.md beside this file. Regenerate with STACK_ENCRYPT_UPDATE_FIXTURES=1; do not edit by hand.", + "key_source": { + "kind": "deterministic-sha256", + "seed": "737461636b2d656e6372797074207265636f7264206669787475726520763120" + }, + "keyset_id": "00000000-0000-0000-0000-000000000000", + "plan": { + "age": { + "context": [ + "users", + "age" + ], + "outputs": [ + "c", + "eq", + "ore" + ], + "type": "uint32" + }, + "email": { + "context": [ + "users", + "email" + ], + "outputs": [ + "c", + "eq" + ], + "type": "string" + }, + "name": { + "context": [ + "users", + "name" + ], + "outputs": [ + "c", + "match" + ], + "type": "string" + }, + "score": { + "context": [ + "users", + "score" + ], + "outputs": [ + "c", + "ore" + ], + "type": "float64" + } + }, + "queries": [ + { + "field": "email", + "input": "bob@example.com", + "operator": "eq", + "term": { + "domain": null, + "fidelity": "exact", + "index": "eq", + "operator": "eq", + "term": "0cf708c07acaaa169e84e4adf7081f0433d87760bd7e9c63bd7a58c000b8d33b" + } + }, + { + "field": "age", + "input": 34, + "operator": "eq", + "term": { + "domain": null, + "fidelity": "exact", + "index": "eq", + "operator": "eq", + "term": "cc854fd5c7e3f4bb28cb15cae47d866b65b7012c06df43b4b9a6c51adff4710a" + } + }, + { + "field": "age", + "input": 40, + "operator": "lt", + "term": { + "domain": null, + "fidelity": "exact", + "index": "ore", + "operator": "lt", + "term": "758821c792265d942f89fa1dad016fb71b326f756e62950367e5d12f636d8b78" + } + }, + { + "field": "age", + "input": 40, + "operator": "lte", + "term": { + "domain": null, + "fidelity": "exact", + "index": "ore", + "operator": "lte", + "term": "758821c792265d942f89fa1dad016fb71b326f756e62950367e5d12f636d8b78" + } + }, + { + "field": "age", + "input": 18, + "operator": "gt", + "term": { + "domain": null, + "fidelity": "exact", + "index": "ore", + "operator": "gt", + "term": "758821c792265d942f89fa1dad016fb71b326f756e62950367e5d060dbfcceb5" + } + }, + { + "field": "age", + "input": 18, + "operator": "gte", + "term": { + "domain": null, + "fidelity": "exact", + "index": "ore", + "operator": "gte", + "term": "758821c792265d942f89fa1dad016fb71b326f756e62950367e5d060dbfcceb5" + } + }, + { + "field": "age", + "input": [ + 18, + 65 + ], + "operator": "between", + "term": { + "domain": null, + "fidelity": "exact", + "index": "ore", + "operator": "between", + "term": [ + "758821c792265d942f89fa1dad016fb71b326f756e62950367e5d060dbfcceb5", + "758821c792265d942f89fa1dad016fb71b326f756e62950367e6377200eec06b" + ] + } + }, + { + "field": "name", + "input": "alice", + "operator": "matches", + "term": { + "domain": null, + "fidelity": "probabilistic", + "index": "match", + "operator": "matches", + "term": "2800300053006d00890095009d00c100fe00" + } + }, + { + "field": "name", + "input": "ali", + "operator": "matches", + "term": { + "domain": null, + "fidelity": "probabilistic", + "index": "match", + "operator": "matches", + "term": "30009d00c100" + } + }, + { + "field": "score", + "input": 1.5, + "operator": "lt", + "term": { + "domain": null, + "fidelity": "exact", + "index": "ore", + "operator": "lt", + "term": "d86769e4203df9a878dfb084014ea9df2ac9e74b1cef394f5042a6a88e4b81ab7d678eb59f8d27089e5e988fe8130bf9ea2707ab35e341d60c19c9836360eb21" + } + }, + { + "field": "score", + "input": [ + -0.5, + 2.5 + ], + "operator": "between", + "term": { + "domain": null, + "fidelity": "exact", + "index": "ore", + "operator": "between", + "term": [ + "d73ffdebc829eff390b70c5e169f58bf4b2aa664817584cc01f5e114eb7d91d2b6fe729db0f85f0df93d0487a2888f0a1865ca8946912ec33493cb18c5abb183", + "d8688e0201b46fefe8147f16e4011433e428361b12b70e40fed58a526bcdad72208619a7f90e617d22ddda3df8de4ccc224672bc0ea650ad64e30fb253851039" + ] + } + } + ], + "target_limit": [ + { + "field": "name", + "input": "ali", + "limit": 53954, + "operator": "matches", + "stats": { + "histogram": [ + [ + 40, + 500000 + ], + [ + 120, + 500000 + ] + ], + "rows": 1000000 + }, + "term": "30009d00c100", + "want": 10 + }, + { + "field": "name", + "input": "ali", + "limit": 3825, + "operator": "matches", + "stats": { + "confidence": 0.5, + "histogram": [ + [ + 40, + 1000000 + ] + ], + "rows": 1000000 + }, + "term": "30009d00c100", + "want": 10 + }, + { + "field": "name", + "input": "ali", + "limit": null, + "operator": "matches", + "stats": { + "rows": 1000000 + }, + "term": "30009d00c100", + "want": 10 + }, + { + "field": "name", + "input": "alice", + "limit": 611, + "operator": "matches", + "stats": { + "histogram": [ + [ + 40, + 500000 + ], + [ + 120, + 500000 + ] + ], + "rows": 1000000 + }, + "term": "2800300053006d00890095009d00c100fe00", + "want": 10 + }, + { + "field": "name", + "input": "alice", + "limit": 10, + "operator": "matches", + "stats": { + "confidence": 0.5, + "histogram": [ + [ + 40, + 1000000 + ] + ], + "rows": 1000000 + }, + "term": "2800300053006d00890095009d00c100fe00", + "want": 10 + }, + { + "field": "name", + "input": "alice", + "limit": null, + "operator": "matches", + "stats": { + "rows": 1000000 + }, + "term": "2800300053006d00890095009d00c100fe00", + "want": 10 + } + ], + "verify": { + "field": "name", + "input": "alice", + "operator": "matches", + "values": [ + "Alice Smith", + "alicia", + "Bob", + "malice", + "ALICE", + null + ], + "verified": [ + true, + false, + false, + true, + true, + false + ] + } +} diff --git a/packages/stack-encrypt/tests/fixtures/record_lowering.json b/packages/stack-encrypt/tests/fixtures/record_lowering.json index 9aa62a478..45ec0cca3 100644 --- a/packages/stack-encrypt/tests/fixtures/record_lowering.json +++ b/packages/stack-encrypt/tests/fixtures/record_lowering.json @@ -47,8 +47,8 @@ "passthrough": "tenants/acme" }, "text": { - "c": "0100000000000000000000000000000000cf1a45d1517a08c45d6ae1c989ae99de2000da620d1dbdbba9372d1439b6d44f7cc4169e9a255387aa180d6a95fb17926d7001a7e8ada1c849706c1f1b5c56ad878ea5deb68ebefecb98a8816cbe658c20b33989cc", - "eq": "0d84fbd44d82b5150351556d6d25a038c70cf0c696e2499a71b659a7732a9d08" + "c": "0100000000000000000000000000000000cf1a45d1517a08c45d6ae1c989ae99de2000da620d1dbdbba9372d1439b6d44f7cc4169e9a255387aa180d6a95fb17926d700294bddaed0bd2c45206be9407edb15f4c046eff417d18a00d6c033139e01770404e72", + "eq": "d07ccccb55205dbb5c69c80bd88c907496a18bbed9317f39d96a83f6fd308a85" } }, "typed_chain": { @@ -59,8 +59,8 @@ "passthrough": "tenants/acme" }, "text": { - "c": "010000000000000000000000000000000048a99626f697c02001f07da2edb19f4220009868b833b6220fa0d13b612af03af1f38fee082c7555b6e7fbf8e13ccb70f80701dc7cf368a02a3bd466d24b4037597aeae058b641ff5a2c73736f98d8d49ae10a3d9c", - "eq": "0d84fbd44d82b5150351556d6d25a038c70cf0c696e2499a71b659a7732a9d08" + "c": "010000000000000000000000000000000048a99626f697c02001f07da2edb19f4220009868b833b6220fa0d13b612af03af1f38fee082c7555b6e7fbf8e13ccb70f80702d9b40099839313e8ad1e943b7a5fc8f1513a45c1e5309cbcdccc05dbd0a991b0f3f4", + "eq": "d07ccccb55205dbb5c69c80bd88c907496a18bbed9317f39d96a83f6fd308a85" } } } @@ -125,38 +125,38 @@ "records": { "lowering": { "age": { - "c": "01000000000000000000000000000000004d5626148f77c4c6d9da0ddbdf7663a2200021162641133485216f389886cbd7c6e9b25afa0f5f166f985b23384e81ffcfac010686f7787f57b4c7a2192c3499ea1b890f9f4623d84b72b5f40266b10b7f607a41", - "eq": "5433335e609685a33b29c98369e68cd5d92e838aa566a3ff1df5c2d251b63885", - "ore": "7ca54e16d7944c0a9d8577d87f3864fdf79e99fea5956ba956a126a605cbf3f1" + "c": "01000000000000000000000000000000004d5626148f77c4c6d9da0ddbdf7663a2200021162641133485216f389886cbd7c6e9b25afa0f5f166f985b23384e81ffcfac02ec48f08e1f2c79b55251885601527a0226a754a797eaa77131f9c7f2d6157f2098", + "eq": "cc854fd5c7e3f4bb28cb15cae47d866b65b7012c06df43b4b9a6c51adff4710a", + "ore": "758821c792265d942f89fa1dad016fb71b326f756e62950367e5d12f62824807" }, "email": { - "c": "0100000000000000000000000000000000b2afa77357a61488146c0edaa0246f65200043956c4f4bba857028c28165dfce9c63d904b738bbb039b6e11c805112d4a1ee01ec122b5ee8771a6a37fc17312ff3f7a56e93885e19d4bb189950aa37475eb74f63f5758c4f87a3494c5e46ff", - "eq": "ec534cfbf2336785378c3761ff88623c46361b2ba7c5fa83930ebacae49cf646", - "match": "06000d0013001d002200260029002a003000320043005a006000660068006c0077008f00960098009e00c200c500d600d900de00e300e700e900eb00ec00f200fa00" + "c": "0100000000000000000000000000000000b2afa77357a61488146c0edaa0246f65200043956c4f4bba857028c28165dfce9c63d904b738bbb039b6e11c805112d4a1ee025de4969eb5509d9cb7d2ef0ea827c2b6bf09d7b73ff165ad68d6fe1136f254f9accc930118490a162a1f829b", + "eq": "0cf708c07acaaa169e84e4adf7081f0433d87760bd7e9c63bd7a58c000b8d33b", + "match": "030005000900100012001a001c0027002a002e003000340042004b0068006d007100750083009200a800b200b400b700ba00c200c500dc00e500ea00f200f300f900fe00" }, "id": { "passthrough": 42 }, "notes": { - "c": "0100000000000000000000000000000000723f7a7f14b07197168aa13bc52010b3200072a73194b45af604cc6201b5a57554b05cc7ed6ad22b9102cbcb71bd9067849601a2ae59c2cfca81b0ecde824090e2331f2c389202676855068652e9e566dfccb9a55e9973a9301c" + "c": "0100000000000000000000000000000000723f7a7f14b07197168aa13bc52010b3200072a73194b45af604cc6201b5a57554b05cc7ed6ad22b9102cbcb71bd90678496021b7a7da71f40bec0f7d93f6bb3a8f32da41d7eac589e1063c90e7d18e397a81b88d966861810b8" } }, "typed_chain": { "age": { - "c": "010000000000000000000000000000000092e427c5e176b60261add6ce80fd02df20008d231453c97fdec97a0b6559ac8f509129d20163f262d40ce5d77cf1ebe0cad501155707def46648a0c3685910bea6d3ec9c63aeb8c1e864092d47a3bd0269d135c9", - "eq": "5433335e609685a33b29c98369e68cd5d92e838aa566a3ff1df5c2d251b63885", - "ore": "7ca54e16d7944c0a9d8577d87f3864fdf79e99fea5956ba956a126a605cbf3f1" + "c": "010000000000000000000000000000000092e427c5e176b60261add6ce80fd02df20008d231453c97fdec97a0b6559ac8f509129d20163f262d40ce5d77cf1ebe0cad50248c801def074dfd0d34b7f34a04479875a7df403a3b12bd8ca475d4f377a86394f", + "eq": "cc854fd5c7e3f4bb28cb15cae47d866b65b7012c06df43b4b9a6c51adff4710a", + "ore": "758821c792265d942f89fa1dad016fb71b326f756e62950367e5d12f62824807" }, "email": { - "c": "0100000000000000000000000000000000cf92191950409f9fe82a2b11888ffc1d2000ca4d5bbafbff919af4d3a95c7cc046d632fd4c28785b238f4b6f7ea3aa08482901a3e671679e0e1ac106a28ad8a27e3ae143a6ad5c4b8280dbf6818d1bab32fa45cb0790df8551cec1c9bb3187", - "eq": "ec534cfbf2336785378c3761ff88623c46361b2ba7c5fa83930ebacae49cf646", - "match": "06000d0013001d002200260029002a003000320043005a006000660068006c0077008f00960098009e00c200c500d600d900de00e300e700e900eb00ec00f200fa00" + "c": "0100000000000000000000000000000000cf92191950409f9fe82a2b11888ffc1d2000ca4d5bbafbff919af4d3a95c7cc046d632fd4c28785b238f4b6f7ea3aa08482902a278c63260694db784fbb3361b95717b08851fa7bf6cce35e45ac115dbaffb9f93dac5cd53939eae0cba0832", + "eq": "0cf708c07acaaa169e84e4adf7081f0433d87760bd7e9c63bd7a58c000b8d33b", + "match": "030005000900100012001a001c0027002a002e003000340042004b0068006d007100750083009200a800b200b400b700ba00c200c500dc00e500ea00f200f300f900fe00" }, "id": { "passthrough": 42 }, "notes": { - "c": "0100000000000000000000000000000000562a41e032316ff2d1264a9e9f5c3b842000de33c8d1f2caaab8b90f691161a57eeb1328f7f1c9b5be76dec83e8a53765f11015924202425d1e3be9754306c2e290e350232d5b5623190ebcc69feb55fb566fe4b4db024f1ebcc" + "c": "0100000000000000000000000000000000562a41e032316ff2d1264a9e9f5c3b842000de33c8d1f2caaab8b90f691161a57eeb1328f7f1c9b5be76dec83e8a53765f1102bdeeaf5aa37fa829e7519021baaa76584778ece652b6b881054d4f5c9203662309001de93e044a" } } } diff --git a/packages/stack-encrypt/tests/fixtures/stored_rows_v1.json b/packages/stack-encrypt/tests/fixtures/stored_rows_v1.json new file mode 100644 index 000000000..75c77df16 --- /dev/null +++ b/packages/stack-encrypt/tests/fixtures/stored_rows_v1.json @@ -0,0 +1,1616 @@ +{ + "_comment": "FROZEN. Records the next build stored, under a deterministic key source. Every later build must open each one to `opened` and seal its `source` to the same shape, terms and passthroughs. Read by tests/stored_rows.rs; the schema is in README.md beside this file. Never regenerate this file, and edit it only as README.md allows for order terms: a change to the stored format adds stored_rows_v2.json beside it.", + "cases": [ + { + "about": "one field per value kind with every index it admits, composites, an untyped field, a renamed field and a passthrough", + "expected_context": null, + "name": "every_kind", + "opened": "f11800000006000000616d6f756e7414000004800061bc000000000000000000020000006174130bc9d26a0000000015cd5b070300000062696f0a21000000456e6372797074656420736561726368206f7665722073686f7274206e6f74657304000000626c6f620b040000000001feff030000006461791281460b0005000000656d61696c0a17000000416c6963652e536d697468406578616d706c652e636f6d0300000066333208000000800300000066363409000000000000024004000000666c61670304000000693132381000000000000000000000000000000080030000006931360ed4fe030000006933320490eefeff0300000069363405000efad5feffffff0200000069380cf8020000006964062a000000050000006c6f6f73650a1400000061206669656c642077697468206e6f2074797065040000006d61696c0a0f000000626f62406578616d706c652e636f6d050000007072656673f103000000040000006461726b03040000006e6f6e650005000000656d707479f1000000000400000074616773f0030000000a01000000610401000000f000000000040000007531323811ffffffffffffffffffffffffffffffff030000007531360f60ea030000007533320600286bee0300000075363407ffffffffffffffff0200000075380dc8", + "plan": { + "amount": { + "context": [ + "kinds", + "amount" + ], + "outputs": [ + "c", + "eq" + ], + "type": "decimal" + }, + "at": { + "context": [ + "kinds", + "at" + ], + "outputs": [ + "c", + "eq" + ], + "type": "timestamp" + }, + "bio": { + "context": [ + "kinds", + "bio" + ], + "outputs": [ + "c", + { + "match": { + "downcase": false, + "k": 6, + "m": 1024, + "tokenizer": "standard" + } + } + ], + "type": "string" + }, + "blob": { + "context": [ + "kinds", + "blob" + ], + "outputs": [ + "c", + "eq", + "ore" + ], + "type": "bytes" + }, + "blob_ope": { + "context": [ + "kinds", + "blob_ope" + ], + "outputs": [ + "ope" + ], + "type": "bytes" + }, + "day": { + "context": [ + "kinds", + "day" + ], + "outputs": [ + "c", + "eq" + ], + "type": "date" + }, + "email": { + "context": [ + "kinds", + "email" + ], + "outputs": [ + "c", + "eq", + "match", + "ore" + ], + "type": "string" + }, + "email_ope": { + "context": [ + "kinds", + "email_ope" + ], + "outputs": [ + "ope" + ], + "type": "string" + }, + "f32": { + "context": [ + "kinds", + "f32" + ], + "outputs": [ + "c", + "eq", + "ore" + ], + "type": "float32" + }, + "f32_ope": { + "context": [ + "kinds", + "f32_ope" + ], + "outputs": [ + "ope" + ], + "type": "float32" + }, + "f64": { + "context": [ + "kinds", + "f64" + ], + "outputs": [ + "c", + "eq", + "ore" + ], + "type": "float64" + }, + "f64_ope": { + "context": [ + "kinds", + "f64_ope" + ], + "outputs": [ + "ope" + ], + "type": "float64" + }, + "flag": { + "context": [ + "kinds", + "flag" + ], + "outputs": [ + "c" + ], + "type": "bool" + }, + "i128": { + "context": [ + "kinds", + "i128" + ], + "outputs": [ + "c", + "eq", + "ore" + ], + "type": "int128" + }, + "i128_ope": { + "context": [ + "kinds", + "i128_ope" + ], + "outputs": [ + "ope" + ], + "type": "int128" + }, + "i16": { + "context": [ + "kinds", + "i16" + ], + "outputs": [ + "c", + "eq", + "ore" + ], + "type": "int16" + }, + "i16_ope": { + "context": [ + "kinds", + "i16_ope" + ], + "outputs": [ + "ope" + ], + "type": "int16" + }, + "i32": { + "context": [ + "kinds", + "i32" + ], + "outputs": [ + "c", + "eq", + "ore" + ], + "type": "int32" + }, + "i32_ope": { + "context": [ + "kinds", + "i32_ope" + ], + "outputs": [ + "ope" + ], + "type": "int32" + }, + "i64": { + "context": [ + "kinds", + "i64" + ], + "outputs": [ + "c", + "eq", + "ore" + ], + "type": "int64" + }, + "i64_ope": { + "context": [ + "kinds", + "i64_ope" + ], + "outputs": [ + "ope" + ], + "type": "int64" + }, + "i8": { + "context": [ + "kinds", + "i8" + ], + "outputs": [ + "c", + "eq" + ], + "type": "int8" + }, + "id": { + "context": [ + "kinds", + "id" + ], + "outputs": [ + "passthrough" + ], + "type": "uint32" + }, + "loose": { + "context": [ + "kinds", + "loose" + ], + "outputs": [ + "c" + ] + }, + "mail": { + "context": [ + "kinds", + "email_address" + ], + "outputs": [ + "c", + "eq" + ], + "type": "string" + }, + "prefs": { + "context": [ + "kinds", + "prefs" + ], + "outputs": [ + "c" + ], + "type": "object" + }, + "tags": { + "context": [ + "kinds", + "tags" + ], + "outputs": [ + "c" + ], + "type": "array" + }, + "u128": { + "context": [ + "kinds", + "u128" + ], + "outputs": [ + "c", + "eq", + "ore" + ], + "type": "uint128" + }, + "u128_ope": { + "context": [ + "kinds", + "u128_ope" + ], + "outputs": [ + "ope" + ], + "type": "uint128" + }, + "u16": { + "context": [ + "kinds", + "u16" + ], + "outputs": [ + "c", + "eq", + "ore" + ], + "type": "uint16" + }, + "u16_ope": { + "context": [ + "kinds", + "u16_ope" + ], + "outputs": [ + "ope" + ], + "type": "uint16" + }, + "u32": { + "context": [ + "kinds", + "u32" + ], + "outputs": [ + "c", + "eq", + "ore" + ], + "type": "uint32" + }, + "u32_ope": { + "context": [ + "kinds", + "u32_ope" + ], + "outputs": [ + "ope" + ], + "type": "uint32" + }, + "u64": { + "context": [ + "kinds", + "u64" + ], + "outputs": [ + "c", + "eq", + "ore" + ], + "type": "uint64" + }, + "u64_ope": { + "context": [ + "kinds", + "u64_ope" + ], + "outputs": [ + "ope" + ], + "type": "uint64" + }, + "u8": { + "context": [ + "kinds", + "u8" + ], + "outputs": [ + "c", + "eq" + ], + "type": "uint8" + } + }, + "source": "f12400000004000000666c6167030200000069380cf8030000006931360ed4fe070000006931365f6f70650ed4fe030000006933320490eefeff070000006933325f6f70650490eefeff0300000069363405000efad5feffffff070000006936345f6f706505000efad5feffffff0400000069313238100000000000000000000000000000008008000000693132385f6f706510000000000000000000000000000000800200000075380dc8030000007531360f60ea070000007531365f6f70650f60ea030000007533320600286bee070000007533325f6f70650600286bee0300000075363407ffffffffffffffff070000007536345f6f706507ffffffffffffffff040000007531323811ffffffffffffffffffffffffffffffff08000000753132385f6f706511ffffffffffffffffffffffffffffffff030000006633320800000080070000006633325f6f7065080000008003000000663634090000000000000240070000006636345f6f706509000000000000024006000000616d6f756e7414000004800061bc000000000000000000030000006461791281460b00020000006174130bc9d26a0000000015cd5b0705000000656d61696c0a17000000416c6963652e536d697468406578616d706c652e636f6d09000000656d61696c5f6f70650a17000000416c6963652e536d697468406578616d706c652e636f6d0300000062696f0a21000000456e6372797074656420736561726368206f7665722073686f7274206e6f74657304000000626c6f620b040000000001feff08000000626c6f625f6f70650b040000000001feff0400000074616773f0030000000a01000000610401000000f000000000050000007072656673f103000000040000006461726b03040000006e6f6e650005000000656d707479f100000000050000006c6f6f73650a1400000061206669656c642077697468206e6f2074797065040000006d61696c0a0f000000626f62406578616d706c652e636f6d020000006964062a000000", + "stored": { + "map": [ + [ + "amount", + { + "map": [ + [ + "c", + { + "leaf": "01000000000000000000000000000000003c789880b03f4c265880e4acfca9214f200006f6effd98a8a7eaf09f9cbf3496d953f1db1107128e28453fde000f818e55e9025f7976f550d57ec8fe5621e6262e12dad34068a02e105d05497be7fb67a4b3e2b289b5111f91013bdb00f1e6f6" + } + ], + [ + "eq", + { + "passthrough": "0b20000000a805813c605557a7defc98ee4ca3030b001d0d8bf4b00436bd82dcc50277a162" + } + ] + ] + } + ], + [ + "at", + { + "map": [ + [ + "c", + { + "leaf": "01000000000000000000000000000000004146c2504b717aa2e858cdcf9f7adc5520003f88a6d03dc92e8dc4c8ea807f9a1a82c7733b23b6210ea5039704ca5c34a65f02dd4474be374c2f3b6d710ac2bf8b3fa405fa35f7b2756e4103a17bbbdeb485967674216e2dc7b4e8bb" + } + ], + [ + "eq", + { + "passthrough": "0b200000005cce6a9f616efca5cd1af50a99c1536a5b6ea54d09ca413e9bbf199da16efaf1" + } + ] + ] + } + ], + [ + "bio", + { + "map": [ + [ + "c", + { + "leaf": "010000000000000000000000000000000068f4364702d956b2af145cc5815b4e142000c8d141062ad1d5fccaeb5ee5610f4112f8b887cf6999c5ce8674754330b0e34a020e451aace4c06b82d658f832c6b1e36395e3317c5ff04173900bafa5f9c7c4798ef3f90c688e777a34dd92e7cf2c55dc163bb49bf64e3094d302e020a563" + } + ], + [ + "match", + { + "passthrough": "0b3c000000760081009700a600cd00d300d500d6004d014f01560172019f01a4011f024a026d0276027b027e02b502100315034f03590362037f03a603c203d303" + } + ] + ] + } + ], + [ + "blob", + { + "map": [ + [ + "c", + { + "leaf": "010000000000000000000000000000000078e00c04868a5215c0ee6d224cbb23a62000003237396811d1c74d9e8de9cd7b57eb23e9ef768af5d08d4d9de027c693b1a5022db9a653b0f3c0b1ae002f84ee77c48c2a3e5b171449014878215ac5066167ff33" + } + ], + [ + "eq", + { + "passthrough": "0b20000000ccad5773969fdfa901fc27b449c91fd911bba0969204735da5bfb9c8d2f537f6" + } + ], + [ + "ore", + { + "passthrough": "0b280000008bb663d8b4c006682148c9277bc5e57d411fba769c6414c115d538247d2949371e0c5aad377dc8a7" + } + ] + ] + } + ], + [ + "blob_ope", + { + "map": [ + [ + "ope", + { + "passthrough": "0b290000000060d402259cb39497228b893f5e0a87a0c7800b2a0fa773b681dea30ac939d570cd945da2ec1f7c44" + } + ] + ] + } + ], + [ + "day", + { + "map": [ + [ + "c", + { + "leaf": "01000000000000000000000000000000001ad8b98c8dd5abfd2c89c1c1d50da03120002f91767738c693da328ad5275b80b1ba639f95df0ccec8f383d52d13e3c5c790029ab1de47d3dfc70f5eb8d12c1bc44d91b704fd8e9ad7ed770ff139d88ecd177f0e" + } + ], + [ + "eq", + { + "passthrough": "0b2000000092b562f25aaa5291fe1e7248bc785178c833819dddae33742a442564f5aaa129" + } + ] + ] + } + ], + [ + "email", + { + "map": [ + [ + "c", + { + "leaf": "010000000000000000000000000000000089b6231ed4a2c340ca76731fd843286b20009e26adc45f5dc465ca4b5c6293d623c551b0ef59e9a1da4aff0c2566d5e48a2c02fe3949aea60d4f7507d8eb4c68f47cc0203c3b57cf1dad5c7a15e6e292bd95efaf005a0da0aa4d50561ae505079ae1c80658d6ce" + } + ], + [ + "eq", + { + "passthrough": "0b20000000729495e2a16d4a125e4cc8cd1becc4bbf90b6971388dbf379129f2ba1c841365" + } + ], + [ + "match", + { + "passthrough": "0b780000000000040005000f0010001400150016001a001d00200025002d002f00370038003a003b003d004000450046004d00500056005b005f006300680069006a006b00790084008d0095009700a600aa00b200b500ba00c000c600c700ca00cb00d200dd00df00e300e500e600e800f200f300f500fc00fe00ff00" + } + ], + [ + "ore", + { + "passthrough": "0bc0000000e4596b725e0c386758533cd6e735152740b9af9bd6e96019ac18a724e079479d43caad7e83ce14f737ca246ae6ba5ad0c0a2e5f7f0a2101c1831bc6aee4ccc2a22292816e36cc8938536d59d689be229b0d0210e0354900ba200b04f93545a06098d2edb7531e590da3dc5cd393261d54f60574a127e198bfc752099b1cfd5f4fe44666963b4e5b3e0c8e7623c8eae478d05c0513e5554be89ca7f1248fd52e23e23974da8052807e49f4782d6d42e0d5690c37d1242ba62fdc4200434be1593" + } + ] + ] + } + ], + [ + "email_ope", + { + "map": [ + [ + "ope", + { + "passthrough": "0bc100000000849552987a983ba140e5c8fa0eac802885238b8fcd80f3e55e95f286f24ba7b93c67dfc7501c82b3bad61452b7a8e3b1adbeb99526f990ea8f8e0570666ba91ce7be424ecd14712dd2f96518e26605f14440805a241dd14b28497fb3ed6cf0bfabab60848d2871bdb87377deae6a313c0f6485ce91f103c7f309044f8cf03a3a8aca48dce15500126d1dd2de74674f6e11fc02cf46075ef6c6f09d8b797ade427d3bbd5807e3e066dfee5a3eff31b6698c5a6e6640d70987838d373c39ce7df3" + } + ] + ] + } + ], + [ + "f32", + { + "map": [ + [ + "c", + { + "leaf": "01000000000000000000000000000000008c2f1dd683c5222ffdbc6eba46a07af72000fef1bb3ee06c027f4369d638572c5ebb3df2e5b2a45a4200d93fa17697e392a302763a365e336c2432c2d29700be5684ed780c8f1a00b73d2bcbcd329b2be51ef780" + } + ], + [ + "eq", + { + "passthrough": "0b2000000002ba8a813077e3e355b729964a623ad6330ac9afbacde85367ceb805d3d1a431" + } + ], + [ + "ore", + { + "passthrough": "0b400000003a83168a330a190579e7a0dce23066fc5bf762b1b10a0fd4b5add6be7f76c09f027a39deaaf81c35050751ef258433a5e79bb0835ffa705b1660cf0439ae4813" + } + ] + ] + } + ], + [ + "f32_ope", + { + "map": [ + [ + "ope", + { + "passthrough": "0b41000000010713d30a44fad510839aa637489c19b56062ffb692d964261640079e31e321728559526c51454b6d827518b8b47c64f9875b6864e62edc62e328d0e0598f1f10" + } + ] + ] + } + ], + [ + "f64", + { + "map": [ + [ + "c", + { + "leaf": "01000000000000000000000000000000002432346c4600d599dcd0a0e272993caf2000733299dac72a1cac52958ee7b09ca899f8b2f5e934cc78908bf65c361069d40802245c4f25285cf65466c73efb7db3e2ff025ca0410b2af003d28819587ffcd0182237be5627" + } + ], + [ + "eq", + { + "passthrough": "0b20000000c92d8d376272f6cefe2bf85898f6874bd3c2cd2c7bbfb888f837c140bc70c19c" + } + ], + [ + "ore", + { + "passthrough": "0b40000000bdcc3110154be791c3148934d9a7b2bb1082581099dcd46dd44719e6db2b192cb455bec8ee6c2632e0e1b1b322fe419ba72a4c34aec7a543fd93e67fd553f763" + } + ] + ] + } + ], + [ + "f64_ope", + { + "map": [ + [ + "ope", + { + "passthrough": "0b4100000000c8228ef43865b325619e4992b56db2acd73e6305a23db7b01c1087c865c6a921ff4b8439def81446aae4e1852ed4e38bbe194701b5d2924ac50c9407f3159a52" + } + ] + ] + } + ], + [ + "flag", + { + "map": [ + [ + "c", + { + "leaf": "01000000000000000000000000000000004605b532eae8f258aba3f0db9a8ce40420004ef9e59a45a7a49f59cb0bbe652830d03f17f32c5c1c3e990f2eac284b958dfd0234f50d751a900084e191ffdf722e577782f8e1165b9bc8ec195241a8e0" + } + ] + ] + } + ], + [ + "i128", + { + "map": [ + [ + "c", + { + "leaf": "0100000000000000000000000000000000e1dbb5de784a72133eeae10844badbdd2000f6ef24b94eb0c002c7aaf5cda2449b5bfaf0365eebb68a84901c0cd2996139f3021f2331a6b8b04b2dbe2c58b1a76933b058934eeb4fb69622663ce4df29982c86263554a7c9d490a1e767733254" + } + ], + [ + "eq", + { + "passthrough": "0b200000008d158b8a8353c00624d74d6fac10e1f7e37ff31772a0e73f2855fd0ce7a12379" + } + ], + [ + "ore", + { + "passthrough": "0b80000000515b9aa9f37d24e2f041da7e424739cc232b81f85e6c6ef07829cea2434ff599f0d83ba6cad9cd71909d8b6d5bbe3bfcb61a234edac0b41ff728e98e9ab633f1d6ccecf4aa5ab288e74eaddd2b899c8952a025f7097117654c3d0eadd7278f5bd770689692b810f1c0de8d2f7ad9def60dc124d78f5360ebd2aee7a028aa4c0d" + } + ] + ] + } + ], + [ + "i128_ope", + { + "map": [ + [ + "ope", + { + "passthrough": "0b81000000007f3e0dbb3cb4371fee47438dd52f3f96c5395a75a8c6f97500af1feae03fc587960db5137bc84733c3e26c6cece4572b5068ffbd237b7959edd8b1a7ca5d317ff1869f73b29e157eeb4a0e12cc20f148c2f0f9fd00c127fe6e392f047f0f4ae84d5f03c29340cce05cd83e9baa7b5e78d4e0933ab9c943ffe49d62d5e6ba8727" + } + ] + ] + } + ], + [ + "i16", + { + "map": [ + [ + "c", + { + "leaf": "0100000000000000000000000000000000483301aad7e1e7e66290533a1c25c4ba2000d705c4a354db0fca46ef9fbf25e70cb0ef24b4a14565985480b7f7e59499ff6e02b26f14da1ccbedbfc682fcc4e750545dca84dfc7651471368b23a21251c189" + } + ], + [ + "eq", + { + "passthrough": "0b20000000984372049503f0b4546828c16b52695c32f459342a618804fd552a1f0f5ec4c1" + } + ], + [ + "ore", + { + "passthrough": "0b10000000be1fd669d8a2cae089e62262c8f163f8" + } + ] + ] + } + ], + [ + "i16_ope", + { + "map": [ + [ + "ope", + { + "passthrough": "0b11000000003f039dde79c7dd4ccffd191d5544c2ed" + } + ] + ] + } + ], + [ + "i32", + { + "map": [ + [ + "c", + { + "leaf": "0100000000000000000000000000000000d91009af22793d9551d49ef1badaef2f2000ee573857f4ccb8044b99b4da2b7f98c04f32b7a85bf47c47b5705d1e4daaac22027f84526800032734fcfd183832a827c6d6caf483794cbda6c7c8ee8f7851986eec" + } + ], + [ + "eq", + { + "passthrough": "0b200000001047ac532cedfd8eda8997310a5b6b980f743cd13d88ae779ddca7a06039c8b7" + } + ], + [ + "ore", + { + "passthrough": "0b20000000f366ce2845fadc799d60dd73190baaa1e79444a558aeb2454490483c76cdfc01" + } + ] + ] + } + ], + [ + "i32_ope", + { + "map": [ + [ + "ope", + { + "passthrough": "0b2100000000c61f2fc35629dcad1b5b22bd86c54a908409b2921d7362d2fe21c2a93c604916" + } + ] + ] + } + ], + [ + "i64", + { + "map": [ + [ + "c", + { + "leaf": "0100000000000000000000000000000000529a5e10ff573937393d348810e2cf1f2000089f69cf1ac9014ec8f513c71d9d72351e0ea99a9c73f4a0a6c10c106641b69802b4345831eebef8e107fbfd5f0b5f324ae231aa7032eb54ad743d6cc97e4a3d12352b43c781" + } + ], + [ + "eq", + { + "passthrough": "0b2000000057b22ce89ff829ceb694379b51df3df4d2b12cb39cd48170c1267f4e574eb884" + } + ], + [ + "ore", + { + "passthrough": "0b4000000076f1db359db6b05234937ef37330e9b839c9b5653d16602b7871b1277981065ade1de6ee1ce10dd832f0affcd3b92ddaf75e1db9c619ee8cea18cd89425113a4" + } + ] + ] + } + ], + [ + "i64_ope", + { + "map": [ + [ + "ope", + { + "passthrough": "0b41000000006e4cb9aaf3e0ed8761ffd0b74ccf91aeabfccabc8f5fc8b4deb29d757dcaba7c063006eb92a5b572dc86349f270ab3e1d3f08bd4372d8660f37ea5725d7a159e" + } + ] + ] + } + ], + [ + "i8", + { + "map": [ + [ + "c", + { + "leaf": "0100000000000000000000000000000000ad9f25c744be196f3ae01569081dbe282000e7f7469682c691d7b5a2c4ad768578dd968a97912283b56b05c48a73e0ba06b3021ab0c39e32d92599264bfab4e367d563670721ed408e96458287398ccbc5" + } + ], + [ + "eq", + { + "passthrough": "0b200000009f80423babd798ac93d1f90db4c766dfbe9259da381a6e88fbdb441e42331603" + } + ] + ] + } + ], + [ + "id", + { + "map": [ + [ + "passthrough", + { + "passthrough": "062a000000" + } + ] + ] + } + ], + [ + "loose", + { + "map": [ + [ + "c", + { + "leaf": "0100000000000000000000000000000000f708dc5af80df2fbad3440966528918e200008d8e16872121d006b9473087d02871421b579fa419a2b4a0e4907423391b3d10246369b1103bfe702e1ecf7ff37454ebfa830575f81a747b79ded90a1a475caa60c6a7712ee420c510d696c5c1587e110e5" + } + ] + ] + } + ], + [ + "mail", + { + "map": [ + [ + "c", + { + "leaf": "0100000000000000000000000000000000e15beb74f27adb51c55f9dde82bd406220006c1dec7e1a8917b5afafa0f1b7c9cba5edd267e2e561a6eab24543a1bafe601902570499aaa09298cbc067c376240209b6ec5d7aaec91f1dc7de9da3d6d5f62626e834e458d4cdb79d9647251a" + } + ], + [ + "eq", + { + "passthrough": "0b20000000a8164e210028ce838803019c0bec2c5a8c4c8817d9916186308f6a45aa6fd10a" + } + ] + ] + } + ], + [ + "prefs", + { + "map": [ + [ + "c", + { + "map": [ + [ + "dark", + { + "leaf": "0100000000000000000000000000000000ad085b14c59fec78b887c47b18e497bf20007f09036cae4e9dce220def8b9465b0ba216b6ff453ce27de078213d1f144327f0236109e3480c2a5afac8b7c74d2d88839a7ec1eeef44abdf73615dde583" + } + ], + [ + "none", + { + "leaf": "01000000000000000000000000000000002a4f406333bb5a1fd2ebc102f20495812000640505064151c4edab754284343c126d7c0f75728b84516aa1cfc2b5fa7757da02edf4f9c3b6b8e03c4a7497b0f0d689553f5d38ada5e347d64a83bf4069" + } + ], + [ + "empty", + { + "empty_map": "0100000000000000000000000000000000a0b43a3c2b0ef2b9f0b1f7a3f1721f902000e5ca08421a3e281abc855cdc4f2a47022a407f9f62e5572c8db52d85577b776402caf39632a618b4aca38963a31763465a52328ce4c0b1bfaaed45b427" + } + ] + ] + } + ] + ] + } + ], + [ + "tags", + { + "map": [ + [ + "c", + { + "seq": [ + { + "leaf": "010000000000000000000000000000000054747df3875ec71acead1c5064d5f1a620002c064e9e638c8aa9119e06e60d21c9b6bbaa9715d4fc64531e5f7f77ef70d3ca0251073279bc66c152f833f249bf2e0b226e32d1a5582cfc89368ddc80760f" + }, + { + "leaf": "0100000000000000000000000000000000319ccdba22f993fe2cf4a18ac95e6fcc2000aab6e154f5a8aacd91d5803b0c21ef3697c6ee1875211012565c4bda8a86100c02202e2dbc1abf7b455506b7a867e591d7871efaab75c1840e51e02292d52441e0af" + }, + { + "empty_seq": "01000000000000000000000000000000006666f0cbde3e1d8cb835512a84424974200042baab7957532a89134d3b46638cf505e435878716032c621192524e1f16c40a02496ce9abb7197be2c570a0fc4e706433b306efaa1511e825b644ef62" + } + ] + } + ] + ] + } + ], + [ + "u128", + { + "map": [ + [ + "c", + { + "leaf": "010000000000000000000000000000000014b176af7497a164acb08d0de2b6c47120008bbc737ddfa763593ed6169920b3c72ab41f964ea135cd840a0c91cc84629ba502cabec91a1fc983f63919bbf17f61ec0a6ad0c88fcea8bd1a231caebfe90a39ba1137030a9614654ad5a7b83552" + } + ], + [ + "eq", + { + "passthrough": "0b200000007bebdb474e3b5cc433fd12484824ef8355ea7691c2d0774e4f8f8741d9872c8a" + } + ], + [ + "ore", + { + "passthrough": "0b800000008e3c2cd1cb101f207b6ff8e0c736294fd32c7c9d8a27532cb8629d31d923c9b04e43c711c3e6a7a25758e6a2e957743d407c29a0944421a3d9e259d0b180a019c008e9f339a6db877ba8245ea8f3964db0f4f866e8f19cc0d6351e772aebe54d2ab6fe33efd6f8a0655edc64f1d1c6263294bbb39e27fda896aa1c09273afa30" + } + ] + ] + } + ], + [ + "u128_ope", + { + "map": [ + [ + "ope", + { + "passthrough": "0b8100000000dc8f1d8a4159d905191e10403e38ba67be0dd69bc3f15471400e72115d4224f61674727ab8bac56ad6e99f309ba95f8886fa085f81e5647f2aeb5a5d2142fa087fee560c7d8df14bf85699eb34236cd8b2e6fc83f2ed7b6dd17f05978ad09bdeb6ccf1efc1afb975ccd49fa52b00b844bee0341b115f03b8d427cfe9399320b8" + } + ] + ] + } + ], + [ + "u16", + { + "map": [ + [ + "c", + { + "leaf": "0100000000000000000000000000000000c0429c8ac00db4302d312b97d30bac5a2000e90e576e4fd8622d4520d85a411fab48e4450db042a249555da2bc8a2933025002564b19ad245945c348225fbbdad92fc341dfbe9dd23f86bf6efa1e71af267b" + } + ], + [ + "eq", + { + "passthrough": "0b20000000cbb52cc6ecb7d3ae2fc331282698b70658ca801755e95ab0434301a07de01aaa" + } + ], + [ + "ore", + { + "passthrough": "0b10000000a082c2300d1f28ce56a8d1388100342a" + } + ] + ] + } + ], + [ + "u16_ope", + { + "map": [ + [ + "ope", + { + "passthrough": "0b1100000000fd45295f100d24e193e7c3b4a3afe6a4" + } + ] + ] + } + ], + [ + "u32", + { + "map": [ + [ + "c", + { + "leaf": "01000000000000000000000000000000009d1d0b3bf4ab44815e837f8a408fe36f2000743bd66c84518e5a96bcdb23f5018d5daed382faa234ab8fcaea70014ae24a1402f784be01dd08cb9d70e65ababba4c4fbad3d11274ed1c80ec1cf0511fafeaa807a" + } + ], + [ + "eq", + { + "passthrough": "0b20000000c6d2aa2a25d45c1de30c7d0318caa67bf572830a45e14c4580a52f086b893b5d" + } + ], + [ + "ore", + { + "passthrough": "0b20000000c3d8d9e15a3c67b2e7b050406e424c86c4427ddc55cd7e94beccf06d4e1aa3af" + } + ] + ] + } + ], + [ + "u32_ope", + { + "map": [ + [ + "ope", + { + "passthrough": "0b21000000013910babdb9df995bf6cd8b8c3809ff96c20ce7272170cbf4a2e6f192df48ae94" + } + ] + ] + } + ], + [ + "u64", + { + "map": [ + [ + "c", + { + "leaf": "010000000000000000000000000000000083447ad20c01ffa9af5bdc10f54f09d62000e44e3721877c8fae1f02f1ebc4ecb526dd7b45f2984ea4e0aa40aa8603f54e4802988687101da1bed56b9607bdab5896b39fa9040449e98868333a39ef34a05b4081943ab3ab" + } + ], + [ + "eq", + { + "passthrough": "0b20000000d0ccae86cb0ab69f5c21c8b94c7c12efca180d51a2f905a2098863bb013ef823" + } + ], + [ + "ore", + { + "passthrough": "0b4000000024581d4b396284a673cc04e73d565077e3f6a56e9c178e95fc41a8665e910c0a1ece9482a38b82beee4d17d8b82639cd68390dc14fc03900f57f47023ebcdb36" + } + ] + ] + } + ], + [ + "u64_ope", + { + "map": [ + [ + "ope", + { + "passthrough": "0b4100000000c65d9da62cb7b3a4841db8ff0fa6304ab8117e40683d26f02557379f122be04b674dafce8618496ee2fe39aa3b5d3ad12f1d8c2230d100078aa11defc16e0867" + } + ] + ] + } + ], + [ + "u8", + { + "map": [ + [ + "c", + { + "leaf": "010000000000000000000000000000000066b704200b197135a43b2c6327fd3cf92000cb70d7adaed3fd6e746e2e53ace43bc2d58d1a786c6ccc62fa0d5473900f020402a03836a94bc7911e4cbeab9a5d5885cc34bbdc85715ebb071c29f76b625a" + } + ], + [ + "eq", + { + "passthrough": "0b2000000079e2262e4913dcaecfb93743265ace2f57b8223c63d20e52d300c8a30ae80996" + } + ] + ] + } + ] + ] + } + }, + { + "about": "labels of three segments: the plan's context is the first two", + "expected_context": null, + "name": "three_segment_label", + "opened": "f10200000004000000626f64790a1c000000526576656e7565206772657720696e20657665727920726567696f6e050000007469746c650a10000000517561727465726c79207265706f7274", + "plan": { + "body": { + "context": [ + "documents", + "v2", + "body" + ], + "outputs": [ + "c", + "match" + ], + "type": "string" + }, + "title": { + "context": [ + "documents", + "v2", + "title" + ], + "outputs": [ + "c", + "eq" + ], + "type": "string" + } + }, + "source": "f102000000050000007469746c650a10000000517561727465726c79207265706f727404000000626f64790a1c000000526576656e7565206772657720696e20657665727920726567696f6e", + "stored": { + "map": [ + [ + "body", + { + "map": [ + [ + "c", + { + "leaf": "0100000000000000000000000000000000df5ce861175c26d1a3840b35964cd62d2000352e8e65fb5a068c417bb8d5ba287b7040b86babea7220fc36724c81b6452c7802671d3688c49d64ef9f0ee3b31beef34ef2fe2864e2dc769d5d85971b09c96311fb8693ba75aac9c64a4b8fe6c9bcc632e424d33f9398707855" + } + ], + [ + "match", + { + "passthrough": "0b8600000001000400080009000a000d000e000f001400180019001a001b001d001f0022002300240027002a002b0033003f00400041004400450046005c005e0062006400650068006f007a00820087008c00900095009d009f00a100a200a300aa00b400c100c800cd00ce00d300d400d500d800d900db00dd00e100e200ea00f100f200f900fc00fd00" + } + ] + ] + } + ], + [ + "title", + { + "map": [ + [ + "c", + { + "leaf": "010000000000000000000000000000000060c86f42fdfd81d3a998ecc5b2f788462000e25430a2c1e9d6dce08f6ead348be444a7ea2a6fe6e3da794469426c05967ef1023a21de1e1e7efe487a7646b576698378030778ccae92cad2b9d39b387417984d2b07ea5ea376bd84de5fbb94c6" + } + ], + [ + "eq", + { + "passthrough": "0b2000000086d52d9b48e11b1eab455fe23d5864b87f1e4fac8be97c666be2eb755cbd096b" + } + ] + ] + } + ] + ] + } + }, + { + "about": "every label extended by one integer part, as a tenant id", + "expected_context": null, + "name": "one_extension_part", + "opened": "f10200000003000000616765062200000005000000656d61696c0a110000006361726f6c406578616d706c652e636f6d", + "plan": { + "age": { + "context": [ + [ + "users", + "age" + ], + 7 + ], + "outputs": [ + "c", + "eq", + "ore" + ], + "type": "uint32" + }, + "email": { + "context": [ + [ + "users", + "email" + ], + 7 + ], + "outputs": [ + "c", + "eq", + "match" + ], + "type": "string" + } + }, + "source": "f10200000003000000616765062200000005000000656d61696c0a110000006361726f6c406578616d706c652e636f6d", + "stored": { + "map": [ + [ + "age", + { + "map": [ + [ + "c", + { + "leaf": "0100000000000000000000000000000000bacc393316ee6f4a4313df881ca7957d20007a15616d964666e09b6490ef7f6bac1b917e8e430664b14a9ccd53647bf8e97b0202d1ef3bb09976f41fe0f88011cada996c8a92a700a068af9399c4e84606beee1d" + } + ], + [ + "eq", + { + "passthrough": "0b2000000002888fdba7c9f668583e99961d61818d41c2a0d38f91646971848763240f3178" + } + ], + [ + "ore", + { + "passthrough": "0b200000003b66bacffee6b5c0633c4623c3845f7344545bb4c7d02ecaa5bcd9b5f87eca41" + } + ] + ] + } + ], + [ + "email", + { + "map": [ + [ + "c", + { + "leaf": "0100000000000000000000000000000000805416a0774309e4db705ad69bf3aea72000d659507d5135932e3b17919daf820631fe078dd7d96bfcc2846ebc5c296c250e029edb0f38f0764959e99c34e5d9f517676a5a1c89a5b1fbf391e2f1124af661bfdeabfd7fe1048b422b76863b11a0" + } + ], + [ + "eq", + { + "passthrough": "0b2000000083ae446cefcfaa136a0a2178af152e7e5a6e8ef92346002a1a11e49dcd4bd464" + } + ], + [ + "match", + { + "passthrough": "0b520000000800090018001d0023002600280030003200370041005000520053005a006b0071007700780079007e008100830087009d009e00ac00bb00c000c200c700ce00d000de00e900ed00f400f700f900fd00ff00" + } + ] + ] + } + ] + ] + } + }, + { + "about": "every label extended by an integer part and then a text part", + "expected_context": null, + "name": "two_extension_parts", + "opened": "f10200000003000000616765062300000005000000656d61696c0a1000000064617665406578616d706c652e636f6d", + "plan": { + "age": { + "context": [ + [ + [ + "users", + "age" + ], + 7 + ], + "eu" + ], + "outputs": [ + "c", + "eq", + "ore" + ], + "type": "uint32" + }, + "email": { + "context": [ + [ + [ + "users", + "email" + ], + 7 + ], + "eu" + ], + "outputs": [ + "c", + "eq", + "match" + ], + "type": "string" + } + }, + "source": "f10200000003000000616765062300000005000000656d61696c0a1000000064617665406578616d706c652e636f6d", + "stored": { + "map": [ + [ + "age", + { + "map": [ + [ + "c", + { + "leaf": "01000000000000000000000000000000009b1bb6fea8f3c34326fe40d7c33d4c2b20001c2e8428ddff1daac744fd6419cd1a2bcffa4c472e8f6c3398aa04b593676a1f022273df865bcaaf92a4a0fc91a4b56e3368155a29ed0d12b0df7e6842295106d857" + } + ], + [ + "eq", + { + "passthrough": "0b20000000a3085719672fccd9837b4a18ba6489f45d5e83b3eb6cf55b1bce2ccd045c5889" + } + ], + [ + "ore", + { + "passthrough": "0b2000000031a055cf0ff7e82d73fc9711b26536ea18f8ea4be2328cd0c3b17c94b3d39c9d" + } + ] + ] + } + ], + [ + "email", + { + "map": [ + [ + "c", + { + "leaf": "0100000000000000000000000000000000570015495a46ec318f476aaa64c4a68d2000da5b9ea16f7bc1a3637eef1ae1fa9742ff3a5efb3696e820aee2a6eb11ce7c9e02d050cf70e46d9397123803d70b483cf5ef5441af85872e67c0c7d2cf2ba1a1dc585e555865885f0e34507c499d" + } + ], + [ + "eq", + { + "passthrough": "0b2000000042235d3e754699bafe868e3ab8d896cd3763179306f291f0c2fe74cc100fe124" + } + ], + [ + "match", + { + "passthrough": "0b500000000200040009000f001100120015001b001d0020002d0043004c00520069006e007100770085008c0098009a009b009e00a000b300b600b700be00c600d000d200d900e300e800ec00ee00f200fa00fb00" + } + ] + ] + } + ] + ] + } + }, + { + "about": "a plan whose context is the record's tenant field, opened expecting that tenant", + "expected_context": "tenants/acme", + "name": "context_field", + "opened": "f10300000003000000616765062900000005000000656d61696c0a110000006572696e4061636d652e6578616d706c650600000074656e616e740a0c00000074656e616e74732f61636d65", + "plan": { + "age": { + "context": [ + "age" + ], + "outputs": [ + "c", + "ore" + ], + "type": "uint32" + }, + "context_field": "tenant", + "email": { + "context": [ + "email" + ], + "outputs": [ + "c", + "eq" + ], + "type": "string" + }, + "tenant": { + "context": [ + "tenant" + ], + "outputs": [ + "passthrough" + ], + "type": "string" + } + }, + "source": "f1030000000600000074656e616e740a0c00000074656e616e74732f61636d6505000000656d61696c0a110000006572696e4061636d652e6578616d706c65030000006167650629000000", + "stored": { + "map": [ + [ + "age", + { + "map": [ + [ + "c", + { + "leaf": "01000000000000000000000000000000005596fbd530e431a317215ab4256e7cb2200052f797516a56e11e4ba5828836073ba2cc42d73bb27b382aaff298bcda54c09e028023da0b2b1d6bdece1a3b521b0a233f6c00cfeffbe0a68439d80d4a684053136c" + } + ], + [ + "ore", + { + "passthrough": "0b2000000056a202f641a9a81c5f9c179ae587fa6fb846342ba97fe605bc3bb4d55068e23f" + } + ] + ] + } + ], + [ + "email", + { + "map": [ + [ + "c", + { + "leaf": "01000000000000000000000000000000001b7a04c4d1944c876a49cda36eb46407200022f464f89fb798f460c522e7ab9b96f3a7a2630e68a622295c0582037732981402b636714ff3657091402abab0d3088aa5d036679175993ba5d2c0affa47f8bab1b0f249d6b7376a72ce0f5c31db05" + } + ], + [ + "eq", + { + "passthrough": "0b20000000d552a6cdd50766be616327a2f3a501f93db67255f367dc8200f7bf3ad5a2b620" + } + ] + ] + } + ], + [ + "tenant", + { + "map": [ + [ + "passthrough", + { + "passthrough": "0a0c00000074656e616e74732f61636d65" + } + ] + ] + } + ] + ] + } + }, + { + "about": "a batch of two records under one plan", + "expected_context": null, + "name": "batch", + "opened": "f002000000f10200000003000000616765061d00000005000000656d61696c0a110000006672616e6b406578616d706c652e636f6df10200000003000000616765063400000005000000656d61696c0a110000006772616365406578616d706c652e636f6d", + "plan": { + "age": { + "context": [ + "users", + "age" + ], + "outputs": [ + "c", + "eq", + "ore" + ], + "type": "uint32" + }, + "email": { + "context": [ + "users", + "email" + ], + "outputs": [ + "c", + "eq", + "match" + ], + "type": "string" + } + }, + "source": "f002000000f10200000003000000616765061d00000005000000656d61696c0a110000006672616e6b406578616d706c652e636f6df10200000003000000616765063400000005000000656d61696c0a110000006772616365406578616d706c652e636f6d", + "stored": { + "seq": [ + { + "map": [ + [ + "age", + { + "map": [ + [ + "c", + { + "leaf": "01000000000000000000000000000000003c0ddbde23c4f33454cc9a55bd61db232000cf115c46a206edce16a2390801360e94ee17c7115b52f95d90a751b19fd121b402ee823b279fa85feba54c2ea43ff80c18b5cf9e9d21c1a89448d14bbb923c68280e" + } + ], + [ + "eq", + { + "passthrough": "0b200000002067ce1340b5e588ae7537f6f10c8b8ee03e6ecc6a57e3ec7a1de29df43961a9" + } + ], + [ + "ore", + { + "passthrough": "0b20000000758821c792265d942f89fa1dad016fb71b326f756e62950367e5d060dcbc3be9" + } + ] + ] + } + ], + [ + "email", + { + "map": [ + [ + "c", + { + "leaf": "01000000000000000000000000000000001bf8c14cab97f3d7043f1906c14f75242000c0dd8d747502d288bec2d32887f05ccb0117cd5c4f23cd26aabf8a4205885b1c0288eec7c934dbeb5d68b636bcc0db3e07cfd93e4178ff1cd7998b2000c7de141e6ac16158da60ce0aa89948511041" + } + ], + [ + "eq", + { + "passthrough": "0b20000000c29174d85a22f6803289f6e7d4f220622d8289d9c9341a4bc24723cd9cecdaa5" + } + ], + [ + "match", + { + "passthrough": "0b50000000030005000900100012001a001c001d001e002a002e00300034003a003c0056006d00710074007500780092009300a800b200b400b700ba00c200c400c500d400d500dc00dd00e500ea00ef00f900fe00" + } + ] + ] + } + ] + ] + }, + { + "map": [ + [ + "age", + { + "map": [ + [ + "c", + { + "leaf": "01000000000000000000000000000000009d53c5cb4855ccf2194410562617ee242000d847ad7bbcfd3c4beec642cb02f9808fac5e4b3a61cfb42ca2b26bdeab53cc15028eb9c8eb97c38a17aa86e36d2c103bedaba851960ee44ae376d2c5e874a2f3031f" + } + ], + [ + "eq", + { + "passthrough": "0b2000000005a6a623cecc71cd02cb87cc030e7ac25350560d952293b661a7c73b6c9f278d" + } + ], + [ + "ore", + { + "passthrough": "0b20000000758821c792265d942f89fa1dad016fb71b326f756e62950367e5d130a8115eff" + } + ] + ] + } + ], + [ + "email", + { + "map": [ + [ + "c", + { + "leaf": "0100000000000000000000000000000000505d24e7d427a40c371cec2adc951b552000141097316fb808ff63d1d544d905b8223a0084ef239339c9a3e04f6445ab7710027d42030efb6658cb5c5be956b72572328c1d3ecb454f86d47adaa8f73408efdce743296cf6828b4536865b72272a" + } + ], + [ + "eq", + { + "passthrough": "0b200000008f69a9f61ba7b854d6cf4bc9df305d12be9f50b65732b0369068045125ca4602" + } + ], + [ + "match", + { + "passthrough": "0b50000000030005000900100012001a001c00220024002a002e003000310034003d004b00550058006d00710075008f0092009700a400a500a800b200b400b700ba00c200c500db00dc00e400e500ea00f900fe00" + } + ] + ] + } + ] + ] + } + ] + } + } + ], + "key_source": { + "kind": "deterministic-sha256", + "seed": "737461636b2d656e63727970742073746f72656420726f777320763120202020" + }, + "keyset_id": "00000000-0000-0000-0000-000000000000" +} diff --git a/packages/stack-encrypt/tests/fixtures/value_kinds.json b/packages/stack-encrypt/tests/fixtures/value_kinds.json new file mode 100644 index 000000000..fc98e70b6 --- /dev/null +++ b/packages/stack-encrypt/tests/fixtures/value_kinds.json @@ -0,0 +1,227 @@ +{ + "_comment": "One field of each value kind added in #1144, sealed by the data-plan lowering under a deterministic key source, with each value's transport frame and the equality queries vitaminc-normalize folds onto a stored term. Read by tests/value_kinds.rs and the Go SDK's encrypt tests; the schema is in README.md beside this file. Regenerate with STACK_ENCRYPT_UPDATE_FIXTURES=1; do not edit by hand.", + "key_source": { + "kind": "deterministic-sha256", + "seed": "737461636b2d656e63727970742076616c7565206b696e647320763120202020" + }, + "keyset_id": "00000000-0000-0000-0000-000000000000", + "plan": { + "amount": { + "context": [ + "value_kinds", + "amount" + ], + "outputs": [ + "c", + "eq" + ], + "type": "decimal" + }, + "at": { + "context": [ + "value_kinds", + "at" + ], + "outputs": [ + "c", + "eq" + ], + "type": "timestamp" + }, + "date": { + "context": [ + "value_kinds", + "date" + ], + "outputs": [ + "c", + "eq" + ], + "type": "date" + }, + "i128": { + "context": [ + "value_kinds", + "i128" + ], + "outputs": [ + "c", + "eq", + "ore" + ], + "type": "int128" + }, + "i16": { + "context": [ + "value_kinds", + "i16" + ], + "outputs": [ + "c", + "eq", + "ore" + ], + "type": "int16" + }, + "i8": { + "context": [ + "value_kinds", + "i8" + ], + "outputs": [ + "c", + "eq" + ], + "type": "int8" + }, + "u128": { + "context": [ + "value_kinds", + "u128" + ], + "outputs": [ + "c", + "eq", + "ope" + ], + "type": "uint128" + }, + "u16": { + "context": [ + "value_kinds", + "u16" + ], + "outputs": [ + "c", + "eq", + "ope" + ], + "type": "uint16" + }, + "u8": { + "context": [ + "value_kinds", + "u8" + ], + "outputs": [ + "c", + "eq" + ], + "type": "uint8" + } + }, + "queries": [ + { + "field": "amount", + "frame": "140000028040e201000000000000000000", + "operator": "eq", + "term": "93a9395ae5d9581921a3fc2cdd9e0f3cc731d37e8f39f516f3dc3e3a6f0e8514", + "text": "-1234.56" + }, + { + "field": "at", + "frame": "130bc9d26a0000000000ca5b07", + "operator": "eq", + "term": "448bc4271a535ec475e50404c800746fb71cbac46567396bc0873546e5498f4a", + "text": "2026-10-17T01:02:03.123456Z" + } + ], + "record": { + "amount": { + "c": "01000000000000000000000000000000007a4428d606d70760a6ab09137b7998952000aa5c98df7b5db708dec28195dbfa196953ce941a9404e7c315e14856139917c702fa91de3a39604b362861966bda65a4e16e141bc7046d59627ff4f9e9c24114cca0afcf08713a2d350e1c06ebf6", + "eq": "93a9395ae5d9581921a3fc2cdd9e0f3cc731d37e8f39f516f3dc3e3a6f0e8514" + }, + "at": { + "c": "01000000000000000000000000000000003df5051c44f189118ff062fc589189362000c144eccd9336ad2098131bc1ccebd36780eafd132f5d9a7900964b441fbedd240238762eca5b766e057a875482b286a420c4df7d043545869c76ca56f829638f723e412b58915cb8a63e", + "eq": "448bc4271a535ec475e50404c800746fb71cbac46567396bc0873546e5498f4a" + }, + "date": { + "c": "010000000000000000000000000000000081a52593eddb4ccba009332c41f7173d200048bbb91aa1c0c890d54de6fcd6b404e91d6a8272390ab807c78820543d49ef86025f781af6120f255debe98eaf4c53b4d5915d3702e8b97562b5e3f10ee2fea810ff", + "eq": "03226ad4425267b31f8316c513d7155cfc2fd33bbf8992d14ea26cfc64311481" + }, + "i128": { + "c": "0100000000000000000000000000000000f5bdd6ce34bc69330093fa760c6f6d8120001a9f80b14abd281d94e5139ba66a8744314abdde415fa182d4ad961c4dbf1dc002a391e960daff92e0968960819cd41c2f8ef67887f8395e3d0aae1e968d74bf8af5c7e092e7461e332b019c8eed", + "eq": "19fb32f017fe269cb2703fe732acd8c1673e49174e5492ea8c372c487d08ce2f", + "ore": "eed82f673c37aac97130e682bffa8fedda8f50a6adbaaf22b995fe84050870ce82de1dc185d9280cab61088b382a6d297ace288376e87b222ba9580bc9235643c35333131a01da66205fc770bbfa5fd84171034d75c4952231c1652cd0b8545c80a55907f2813cf4330528bca3cca7efce20ebe69eec29ec5bf6439c236d69c8" + }, + "i16": { + "c": "0100000000000000000000000000000000b1739f40d4486c2af05aac240fae06e72000a9313873aaecad5b7a40ed810a0dd870304d8fb8d4ea88949606dce6384dbb660293761ddd2d762e68068488cec8f049f106623550927d770552f9a2c3610508", + "eq": "b902e228c35b328eef12f0b8df397d48ee63b81e944e3dfb0855b6006426e012", + "ore": "83bcefa8b71d264f84ac4f346c9427ae" + }, + "i8": { + "c": "01000000000000000000000000000000005151a6cfdd1a51bf3a1ea0e85de41428200008a7fb000a5365b240cb064def02dedb57434897a756ae6216259ae26419f45d02da466dd320e4afd377fc28edda0282feb6be40f896dbd6334bcb881925d0", + "eq": "15e37adf2fa39067953df8988ef98fb5ca354599495b23230133d525e62e6768" + }, + "u128": { + "c": "010000000000000000000000000000000095b0c11aba5068ed6e8b76bcf85967a92000b74f8acb3cdefa94b9fdea95725157aad875dfdb1f567c293638e84dc7872c42022d2c6fa96ddcaa15ec1b96f7e23807d47595491c0bb036791048ec4eb99fe41a7c7958b707ed9c284896af5e82", + "eq": "761458346368c5f42c19a00ec9d8849021dfb28d6d6768c75d4290fef986bb9f", + "ope": "00deb76379b2d69b53e21b4468419eec6f1fd3a6338232d3f8acfb94779c95e9751d084cc759f92744b2389e1fc60b93ab3566bf061a00a9dd103329c5ad003628129935ab04d1b586ec506e986f4529f2b33f339b22aa8355971814735f9ebd6d48965546739e193cdfd5b0c6d0f550049f552698b39bbea76fc03527d775a28e" + }, + "u16": { + "c": "0100000000000000000000000000000000c40545f440c7f3e3f81f3fa4bbdc13152000c1aa04095f495b7cf8e1022d2e73a5d653616c157249914dc212e5c2c9eed16402aed0aa5806118a7ab9278e6e621f621b8daf665c3f97cc112a6a97c8d234e1", + "eq": "f9ec131d5dcf5739ac3a928108e1b50fc51e9f87bcd92f9e6e052b19b5f6b86d", + "ope": "008dd5395c0f5a63bc69d2c01d8ea32e3a" + }, + "u8": { + "c": "0100000000000000000000000000000000bf3b588776242c390761ddd7097e0ae22000fd2f9eb1bb2712deff3805ba2af81cb31ea5c1fc8ef8e0f058c256e3b170e5d302af00af685f24c50ef4e7df040a92e4aa5d5093567923e759dce513e57116", + "eq": "ce2278b04c84191451e85ffcbe67f1e7c8585f86583cdbcef68d2dd466fa7b0e" + } + }, + "values": [ + { + "field": "i8", + "frame": "0cf8", + "text": "-8", + "type": "int8" + }, + { + "field": "i16", + "frame": "0ed4fe", + "text": "-300", + "type": "int16" + }, + { + "field": "u8", + "frame": "0dc8", + "text": "200", + "type": "uint8" + }, + { + "field": "u16", + "frame": "0f60ea", + "text": "60000", + "type": "uint16" + }, + { + "field": "i128", + "frame": "1000000000000000000000000000000080", + "text": "-170141183460469231731687303715884105728", + "type": "int128" + }, + { + "field": "u128", + "frame": "11ffffffffffffffffffffffffffffffff", + "text": "340282366920938463463374607431768211455", + "type": "uint128" + }, + { + "field": "date", + "frame": "1281460b00", + "text": "2024-02-29", + "type": "date" + }, + { + "field": "at", + "frame": "130bc9d26a0000000015cd5b07", + "text": "2026-10-17T01:02:03.123456789Z", + "type": "timestamp" + }, + { + "field": "amount", + "frame": "14000004800061bc000000000000000000", + "text": "-1234.5600", + "type": "decimal" + } + ] +} diff --git a/packages/stack-encrypt/tests/frozen_bytes.rs b/packages/stack-encrypt/tests/frozen_bytes.rs index f930043a0..12c629c1e 100644 --- a/packages/stack-encrypt/tests/frozen_bytes.rs +++ b/packages/stack-encrypt/tests/frozen_bytes.rs @@ -378,7 +378,7 @@ async fn match_term_bytes_are_pinned() { let bytes = term.to_bytes(); assert_eq!( hex(&bytes), - "040005000a000d000e001e002700350038003d0055005e005f0064006f007d007f009c00ad00bc00bd00ca00d000e000e500ef00" + "06000f001c0028003300360037003d0040005c0073009400970099009b00a100a300ac00b100b300ba00bb00c500d800f600fb00fe00" ); assert_eq!( MatchTerms::::from_bytes(&bytes).expect("decode match term"), @@ -470,7 +470,7 @@ async fn ore_term_encoding_is_the_raw_cllw_bytes() { // differ (see the `sem` module docs). assert_eq!( hex(term.as_bytes()), - "1ae5f8558dc2d7dddd6c5b714e9d285586a1b8390d9140421e78906cba1bd651" + "b8291f846d8028ad4e3a67ef95e541ca3c6d1a2b145f49af3135876ae75c5d7b" ); assert_eq!(term.to_bytes(), term.as_bytes()); assert_eq!(term.as_ref(), term.as_bytes()); @@ -496,7 +496,7 @@ async fn ope_term_encoding_is_the_raw_cllw_bytes() { assert_eq!( hex(term.as_bytes()), - "00837615a1ea2fdcbebf7efe34cf4d2ee432c7eeff84fbd72e1bf05efa2338033c" + "00d7a25b801c909f3cb9d177315ba4da7802b9e62eba8c07aab2ad9d64e1a0cfa7" ); assert_eq!( OpeTerm::::from_bytes(term.as_bytes()).expect("decode ope term"), @@ -510,7 +510,10 @@ async fn ope_term_encoding_is_the_raw_cllw_bytes() { #[test] fn ore_term_from_bytes_rejects_wrong_length() { - // u32 → OreCllw8V1<32>: exactly 32 bytes. + // Every order term is cllw-ore's variable-length ciphertext: ORE is + // one byte per plaintext bit (a multiple of 8, a u32's 32 here), OPE + // that plus a leading carry byte. The length checks are structural: + // the type parameter names the source, and nothing in the bytes does. assert_eq!( OreTerm::::from_bytes(&[0u8; 31]), Err(TermBytesError::MalformedCllwCiphertext(31)) @@ -519,7 +522,6 @@ fn ore_term_from_bytes_rejects_wrong_length() { OreTerm::::from_bytes(&[0u8; 33]), Err(TermBytesError::MalformedCllwCiphertext(33)) ); - // u32 → OpeCllw8V1<33>: exactly 33 bytes. assert_eq!( OpeTerm::::from_bytes(&[0u8; 32]), Err(TermBytesError::MalformedCllwCiphertext(32)) @@ -528,9 +530,9 @@ fn ore_term_from_bytes_rejects_wrong_length() { #[tokio::test] async fn variable_length_ore_and_ope_terms_decode() { - // String sources produce variable-length CLLW ciphertexts (8 bytes per - // plaintext byte; OPE adds a leading carry byte) — their decode path is - // the length-validating TryFrom in cllw-ore. + // Text is encoded behind cllw-ore's one marker byte, so `alice` is six + // plaintext bytes: 48 ORE bytes, and 49 for OPE with its leading carry + // byte. The decode path is the length-validating TryFrom in cllw-ore. let cipher = cipher().await; let keyset = cipher.default_keyset(); let ore: OreTerm = "alice" @@ -538,14 +540,14 @@ async fn variable_length_ore_and_ope_terms_decode() { .encrypt_into_with_context(&keyset, nonempty!("users/name")) .await .expect("ore term"); - assert_eq!(ore.as_bytes().len(), 5 * 8); + assert_eq!(ore.as_bytes().len(), 6 * 8); assert_eq!( OreTerm::::from_bytes(ore.as_bytes()).expect("decode"), ore ); assert_eq!( OreTerm::::from_bytes(&ore.as_bytes()[1..]), - Err(TermBytesError::MalformedCllwCiphertext(5 * 8 - 1)) + Err(TermBytesError::MalformedCllwCiphertext(6 * 8 - 1)) ); let ope: OpeTerm = "alice" @@ -553,13 +555,13 @@ async fn variable_length_ore_and_ope_terms_decode() { .encrypt_into_with_context(&keyset, nonempty!("users/name")) .await .expect("ope term"); - assert_eq!(ope.as_bytes().len(), 5 * 8 + 1); + assert_eq!(ope.as_bytes().len(), 6 * 8 + 1); assert_eq!( OpeTerm::::from_bytes(ope.as_bytes()).expect("decode"), ope ); assert_eq!( OpeTerm::::from_bytes(&ope.as_bytes()[1..]), - Err(TermBytesError::MalformedCllwCiphertext(5 * 8)) + Err(TermBytesError::MalformedCllwCiphertext(6 * 8)) ); } diff --git a/packages/stack-encrypt/tests/heap_hygiene.rs b/packages/stack-encrypt/tests/heap_hygiene.rs new file mode 100644 index 000000000..0908d3b25 --- /dev/null +++ b/packages/stack-encrypt/tests/heap_hygiene.rs @@ -0,0 +1,333 @@ +//! No heap block the dynamic paths free still holds plaintext. +//! +//! This binary installs its own global allocator: a spy that, while a test +//! watches its own thread, scans every block freed on that thread for a +//! marker the test's plaintext carries. A block freed with the marker still +//! in it is plaintext a later allocation can read back, and fails the test. +//! It is the guard for heap residue: the Go SDK's residency test reads the +//! guest's linear memory after the fact, where allocator metadata and reuse +//! have already overwritten most freed chunks, so it cannot see one. +//! +//! One free is excluded by name: vitaminc-encrypt 0.6.0's aws-lc backend +//! (`backend::aws_lc::CipherKey::seal`, native builds only) frees an unwiped +//! plaintext buffer on every seal. That is vitaminc's to fix, not this +//! crate's; the spy reports how many it skipped, and recognises them by +//! their backtrace, so a build without symbols fails rather than passes. +//! +//! Unix only: the spy scans a freed block with libc's `memmem`, not as a +//! Rust slice (see [`holds_mark`]). +#![cfg(all(feature = "dynamic", unix))] + +mod common; + +use std::alloc::{GlobalAlloc, Layout, System}; +use std::cell::Cell; +use std::ffi::c_void; +use std::sync::Mutex; + +use common::frames::{frame, object}; +use stack_encrypt::dynamic::{query_term, record, verify, NoTargets, OpSpec, Scope, ValueFrame}; +use stack_encrypt::nonempty; +use vitaminc_aead::plaintext::{Physical, Raw}; +use vitaminc_aead::Frame; + +/// What every plaintext under test carries. +const MARK: &[u8] = b"zq-heap-marker-7f3a9c"; + +thread_local! { + static WATCHING: Cell = const { Cell::new(false) }; + static BUSY: Cell = const { Cell::new(false) }; +} + +/// Held for the whole of a watch: the test harness runs tests on several +/// threads, and the findings below are one set. +static GATE: Mutex<()> = Mutex::new(()); + +/// The marked frees seen, as backtraces; and how many were vitaminc's. +static FOUND: Mutex> = Mutex::new(Vec::new()); +static UPSTREAM: Mutex = Mutex::new(0); + +/// The vitaminc frame whose free is excluded (see the module docs). +const UPSTREAM_SEAL: &str = "vitaminc_encrypt::backend::aws_lc::CipherKey::seal"; + +/// Whether the `len` bytes at `ptr` hold [`MARK`]. A freed block can hold +/// bytes Rust never initialised (a `Vec`'s spare capacity, a struct's +/// padding), and reading those through a `&[u8]` is undefined behaviour, so +/// the scan is libc's `memmem`, which reads the block as plain memory. +/// +/// # Safety +/// +/// `ptr` must point to `len` allocated bytes. +unsafe fn holds_mark(ptr: *const u8, len: usize) -> bool { + extern "C" { + fn memmem( + haystack: *const c_void, + haystack_len: usize, + needle: *const c_void, + needle_len: usize, + ) -> *mut c_void; + } + !memmem(ptr.cast(), len, MARK.as_ptr().cast(), MARK.len()).is_null() +} + +struct Spy; + +unsafe impl GlobalAlloc for Spy { + unsafe fn alloc(&self, layout: Layout) -> *mut u8 { + System.alloc(layout) + } + + unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { + let watching = WATCHING.with(Cell::get) && !BUSY.with(Cell::get); + if watching { + // SAFETY: `ptr` is a live block of `layout.size()` bytes until + // the `System.dealloc` below. + if holds_mark(ptr, layout.size()) { + BUSY.with(|busy| busy.set(true)); + let trace = std::backtrace::Backtrace::force_capture().to_string(); + // Symbol demangling differs by platform: Linux writes + // `<…::CipherKey>::seal`, macOS `…::CipherKey::seal`. Match + // with the angle brackets dropped. + if trace.replace(['<', '>'], "").contains(UPSTREAM_SEAL) { + *UPSTREAM.lock().unwrap() += 1; + } else { + FOUND + .lock() + .unwrap() + .push(format!("{} bytes freed unwiped:\n{trace}", layout.size())); + } + BUSY.with(|busy| busy.set(false)); + } + } + System.dealloc(ptr, layout) + } +} + +#[global_allocator] +static SPY: Spy = Spy; + +/// Run `f` with this thread watched, and fail if any block it freed held +/// the marker. +fn watched(what: &str, f: impl FnOnce() -> T) -> T { + let _gate = GATE.lock().unwrap_or_else(|poisoned| poisoned.into_inner()); + FOUND.lock().unwrap().clear(); + *UPSTREAM.lock().unwrap() = 0; + WATCHING.with(|on| on.set(true)); + let out = f(); + WATCHING.with(|on| on.set(false)); + let found = std::mem::take(&mut *FOUND.lock().unwrap()); + let upstream = std::mem::take(&mut *UPSTREAM.lock().unwrap()); + if upstream > 0 { + eprintln!("{what}: skipped {upstream} unwiped frees in vitaminc's aws-lc seal"); + } + assert!( + found.is_empty(), + "{what}: {} heap blocks were freed with plaintext in them:\n{}", + found.len(), + found.join("\n---\n") + ); + out +} + +fn marked(tail: &str) -> String { + format!("{}-{tail}", std::str::from_utf8(MARK).unwrap()) +} + +fn null() -> ValueFrame { + frame(Raw(None, Physical::Null)) +} + +fn spec<'a>(field: &'a str, outputs: &[&str], ty: Option<&str>) -> (&'a str, ValueFrame) { + let mut entries = vec![ + ("context", frame(vec!["users", field])), + ("outputs", frame(outputs.to_vec())), + ]; + if let Some(ty) = ty { + entries.push(("type", frame(ty))); + } + (field, object(entries)) +} + +fn plan() -> record::Plan { + record::plan( + object(vec![ + spec("email", &["c", "eq", "match", "ore"], Some("string")), + spec("doc", &["c"], None), + spec("id", &["passthrough"], None), + ]) + .risky_ref(), + ) + .unwrap() +} + +/// A row with a marked scalar field, a marked nested object field, and a +/// passthrough, as its frame. The strings it is built from are dropped +/// before anything is watched: they are the test's input, not the engine's. +/// +/// The nested object ends with a value of several KiB after its marked +/// children, so the buffer its frame is joined into grows while it already +/// holds plaintext. +fn row() -> ValueFrame { + object(vec![ + ("email", frame(marked("email"))), + ( + "doc", + object(vec![ + ("k", frame(marked("doc"))), + ("n", frame(vec![frame(marked("nested")), null()])), + ("big", frame("x".repeat(8 * 1024))), + ]), + ), + ("id", frame(7u64)), + ]) +} + +fn runtime() -> tokio::runtime::Runtime { + tokio::runtime::Builder::new_current_thread() + .build() + .unwrap() +} + +#[test] +fn a_record_encrypted_from_a_value_frame_leaves_no_plaintext_on_the_heap() { + let rt = runtime(); + let cipher = rt.block_on(common::stack_cipher()); + let keyset = cipher.default_keyset(); + let plan = plan(); + let source = row(); + watched("record::encrypt (ValueFrame)", || { + rt.block_on(async { + record::encrypt(&keyset, &source, &plan) + .unwrap() + .await + .unwrap() + }); + drop(source); + }); +} + +#[test] +fn a_record_encrypted_from_a_raw_frame_leaves_no_plaintext_on_the_heap() { + let rt = runtime(); + let cipher = rt.block_on(common::stack_cipher()); + let keyset = cipher.default_keyset(); + let plan = plan(); + let source = row(); + watched("record::encrypt (Frame)", || { + let frame = Frame::parse(source.risky_ref()).unwrap(); + rt.block_on(async { + record::encrypt(&keyset, frame, &plan) + .unwrap() + .await + .unwrap() + }); + drop(source); + }); +} + +#[test] +fn a_record_decrypted_with_a_nested_field_leaves_no_plaintext_on_the_heap() { + let rt = runtime(); + let cipher = rt.block_on(common::stack_cipher()); + let keyset = cipher.default_keyset(); + let plan = plan(); + let sealed = rt.block_on(async { + record::encrypt(&keyset, row(), &plan) + .unwrap() + .await + .unwrap() + }); + watched("record::decrypt", || { + let opened = rt.block_on(async { + record::decrypt(Scope::Client(&cipher), sealed, &plan, None) + .unwrap() + .await + .unwrap() + }); + // The opened record holds the plaintext until here, in `Protected`. + assert!(opened + .risky_ref() + .windows(MARK.len()) + .any(|window| window == MARK)); + drop(opened); + }); +} + +#[test] +fn a_query_term_leaves_no_plaintext_on_the_heap() { + let rt = runtime(); + let cipher = rt.block_on(common::stack_cipher()); + let keyset = cipher.default_keyset(); + let plan = plan(); + // The order operators answer over integers alone, which carry no + // marker; equality and match read text. + for operator in [OpSpec::Eq, OpSpec::Matches] { + let query = frame(marked("query")); + watched(&format!("query_term ({operator:?})"), || { + rt.block_on(async { + query_term(&keyset, &plan, "email", operator, &query, &NoTargets) + .unwrap() + .await + .unwrap() + }); + drop(query); + }); + } +} + +/// An order term takes its plaintext by value, so the engine owns the +/// `String` or `Vec` it is handed (a clone of the caller's, on the +/// target path) and must wipe it. Both paths hand a bare one; the engine +/// wraps it in `Zeroizing` on receipt, before anything can fail. +#[test] +fn an_order_term_of_owned_text_or_bytes_leaves_no_plaintext_on_the_heap() { + let rt = runtime(); + let cipher = rt.block_on(common::stack_cipher()); + let keyset = cipher.default_keyset(); + // Each plaintext is built before its watch: building one can free a + // partly written copy, which is the test's own residue, not the term's. + let text = marked("order"); + watched("ore_term (String)", || { + rt.block_on(async { keyset.ore_term(text, nonempty!("users/surname")).await }) + .unwrap(); + }); + let text = marked("order"); + watched("ope_term (String)", || { + rt.block_on(async { keyset.ope_term(text, nonempty!("users/surname")).await }) + .unwrap(); + }); + let bytes = marked("order").into_bytes(); + watched("ore_term (Vec)", || { + rt.block_on(async { keyset.ore_term(bytes, nonempty!("users/blob")).await }) + .unwrap(); + }); + let bytes = marked("order").into_bytes(); + watched("ope_term (Vec)", || { + rt.block_on(async { keyset.ope_term(bytes, nonempty!("users/blob")).await }) + .unwrap(); + }); +} + +#[test] +fn verify_leaves_no_plaintext_on_the_heap() { + let plan = plan(); + let query = frame(marked("query")); + let page = frame(vec![frame(marked("page")), null()]); + watched("verify", || { + let values = page.elements().unwrap(); + let matched = verify(&plan, "email", OpSpec::Matches, &query, values, &NoTargets).unwrap(); + assert_eq!(matched.len(), 2); + drop(page); + drop(query); + }); +} + +/// The spy itself: a plain `String` holding the marker, freed while +/// watched, fails the watch. Without this a spy that saw nothing would pass +/// every test above. +#[test] +#[should_panic(expected = "freed with plaintext in them")] +fn the_spy_sees_an_unwiped_free() { + let text = marked("control"); + watched("control", || drop(text)); +} diff --git a/packages/stack-encrypt/tests/index.rs b/packages/stack-encrypt/tests/index.rs index bd9e0e5e9..2b240598b 100644 --- a/packages/stack-encrypt/tests/index.rs +++ b/packages/stack-encrypt/tests/index.rs @@ -38,19 +38,19 @@ fn caller() -> CallerContext { #[cfg(feature = "dynamic")] #[tokio::test] async fn a_vec_of_indexes_is_an_index_set_in_order_and_never_empty() { - use stack_encrypt::dynamic::{FfiValue, Value}; + use stack_encrypt::dynamic::ValueFrame; let (cipher, generates, _) = counting_cipher().await; let keyset = cipher.default_keyset(); let list: Vec = vec![IndexSpec::Ore, IndexSpec::Equality]; assert_eq!( - Indexes::::specs(&list), + Indexes::::specs(&list), [IndexSpec::Ore, IndexSpec::Equality], "the specs are the indexes', in the order given" ); assert_eq!( - Indexes::::specs(&vec![IndexSpec::Equality]), + Indexes::::specs(&vec![IndexSpec::Equality]), [IndexSpec::Equality] ); assert_eq!( @@ -61,8 +61,8 @@ async fn a_vec_of_indexes_is_an_index_set_in_order_and_never_empty() { let terms: Vec = keyset .run( - Indexes::::operations::<_, Borrowed>(&list), - &Value::new(FfiValue::UInt32(34)), + Indexes::::operations::<_, Borrowed>(&list), + &ValueFrame::of(34u32).unwrap(), caller(), ) .await @@ -241,7 +241,7 @@ mod given_a_set_of_indexes { assert_eq!(>::specs(&Ore), [IndexSpec::Ore]); assert_eq!(>::specs(&Ope), [IndexSpec::Ope]); assert_eq!( - >::specs(&Match::default()), + >::specs(&Match), [IndexSpec::Match(MatchOptions::default())] ); assert_eq!( @@ -275,7 +275,7 @@ mod given_a_set_of_indexes { #[test] fn a_match_index_debugs_by_name_whatever_its_configuration() { - assert_eq!(format!("{:?}", Match::default()), "Match"); + assert_eq!(format!("{:?}", Match), "Match"); assert_eq!(format!("{:?}", Match::::new()), "Match"); let copied = Match::::new(); let again = copied; @@ -433,7 +433,7 @@ mod given_a_set_of_indexes { .unwrap(); assert_eq!(q, ope_t, "position 2"); - let four = (Equality, Ore, Ope, Match::default()); + let four = (Equality, Ore, Ope, Match); assert_eq!( Index::::spec(Indexes::::select::(&four)), IndexSpec::Match(MatchOptions::default()), @@ -623,7 +623,8 @@ mod given_encrypted_terms_as_a_target { async fn same_bytes(value: S, indexes: X) where S: stack_encrypt::Encrypt - + for<'a> stack_encrypt::Decrypt<'a> + + stack_encrypt::Decrypt + + Send + Clone + PartialEq + std::fmt::Debug @@ -662,7 +663,7 @@ mod given_encrypted_terms_as_a_target { #[tokio::test] async fn every_term_alone_lowers_to_its_index() { same_bytes::(7, Equality).await; - same_bytes::("hello world".into(), Match::default()).await; + same_bytes::("hello world".into(), Match).await; same_bytes::, _>("Hello World".into(), Match::::new()) .await; same_bytes::, _>(7, Ore).await; @@ -702,7 +703,7 @@ mod given_encrypted_terms_as_a_target { _, >( "Hello World".into(), - (Equality, Match::default(), Ore, Ope, Match::::new()), + (Equality, Match, Ore, Ope, Match::::new()), ) .await; } @@ -751,3 +752,29 @@ mod given_encrypted_terms_as_a_target { ); } } + +/// A boolean has no equality term, on the typed path as on the dynamic one +/// (`dynamic::admits`): refused when the term is derived, before any key +/// is minted. (It has no order term either, which is a compile error: +/// `bool` is not `sem::Orderable`, so `OreTerm`, `OpeTerm` and +/// a plan `.with::(Ore)` do not build.) +#[tokio::test] +async fn a_boolean_has_no_equality_term() { + use stack_encrypt::sem::TermError; + use stack_encrypt::EncryptInto; + + let (cipher, generates, _) = counting_cipher().await; + let keyset = cipher.default_keyset(); + let equality_term: Result = true + .encrypt_into_with_context(&keyset, nonempty!("users/flag")) + .await; + assert!(matches!( + equality_term, + Err(Error::Term(TermError::NoEqualityTerm)) + )); + assert_eq!( + generates.load(Ordering::SeqCst), + 0, + "refused before any key" + ); +} diff --git a/packages/stack-encrypt/tests/op.rs b/packages/stack-encrypt/tests/op.rs new file mode 100644 index 000000000..496002968 --- /dev/null +++ b/packages/stack-encrypt/tests/op.rs @@ -0,0 +1,1338 @@ +//! Operator-typed queries (`stack_encrypt::op`, ADR-0009): a query names an +//! operator, the plan finds the index that answers it, and the term that +//! comes back is the query term for that operator, which for a match index +//! is not the stored term. +mod common; + +use common::{loads_counting_cipher, stack_cipher}; +use stack_encrypt::kms::FakeDataKeySource; +use stack_encrypt::op::{self, Limit, MatchCase, Probabilistic, Stats}; +use stack_encrypt::plan::{Field, FieldSchema, Fields, PlanError}; +use stack_encrypt::sem::{ + EqualityTerm, MatchConfig, MatchOptions, MatchQuery, MatchTerms, OpeTerm, OreTerm, RangeQuery, + TermError, Tokenizer, +}; +use stack_encrypt::target::{Encrypted, IndexSpec}; +use stack_encrypt::{Equality, Error, Match, Ope, Ore, Plan}; + +/// A match configuration that keeps case, so its index answers only a +/// case-sensitive `Matches`. +struct Exact; +impl MatchConfig for Exact { + fn options() -> MatchOptions { + MatchOptions { + downcase: false, + ..Default::default() + } + } +} +impl MatchCase for Exact { + type Case = op::CaseSensitive; +} + +/// A match configuration the index cannot use: an n-gram length of zero. +struct ZeroGram; +impl MatchConfig for ZeroGram { + fn options() -> MatchOptions { + MatchOptions { + tokenizer: Tokenizer::Ngram { length: 0 }, + ..Default::default() + } + } +} +impl MatchCase for ZeroGram { + type Case = op::CaseInsensitive; +} + +#[derive(Clone)] +struct Person { + email: String, + name: String, +} + +impl Fields for Person { + fn field_names(&self) -> Vec<&str> { + vec!["email", "name"] + } + fn schema() -> Option> { + Some(vec![ + FieldSchema::of::("email"), + FieldSchema::of::("name"), + ]) + } +} +impl Field for Person { + fn field(&self, name: &str) -> Option<&String> { + match name { + "email" => Some(&self.email), + "name" => Some(&self.name), + _ => None, + } + } +} + +fn person() -> Person { + Person { + email: "bob@example.com".into(), + name: "Alice Nguyen".into(), + } +} + +fn people_plan() -> Plan { + Plan::context("people") + .fields() + .encrypt_index::("email", (Equality, Match)) + .encrypt_index::("name", Match::::new()) + .build() + .expect("a valid plan") +} + +fn plan_error(result: Result) -> PlanError { + match result { + Err(Error::Plan(error)) => error, + Err(other) => panic!("expected a plan error, got {other:?}"), + Ok(_) => panic!("expected a plan error, got a value"), + } +} + +#[tokio::test] +async fn an_eq_query_is_the_stored_equality_term() { + let cipher = stack_cipher().await; + let plan = people_plan(); + let mut row = cipher.encrypt(&person()).using(&plan).await.unwrap(); + let email: Encrypted<(EqualityTerm, MatchTerms)> = row.take("email").unwrap(); + + let query: EqualityTerm = cipher + .query(op::Eq, "bob@example.com") + .on(&plan.field("email").unwrap()) + .await + .unwrap(); + assert_eq!(query, email.terms.0, "HMAC equality sends what it stores"); +} + +#[tokio::test] +async fn a_matches_query_is_a_filter_over_the_query_value_that_the_stored_filter_holds() { + let cipher = stack_cipher().await; + let plan = people_plan(); + let mut row = cipher.encrypt(&person()).using(&plan).await.unwrap(); + let email: Encrypted<(EqualityTerm, MatchTerms)> = row.take("email").unwrap(); + let stored = email.terms.1; + let email_plan = plan.field("email").unwrap(); + + let query: MatchQuery = cipher + .query(op::Matches, "BOB") + .on(&email_plan) + .await + .unwrap(); + assert!(stored.matches(&query), "a case-folding index matches BOB"); + assert!( + query.positions().len() < stored.positions().len(), + "the query is the query value's filter, not the stored value's" + ); + + // The query's filter is the filter the index would store for the same + // text, under the same label. + let mut same_text = cipher + .encrypt(&Person { + email: "BOB".into(), + name: "x".into(), + }) + .using(&plan) + .await + .unwrap(); + let as_stored: Encrypted<(EqualityTerm, MatchTerms)> = same_text.take("email").unwrap(); + assert_eq!(query.to_bytes(), as_stored.terms.1.to_bytes()); + assert_eq!(query.positions(), as_stored.terms.1.positions()); + assert_eq!(query.clone(), query); + + let elsewhere: MatchQuery = cipher + .query(op::Matches, "zzz") + .on(&email_plan) + .await + .unwrap(); + assert!(!stored.matches(&elsewhere)); + assert_ne!(elsewhere, query); +} + +#[tokio::test] +async fn a_match_index_with_its_own_configuration_is_named_with_via() { + let cipher = stack_cipher().await; + let plan = people_plan(); + let mut row = cipher.encrypt(&person()).using(&plan).await.unwrap(); + let name: Encrypted> = row.take("name").unwrap(); + let name_plan = plan.field("name").unwrap(); + + let exact = |value: &'static str| { + cipher + .query(op::Matches.case_sensitive(), value) + .via(Match::::new()) + .on(&name_plan) + }; + let hit: MatchQuery = exact("Nguyen").await.unwrap(); + assert!(name.terms.matches(&hit)); + let miss: MatchQuery = exact("nguyen").await.unwrap(); + assert!( + !name.terms.matches(&miss), + "a case-sensitive index does not fold the query" + ); + + // The operator's default index is the default configuration, which + // this field does not declare. + assert_eq!( + plan_error(cipher.query(op::Matches, "Nguyen").on(&name_plan).await), + PlanError::IndexOptions { + field: "name".into(), + declared: IndexSpec::Match(Exact::options()), + asked: IndexSpec::Match(MatchOptions::default()), + } + ); +} + +#[tokio::test] +async fn an_operator_the_field_has_no_index_for_is_refused_when_awaited() { + let cipher = stack_cipher().await; + let plan = people_plan(); + assert_eq!( + plan_error( + cipher + .query(op::Eq, "Alice") + .on(&plan.field("name").unwrap()) + .await + ), + PlanError::IndexNotDeclared { + field: "name".into(), + index: "eq" + } + ); +} + +#[tokio::test] +async fn a_one_value_plan_answers_from_its_indexes_by_type() { + let cipher = stack_cipher().await; + let plan = Plan::context("users/email") + .with::((Equality, Match)) + .build() + .unwrap(); + let stored: Encrypted<(EqualityTerm, MatchTerms)> = cipher + .encrypt(&"bob@example.com".to_owned()) + .using(&plan) + .await + .unwrap(); + + let eq = cipher + .query(op::Eq, "bob@example.com") + .on(&plan) + .await + .unwrap(); + assert_eq!(eq, stored.terms.0); + let matches = cipher + .query(op::Matches, "example") + .on(&plan) + .await + .unwrap(); + assert!(stored.terms.1.matches(&matches)); + + let exact_plan = Plan::context("users/name") + .with::(Match::::new()) + .build() + .unwrap(); + let name: Encrypted> = cipher + .encrypt(&"Alice".to_owned()) + .using(&exact_plan) + .await + .unwrap(); + let query = cipher + .query(op::Matches.case_sensitive(), "Ali") + .via(Match::::new()) + .on(&exact_plan) + .await + .unwrap(); + assert!(name.terms.matches(&query)); +} + +#[tokio::test] +async fn a_target_answers_an_operator_through_the_index_it_names() { + let cipher = stack_cipher().await; + let eq_plan = Plan::value::() + .context("users/email") + .encrypt_into::() + .build() + .unwrap(); + let stored: EqualityTerm = cipher + .encrypt(&"bob@example.com".to_owned()) + .using(&eq_plan) + .await + .unwrap(); + let query = cipher + .query(op::Eq, "bob@example.com") + .on(&eq_plan) + .await + .unwrap(); + assert_eq!(query, stored); + + let match_plan = Plan::value::() + .context("users/email") + .encrypt_into::() + .build() + .unwrap(); + let stored: MatchTerms = cipher + .encrypt(&"bob@example.com".to_owned()) + .using(&match_plan) + .await + .unwrap(); + let query = cipher + .query(op::Matches, "bob") + .on(&match_plan) + .await + .unwrap(); + assert!(stored.matches(&query)); +} + +#[tokio::test] +async fn a_target_with_several_terms_names_the_index_with_via() { + let cipher = stack_cipher().await; + let plan = Plan::value::() + .context("users/email") + .encrypt_into::>() + .build() + .unwrap(); + let stored = cipher + .encrypt(&"bob@example.com".to_owned()) + .using(&plan) + .await + .unwrap(); + let eq = cipher + .query(op::Eq, "bob@example.com") + .via(Equality) + .on(&plan) + .await + .unwrap(); + assert_eq!(eq, stored.terms.0); + let matches = cipher + .query(op::Matches, "bob") + .via(Match) + .on(&plan) + .await + .unwrap(); + assert!(stored.terms.1.matches(&matches)); + + // An index the target does not declare is refused when awaited. + let one_term = Plan::value::() + .context("users/email") + .encrypt_into::>() + .build() + .unwrap(); + assert_eq!( + plan_error( + cipher + .query(op::Matches, "bob") + .via(Match) + .on(&one_term) + .await + ), + PlanError::IndexNotDeclared { + field: "the value".into(), + index: "match" + } + ); + let eq = cipher.query(op::Eq, "bob").on(&one_term).await; + assert!(eq.is_ok(), "one term answers what the term answers"); +} + +#[tokio::test] +async fn operator_queries_settle_together_and_extend_like_the_write() { + let cipher = stack_cipher().await; + let plan = people_plan(); + let mut row = cipher + .encrypt(&person()) + .using(&plan) + .extend(7u64) + .await + .unwrap(); + let email: Encrypted<(EqualityTerm, MatchTerms)> = row.take("email").unwrap(); + let email_plan = plan.field("email").unwrap(); + + let (eq, matches) = stack_encrypt::all(( + cipher + .query(op::Eq, "bob@example.com") + .on(&email_plan) + .extend(7u64), + cipher + .query(op::Matches, "bob") + .on(&email_plan) + .extend(7u64), + )) + .await + .unwrap(); + assert_eq!(eq, email.terms.0); + assert!(email.terms.1.matches(&matches)); + + let unextended = cipher + .query(op::Eq, "bob@example.com") + .on(&email_plan) + .await + .unwrap(); + assert_ne!( + unextended, email.terms.0, + "the query is derived under the extended label" + ); +} + +#[tokio::test] +async fn a_query_chain_debugs_without_its_value() { + let cipher = stack_cipher().await; + let plan = people_plan(); + let email_plan = plan.field("email").unwrap(); + let secret = "bob@example.com"; + let shown = format!("{:?}", cipher.query(op::Eq, secret).on(&email_plan)); + assert_eq!(shown, "QueryOp { .. }"); +} + +/// A configuration whose `MatchCase` says it folds case while its options +/// keep it: the type cannot see the options, so the query is refused. +struct Mislabelled; +impl MatchConfig for Mislabelled { + fn options() -> MatchOptions { + MatchOptions { + downcase: false, + ..Default::default() + } + } +} +impl MatchCase for Mislabelled { + type Case = op::CaseInsensitive; +} + +#[tokio::test] +async fn a_match_case_that_disagrees_with_its_options_is_refused() { + let cipher = stack_cipher().await; + let plan = Plan::context("users/name") + .with::(Match::::new()) + .build() + .unwrap(); + let refused = plan_error( + cipher + .query(op::Matches, "Bob") + .via(Match::::new()) + .on(&plan) + .await, + ); + assert_eq!( + refused, + PlanError::MatchCase { + declared: "CaseInsensitive", + folds: false + } + ); + assert_eq!( + refused.to_string(), + "a match configuration declares the case CaseInsensitive but its options keep case" + ); +} + +#[tokio::test] +async fn an_undeclared_index_is_refused_before_its_case_is_checked() { + let cipher = stack_cipher().await; + let plan = people_plan(); + let refused = plan_error( + cipher + .query(op::Matches, "Bob") + .via(Match::::new()) + .on(&plan.field("email").unwrap()) + .await, + ); + assert!( + matches!(refused, PlanError::IndexOptions { ref field, .. } if field == "email"), + "the plan's refusal comes first, not the case: {refused:?}" + ); + + let no_context: Plan = Plan::fields() + .encrypt::("email") + .encrypt_index::("name", Match::::new()) + .build() + .unwrap(); + let refused = plan_error( + cipher + .query(op::Matches, "Bob") + .via(Match::::new()) + .on(&no_context.field("name").unwrap()) + .await, + ); + assert_eq!(refused, PlanError::NoContext); +} + +#[tokio::test] +async fn a_query_names_its_context_before_or_after_the_index() { + let cipher = stack_cipher().await; + let plan: Plan = Plan::fields() + .encrypt_index::("email", Match) + .encrypt::("name") + .build() + .unwrap(); + let email_plan = plan.field("email").unwrap(); + let before = cipher + .query(op::Matches, "bob") + .context("people") + .via(Match) + .on(&email_plan) + .await + .unwrap(); + let after = cipher + .query(op::Matches, "bob") + .via(Match) + .context("people") + .on(&email_plan) + .await + .unwrap(); + assert_eq!(before, after); +} + +#[tokio::test] +async fn a_refused_operator_query_loads_no_keyset() { + let (cipher, loads) = loads_counting_cipher().await; + let plan: Plan = Plan::context("people") + .fields() + .encrypt::("email") + .encrypt_index::("name", Match::::new()) + .build() + .unwrap(); + let refused = cipher + .query(op::Eq, "Alice") + .on(&plan.field("name").unwrap()) + .keyset("tenant") + .await; + assert_eq!( + plan_error(refused), + PlanError::IndexNotDeclared { + field: "name".into(), + index: "eq" + } + ); + assert_eq!( + loads.load(std::sync::atomic::Ordering::SeqCst), + 0, + "refused before the named keyset is loaded" + ); +} + +#[tokio::test] +async fn an_operator_query_runs_under_the_keyset_it_names() { + let cipher = stack_cipher().await; + let plan = Plan::context("users/email") + .with::(Equality) + .build() + .unwrap(); + let stored: Encrypted = cipher + .encrypt(&"bob@example.com".to_owned()) + .using(&plan) + .keyset("tenant") + .await + .unwrap(); + let under_tenant = cipher + .query(op::Eq, "bob@example.com") + .on(&plan) + .keyset("tenant") + .await + .unwrap(); + assert_eq!(under_tenant, stored.terms); + let under_default = cipher + .query(op::Eq, "bob@example.com") + .on(&plan) + .await + .unwrap(); + assert_ne!(under_default, stored.terms, "another keyset, another key"); +} + +/// A match configuration with the smallest filter allowed, so a long value +/// sets nearly every bit and false positives are easy to find. +struct Tiny; +impl MatchConfig for Tiny { + fn options() -> MatchOptions { + MatchOptions { + m: 32, + ..Default::default() + } + } +} +impl MatchCase for Tiny { + type Case = op::CaseInsensitive; +} + +#[tokio::test] +async fn verify_keeps_every_real_match_and_folds_case_as_the_index_does() { + let cipher = stack_cipher().await; + let plan = people_plan(); + let email_plan = plan.field("email").unwrap(); + let name_plan = plan.field("name").unwrap(); + + let query = cipher + .query(op::Matches, "BOB@Example") + .on(&email_plan) + .await + .unwrap(); + assert!(query.verify("bob@example.com")); + assert!(query.verify(&String::from("say hi to Bob@example.org"))); + assert!(!query.verify("alice@example.com")); + assert!(query.clone().verify("bob@example.com")); + + let exact = cipher + .query(op::Matches.case_sensitive(), "Nguyen") + .via(Match::::new()) + .on(&name_plan) + .await + .unwrap(); + assert!(exact.verify("Alice Nguyen")); + assert!( + !exact.verify("alice nguyen"), + "a case-sensitive index keeps case" + ); +} + +/// A match query is cut in Unicode 16 NFC, as the stored value is, so a +/// query and a row that spell one string in its two normal forms match and +/// verify. Text holding a code point unassigned in Unicode 16 has no normal +/// form: the query is refused, and such a row verifies against nothing. +#[tokio::test] +async fn a_match_query_is_cut_in_nfc_and_refuses_text_with_no_normal_form() { + let cipher = stack_cipher().await; + let plan = people_plan(); + let email_plan = plan.field("email").unwrap(); + + let query = cipher + .query(op::Matches, "Rene\u{301}e") + .on(&email_plan) + .await + .unwrap(); + let precomposed = cipher + .query(op::Matches, "Ren\u{e9}e") + .on(&email_plan) + .await + .unwrap(); + assert_eq!(query, precomposed, "one string, one filter"); + assert!(query.verify("Ren\u{e9}e Martin")); + assert!(precomposed.verify("Rene\u{301}e Martin")); + assert!( + !query.verify("Ren\u{e9}e \u{378}"), + "a value with no normal form verifies against nothing" + ); + + let refused = cipher + .query(op::Matches, "Ren\u{378}e") + .on(&email_plan) + .await; + assert!( + matches!( + refused, + Err(Error::Term(TermError::Normalize( + vitaminc_normalize::NormalizeError::UnassignedCodePoint + ))) + ), + "{refused:?}" + ); +} + +#[tokio::test] +async fn verify_drops_a_row_the_filter_matched_by_chance() { + let cipher = stack_cipher().await; + let plan = Plan::context("notes/body") + .with::(Match::::new()) + .build() + .unwrap(); + let value = "the quick brown fox jumps over the lazy dog and keeps running"; + let stored: Encrypted> = cipher + .encrypt(&value.to_owned()) + .using(&plan) + .await + .unwrap(); + + let real = cipher + .query(op::Matches, "lazy dog") + .via(Match::::new()) + .on(&plan) + .await + .unwrap(); + assert!(stored.terms.matches(&real) && real.verify(value)); + + // The value holds no digit, so no query with one is in it; a 32-bit + // filter this full holds some of their filters anyway. + let mut false_positive = None; + for i in 0..1000 { + let digits = format!("{i:04}"); + let query = cipher + .query(op::Matches, &digits) + .via(Match::::new()) + .on(&plan) + .await + .unwrap(); + if stored.terms.matches(&query) { + false_positive = Some(query); + break; + } + } + let query = false_positive.expect("a 32-bit filter this full matches some query by chance"); + assert!( + !query.verify(value), + "the server would return this row; verify does not keep it" + ); +} + +#[tokio::test] +async fn a_match_query_debugs_without_its_tokens() { + let cipher = stack_cipher().await; + let plan = people_plan(); + let query = cipher + .query(op::Matches, "needle") + .on(&plan.field("email").unwrap()) + .await + .unwrap(); + let shown = format!("{query:?}"); + assert_eq!( + shown, + format!("MatchQuery {{ positions: {:?}, .. }}", query.positions()) + ); + for token in ["nee", "eed", "edl", "dle", "needle"] { + assert!(!shown.contains(token), "{shown}"); + } +} + +/// Whole words, as the v1 match indexer's standard tokenizer splits them. +struct Words; +impl MatchConfig for Words { + fn options() -> MatchOptions { + MatchOptions { + tokenizer: stack_encrypt::sem::Tokenizer::Standard, + ..Default::default() + } + } +} +impl MatchCase for Words { + type Case = op::CaseInsensitive; +} + +/// A Bloom match asks for the query's tokens, in any order and anywhere; +/// it is not a substring test, and `verify` must not become one, or it +/// would drop rows the index rightly returned. +#[tokio::test] +async fn verify_is_a_token_test_not_a_substring_test() { + let cipher = stack_cipher().await; + let plan = people_plan(); + let query = cipher + .query(op::Matches, "abcd") + .on(&plan.field("email").unwrap()) + .await + .unwrap(); + assert!(query.verify("abc bcd"), "both 3-grams, never adjacent"); + assert!(!query.verify("abc"), "one 3-gram of two"); + + let words = Plan::context("notes/body") + .with::(Match::::new()) + .build() + .unwrap(); + let stored: Encrypted> = cipher + .encrypt(&"Hello, big World!".to_owned()) + .using(&words) + .await + .unwrap(); + let query = cipher + .query(op::Matches, "world hello") + .via(Match::::new()) + .on(&words) + .await + .unwrap(); + assert!(stored.terms.matches(&query)); + assert!(query.verify("Hello, big World!")); + assert!( + !query.verify("worldly hello"), + "a word is a token, not a prefix" + ); +} + +/// EQL v4's match parameters, with a notes column's prior. +struct Notes; +impl MatchConfig for Notes { + fn options() -> MatchOptions { + MatchOptions { + k: 6, + m: 2048, + ..Default::default() + } + } + fn expected_tokens() -> Option { + Some(200) + } +} +impl MatchCase for Notes { + type Case = op::CaseInsensitive; +} + +#[tokio::test] +async fn target_limit_sizes_the_fetch_from_the_query_and_the_prior() { + let cipher = stack_cipher().await; + let plan = Plan::context("notes/body") + .with::(Match::::new()) + .build() + .unwrap(); + let query = |text: &'static str| { + cipher + .query(op::Matches, text) + .via(Match::::new()) + .on(&plan) + }; + let stats = Stats::declared(1_000_000); + + let short = query("ali").await.unwrap(); + let long = query("alice nguyen").await.unwrap(); + let (Limit::Rows(short_rows), Limit::Rows(long_rows)) = ( + short.target_limit(10, &stats), + long.target_limit(10, &stats), + ) else { + panic!("a declared prior gives a finite fetch"); + }; + assert!( + short_rows > 1_000, + "three letters against long text match thousands of rows by chance: {short_rows}" + ); + assert!(long_rows < 20, "a long query sets enough bits: {long_rows}"); + assert!(long_rows >= 10, "never fewer than `want`"); + + // A tighter confidence asks for more. + let strict = short.target_limit(10, &stats.clone().with_confidence(0.9999)); + assert!(strict.rows().unwrap() > short_rows); +} + +#[tokio::test] +async fn target_limit_without_a_prior_needs_a_measured_column() { + let cipher = stack_cipher().await; + let plan = people_plan(); + let email_plan = plan.field("email").unwrap(); + let query = cipher + .query(op::Matches, "bob") + .on(&email_plan) + .await + .unwrap(); + + // The default configuration declares no prior. + assert_eq!( + query.target_limit(10, &Stats::declared(1_000)), + Limit::Unbounded + ); + + // Measure the column: the set-bit count of each stored filter. + let mut histogram = std::collections::BTreeMap::::new(); + for email in [ + "bob@example.com", + "alice@example.org", + "carol.smith@example.net", + ] { + let mut row = cipher + .encrypt(&Person { + email: email.into(), + name: "x".repeat(4), + }) + .using(&plan) + .await + .unwrap(); + let stored: Encrypted<(EqualityTerm, MatchTerms)> = row.take("email").unwrap(); + *histogram + .entry(stored.terms.1.positions().len() as u32) + .or_default() += 1; + } + // The pass rate the histogram gives this query, over a large table. + let bits = query.positions().len() as i32; + let rows_seen: u64 = histogram.values().sum(); + let p = histogram + .iter() + .map(|(&set, &n)| n as f64 * (f64::from(set) / 256.0).powi(bits)) + .sum::() + / rows_seen as f64; + let lambda = p * 1_000_000.0; + let stats = Stats::measured(1_000_000, histogram); + let Limit::Rows(rows) = query.target_limit(10, &stats) else { + panic!("a measured column gives a finite fetch"); + }; + let extra = (rows - 10) as f64; + assert!( + extra >= lambda && extra <= lambda + 4.0 * lambda.sqrt() + 3.0, + "10 wanted, λ = {lambda}: {rows}" + ); +} + +/// A value too short to cut a token (two letters under 3-grams, or nothing +/// at all) is a valid thing to store in a match column. ADR-0009: the +/// stored term is the empty filter, which no query matches, and the value +/// itself seals and opens as any other. +#[tokio::test] +async fn a_short_match_value_stores_as_the_empty_filter_and_no_query_finds_it() { + let cipher = stack_cipher().await; + let plan = Plan::context("users/name") + .with::((Equality, Match)) + .build() + .unwrap(); + let query = cipher.query(op::Matches, "alice").on(&plan).await.unwrap(); + + for short in ["Al", "", " "] { + let stored: Encrypted<(EqualityTerm, MatchTerms)> = cipher + .encrypt(&short.to_owned()) + .using(&plan) + .await + .unwrap_or_else(|error| panic!("{short:?} stores: {error}")); + assert!( + stored.terms.1.positions().is_empty(), + "{short:?} is stored as the empty filter" + ); + assert!( + !stored.terms.1.matches(&query), + "{short:?}: the empty filter holds none of a query's positions" + ); + assert!(!query.verify(short)); + let back: String = cipher.open(stored).using(&plan).await.unwrap(); + assert_eq!(back, short, "{short:?} opens as written"); + } + + // The equality term still finds it: only the match term is empty. + let stored: Encrypted<(EqualityTerm, MatchTerms)> = + cipher.encrypt(&"Al".to_owned()).using(&plan).await.unwrap(); + let eq = cipher.query(op::Eq, "Al").on(&plan).await.unwrap(); + assert_eq!(eq, stored.terms.0); +} + +/// A query with no tokens would match every row, so it is the one query +/// value the library refuses: when the query is awaited, before a term +/// exists and before any keyset is loaded. +#[tokio::test] +async fn a_match_query_with_no_tokens_is_refused_before_any_term_or_keyset() { + let (cipher, loads) = loads_counting_cipher().await; + let plan: Plan = Plan::context("people") + .fields() + .encrypt_index::("email", (Equality, Match)) + .encrypt_index::("name", Match::::new()) + .build() + .unwrap(); + let email_plan = plan.field("email").unwrap(); + + for text in ["", " ", "bo"] { + let refused = cipher + .query(op::Matches, text) + .on(&email_plan) + .keyset("tenant") + .await; + assert!( + matches!(refused, Err(Error::Term(TermError::EmptyTermText))), + "{text:?}: {refused:?}" + ); + } + // Through `via`, under another configuration, and in a batch. + let refused = cipher + .query(op::Matches.case_sensitive(), "Al") + .via(Match::::new()) + .on(&plan.field("name").unwrap()) + .await; + assert!(matches!( + refused, + Err(Error::Term(TermError::EmptyTermText)) + )); + let refused = stack_encrypt::all(( + cipher.query(op::Eq, "bob@example.com").on(&email_plan), + cipher.query(op::Matches, "bo").on(&email_plan), + )) + .await; + assert!(matches!( + refused, + Err(Error::Term(TermError::EmptyTermText)) + )); + assert_eq!( + loads.load(std::sync::atomic::Ordering::SeqCst), + 0, + "refused before the named keyset is loaded" + ); + assert_eq!( + TermError::EmptyTermText.to_string(), + "the query's text produces no match tokens (empty, separator-only, or shorter than the n-gram length)" + ); + + // The same text is a fine equality query, and a fine stored value. + assert!(cipher.query(op::Eq, "").on(&email_plan).await.is_ok()); + let row = cipher + .encrypt(&Person { + email: "bo".into(), + name: "Al".into(), + }) + .using(&plan) + .await; + assert!(row.is_ok(), "short values store: {row:?}"); +} + +/// A match query under options the index cannot use is refused with +/// `InvalidOptions`, as storing under them is, and never reaches the +/// tokenizer: an n-gram length of zero would panic there. +#[tokio::test] +async fn a_match_query_under_invalid_options_is_refused_not_tokenised() { + let cipher = stack_cipher().await; + let plan = Plan::context("users/name") + .with::(Match::::new()) + .build() + .unwrap(); + let refused = cipher + .query(op::Matches, "alice") + .via(Match::::new()) + .on(&plan) + .await; + assert!( + matches!(refused, Err(Error::Term(TermError::InvalidOptions(_)))), + "{refused:?}" + ); + let stored = cipher.encrypt(&"alice".to_owned()).using(&plan).await; + assert!( + matches!(stored, Err(Error::Term(TermError::InvalidOptions(_)))), + "{stored:?}" + ); +} + +/// An ordering query sends the index's own term for the value: this +/// crate's ORE is CLLW, whose ciphertext has no left half to send alone, +/// so what is sent is what is stored, as for an HMAC. The ordering +/// operators default to ORE; OPE is named with `via`. +#[tokio::test] +async fn an_ordering_query_is_the_index_term_of_the_value() { + let cipher = stack_cipher().await; + let plan = Plan::context("users/age") + .with::((Equality, Ore, Ope)) + .build() + .unwrap(); + let stored: Encrypted<(EqualityTerm, OreTerm, OpeTerm)> = + cipher.encrypt(&34u32).using(&plan).await.unwrap(); + + let lt: OreTerm = cipher.query(op::Lt, &34u32).on(&plan).await.unwrap(); + let lte = cipher.query(op::Lte, &34u32).on(&plan).await.unwrap(); + let gt = cipher.query(op::Gt, &34u32).on(&plan).await.unwrap(); + let gte = cipher.query(op::Gte, &34u32).on(&plan).await.unwrap(); + for (name, term) in [("Lt", <), ("Lte", <e), ("Gt", >), ("Gte", >e)] { + assert_eq!(term, &stored.terms.1, "{name} sends the ORE term"); + } + let above = cipher.query(op::Lt, &35u32).on(&plan).await.unwrap(); + let below = cipher.query(op::Lt, &33u32).on(&plan).await.unwrap(); + assert!( + below < stored.terms.1 && stored.terms.1 < above, + "ORE terms order as the values" + ); + + let ope: OpeTerm = cipher + .query(op::Gte, &34u32) + .via(Ope) + .on(&plan) + .await + .unwrap(); + assert_eq!(ope, stored.terms.2, "OPE is named with via"); + let ope_above = cipher + .query(op::Gt, &35u32) + .via(Ope) + .on(&plan) + .await + .unwrap(); + assert!( + ope.as_bytes() < ope_above.as_bytes(), + "OPE terms order as bytes" + ); + + // A typed target answers the orderings through the index it names. + let typed = Plan::value::() + .context("users/balance") + .encrypt_into::>>() + .build() + .unwrap(); + let stored = cipher.encrypt(&5u32).using(&typed).await.unwrap(); + let query = cipher.query(op::Lte, &5u32).on(&typed).await.unwrap(); + assert_eq!(query, stored.terms); +} + +/// `Between` is one term carrying both bounds, inclusive, derived under +/// the one label; each bound is the term the index sends for that value +/// alone (ADR-0009, decision 7). +#[tokio::test] +async fn a_between_query_is_one_term_carrying_both_bounds() { + let cipher = stack_cipher().await; + let plan = Plan::context("users/age") + .with::(Ore) + .build() + .unwrap(); + + let range: RangeQuery> = cipher + .query(op::Between, &(18u32, 65)) + .on(&plan) + .await + .unwrap(); + let lo = cipher.query(op::Gte, &18u32).on(&plan).await.unwrap(); + let hi = cipher.query(op::Lte, &65u32).on(&plan).await.unwrap(); + assert_eq!(range.lo(), &lo); + assert_eq!(range.hi(), &hi); + assert_eq!(range.clone().into_bounds(), (lo, hi)); + + // A stored value inside the range orders between the bounds. + let inside: Encrypted> = cipher.encrypt(&30u32).using(&plan).await.unwrap(); + let outside: Encrypted> = cipher.encrypt(&70u32).using(&plan).await.unwrap(); + assert!(range.lo() <= &inside.terms && &inside.terms <= range.hi()); + assert!(&outside.terms > range.hi()); + + // Inclusive at both ends: one value is `(v, v)`. + let one = cipher + .query(op::Between, &(40u32, 40)) + .on(&plan) + .await + .unwrap(); + assert_eq!(one.lo(), one.hi()); + assert_ne!(one, range); + + // OPE is named with via, and a typed target answers through its index. + let both = Plan::context("users/age") + .with::((Ore, Ope)) + .build() + .unwrap(); + let ope: RangeQuery> = cipher + .query(op::Between, &(18u32, 65)) + .via(Ope) + .on(&both) + .await + .unwrap(); + assert!(ope.lo().as_bytes() < ope.hi().as_bytes()); + let typed = Plan::value::() + .context("users/age") + .encrypt_into::>>() + .build() + .unwrap(); + let typed_range = cipher + .query(op::Between, &(1u32, 2)) + .on(&typed) + .await + .unwrap(); + assert!(typed_range.lo() < typed_range.hi()); +} + +/// A range whose low bound is above its high bound is not refused, as +/// SQL's `BETWEEN` is not: both bounds' terms are derived like any other +/// range's, in the order given, and the range matches nothing. +#[tokio::test] +async fn an_inverted_range_is_a_query_like_any_other() { + let cipher = stack_cipher().await; + let plan = Plan::context("users/age") + .with::(Ore) + .build() + .unwrap(); + let inverted = cipher + .query(op::Between, &(65u32, 18)) + .on(&plan) + .await + .unwrap(); + assert!(inverted.lo() > inverted.hi(), "the bounds as given"); + let one = cipher + .query(op::Between, &(18u32, 18)) + .on(&plan) + .await + .unwrap(); + assert_eq!(one.lo(), one.hi()); +} + +/// A field of a fields plan answers the orderings over its declared index, +/// under the field's own label, and refuses an index it does not declare. +/// An index-only field needs no sealing, so it can hold the integer types +/// the cipher does not seal on its own. +#[tokio::test] +async fn a_field_answers_the_orderings_through_its_declared_index() { + #[derive(Clone)] + struct Member { + age: u32, + balance: i64, + } + impl Fields for Member { + fn field_names(&self) -> Vec<&str> { + vec!["age", "balance"] + } + fn schema() -> Option> { + Some(vec![ + FieldSchema::of::("age"), + FieldSchema::of::("balance"), + ]) + } + } + impl Field for Member { + fn field(&self, name: &str) -> Option<&u32> { + (name == "age").then_some(&self.age) + } + } + impl Field for Member { + fn field(&self, name: &str) -> Option<&i64> { + (name == "balance").then_some(&self.balance) + } + } + let cipher = stack_cipher().await; + let plan: Plan = Plan::context("members") + .fields() + .encrypt_index::("age", Ope) + .index::("balance", Ore) + .build() + .unwrap(); + let mut row = cipher + .encrypt(&Member { + age: 34, + balance: -250, + }) + .using(&plan) + .await + .unwrap(); + let age: Encrypted> = row.take("age").unwrap(); + let balance: OreTerm = row.take("balance").unwrap(); + let age_plan = plan.field("age").unwrap(); + let balance_plan = plan.field("balance").unwrap(); + + let query = cipher + .query(op::Lte, &34u32) + .via(Ope) + .on(&age_plan) + .await + .unwrap(); + assert_eq!(query, age.terms); + let range = cipher + .query(op::Between, &(30u32, 40)) + .via(Ope) + .on(&age_plan) + .await + .unwrap(); + assert!( + range.lo().as_bytes() <= age.terms.as_bytes() + && age.terms.as_bytes() <= range.hi().as_bytes() + ); + + // A signed value, ordered as a signed value. + let owed = cipher + .query(op::Lt, &-250i64) + .on(&balance_plan) + .await + .unwrap(); + assert_eq!(owed, balance); + let zero = cipher + .query(op::Gte, &0i64) + .on(&balance_plan) + .await + .unwrap(); + assert!(balance < zero, "a negative balance is below zero"); + let overdrawn = cipher + .query(op::Between, &(-1_000i64, -1)) + .on(&balance_plan) + .await + .unwrap(); + assert!(overdrawn.lo() <= &balance && &balance <= overdrawn.hi()); + + // The default index for an ordering is ORE, which the age field lacks. + assert_eq!( + plan_error(cipher.query(op::Lt, &34u32).on(&age_plan).await), + PlanError::IndexNotDeclared { + field: "age".into(), + index: "ore" + } + ); + assert_eq!( + plan_error(cipher.query(op::Between, &(1u32, 2)).on(&age_plan).await), + PlanError::IndexNotDeclared { + field: "age".into(), + index: "ore" + } + ); + // And a value of another type than the field declares. + assert_eq!( + plan_error(cipher.query(op::Lt, &34u64).via(Ope).on(&age_plan).await), + PlanError::FieldType { + field: "age".into(), + expected: "u32" + } + ); +} + +/// Text orders by its order key, ADR-0002's fold: the orderings are +/// answered over text, a query term of `Café` is the term of `cafe`, `alice` +/// orders before `Zoe` and `élan` between `eclair` and `emu`. +#[tokio::test] +async fn text_orders_by_its_folded_key() { + let cipher = stack_cipher().await; + let plan = Plan::context("users/surname") + .with::((Ore, Ope)) + .build() + .unwrap(); + let lt = |text: &str| cipher.query(op::Lt, text).on(&plan); + let ope = |text: &str| cipher.query(op::Lt, text).via(Ope).on(&plan); + let cafe: OreTerm = lt("cafe").await.unwrap(); + for text in ["Caf\u{e9}", "CAF\u{c9}", "cafe\u{301}"] { + assert_eq!(lt(text).await.unwrap(), cafe, "{text:?}"); + } + + // OPE terms compare as bytes, so the order is visible here directly. + let order = ["alice", "eclair", "\u{c9}lan", "emu", "Zoe"]; + let mut terms = Vec::new(); + for text in order { + let term: OpeTerm = ope(text).await.unwrap(); + terms.push(term.as_bytes().to_vec()); + } + assert!(terms.windows(2).all(|pair| pair[0] < pair[1]), "{order:?}"); + // And ORE terms compare through their own comparison. + let alice: OreTerm = lt("alice").await.unwrap(); + let zoe: OreTerm = lt("Zoe").await.unwrap(); + assert!(alice < zoe); + + let between = |lo: &str, hi: &str| { + cipher + .query(op::Between, &(lo.to_owned(), hi.to_owned())) + .on(&plan) + }; + let tie = between("A", "a").await.unwrap(); + assert_eq!(tie.lo(), tie.hi(), "one folded value"); + assert!(between("a", "B").await.is_ok()); + assert!( + matches!( + between("a\u{378}", "b").await, + Err(Error::Term(TermError::Normalize(_))) + ), + "a bound with no fold" + ); +} + +/// Floats order by their ADR-0002 order key, as Postgres's `float8` does: +/// the orderings are answered over `f64`, `-0.0` and `0.0` are one query +/// term, and every NaN is one and sorts above `+Infinity`. +#[tokio::test] +async fn floats_order_by_their_order_key() { + let cipher = stack_cipher().await; + let plan = Plan::context("users/score") + .with::((Ore, Ope)) + .build() + .unwrap(); + let lt = |value: f64| cipher.query(op::Lt, &value).on(&plan); + let ope = |value: f64| cipher.query(op::Lt, &value).via(Ope).on(&plan); + let zero: OreTerm = lt(0.0).await.unwrap(); + assert_eq!(lt(-0.0).await.unwrap(), zero, "-0.0 is 0.0"); + let nan: OreTerm = lt(f64::NAN).await.unwrap(); + assert_eq!(lt(-f64::NAN).await.unwrap(), nan, "one NaN"); + + let order = [ + f64::NEG_INFINITY, + -1.5, + 0.0, + 1e-300, + 1.5, + f64::INFINITY, + f64::NAN, + ]; + let mut terms = Vec::new(); + for value in order { + let term: OpeTerm = ope(value).await.unwrap(); + terms.push(term.as_bytes().to_vec()); + } + assert!(terms.windows(2).all(|pair| pair[0] < pair[1]), "{order:?}"); + let low: OreTerm = lt(-1.5).await.unwrap(); + assert!(low < zero && zero < nan); + + let between = |lo: f64, hi: f64| cipher.query(op::Between, &(lo, hi)).on(&plan); + let from_nan = between(f64::NAN, f64::INFINITY).await.unwrap(); + assert!(from_nan.lo() > from_nan.hi(), "NaN sorts last"); + let one = between(0.0, -0.0).await.unwrap(); + assert_eq!(one.lo(), one.hi(), "one value"); + let range = between(-0.5, 2.5).await.unwrap(); + assert!(range.lo() < range.hi()); +} diff --git a/packages/stack-encrypt/tests/plan.rs b/packages/stack-encrypt/tests/plan.rs index 48008f65f..c578619c8 100644 --- a/packages/stack-encrypt/tests/plan.rs +++ b/packages/stack-encrypt/tests/plan.rs @@ -8,6 +8,7 @@ use std::sync::atomic::Ordering; use common::{counting_cipher, loads_counting_cipher, recording_cipher, stack_cipher}; use stack_encrypt::kms::{FakeDataKeySource, IdentifiedBy}; +use stack_encrypt::op; use stack_encrypt::plan::{ Field, FieldKind, FieldSchema, FieldValues, Fields, Operation, PlanError, }; @@ -101,7 +102,7 @@ type AgeTerms = (EqualityTerm, OreTerm); fn users_plan() -> Plan { Plan::context("users") .fields() - .encrypt_index::("email", (Equality, Match::default())) + .encrypt_index::("email", (Equality, Match)) .encrypt_index::("age", (Equality, Ore)) .encrypt::("notes") .passthrough::("id") @@ -133,7 +134,7 @@ type HandOut = ( u64, ); fn hand_composed<'s, K: 'static>() -> Encryption<'s, User, HandOut, K, DeclaredContext> { - indexed::((Equality, Match::default())) + indexed::((Equality, Match)) .under(nonempty!("users").with("email")) .project(|u: &User| &u.email) .zip( @@ -158,7 +159,7 @@ async fn the_chain_is_the_hand_composed_combinators_field_for_field() { .encrypt(&user) .context("users") .fields() - .encrypt_index::("email", (Equality, Match::default())) + .encrypt_index::("email", (Equality, Match)) .encrypt_index::("age", (Equality, Ore)) .encrypt::("notes") .passthrough::("id") @@ -254,7 +255,7 @@ async fn a_saved_plan_is_the_same_chain_and_decrypts_back() { .encrypt(&user) .context("users") .fields() - .encrypt_index::("email", (Equality, Match::default())) + .encrypt_index::("email", (Equality, Match)) .encrypt_index::("age", (Equality, Ore)) .encrypt::("notes") .passthrough::("id") @@ -289,35 +290,27 @@ async fn a_query_derives_under_the_label_the_write_used() { let email_plan = users_plan.field("email").unwrap(); let age_plan = users_plan.field("age").unwrap(); let eq: EqualityTerm = cipher - .query("bob@example.com") - .using(&email_plan) - .equality() + .query(op::Eq, "bob@example.com") + .on(&email_plan) .await .unwrap(); assert_eq!( eq, email.terms.0, "equality query bytes equal the stored term" ); - let matching: MatchTerms = cipher - .query("bob@example.com") - .using(&email_plan) - .index(Match::default()) + let matching = cipher + .query(op::Matches, "bob@example.com") + .on(&email_plan) .await .unwrap(); assert_eq!(matching.to_bytes(), email.terms.1.to_bytes()); - let ore: OreTerm = cipher - .query(&34u32) - .using(&age_plan) - .index(Ore) - .await - .unwrap(); + let ore: OreTerm = cipher.query(op::Lt, &34u32).on(&age_plan).await.unwrap(); assert_eq!(ore.to_bytes(), age.terms.1.to_bytes()); // A different value is a different term: the query is not a constant. let other = cipher - .query("eve@example.com") - .using(&email_plan) - .equality() + .query(op::Eq, "eve@example.com") + .on(&email_plan) .await .unwrap(); assert_ne!(other, email.terms.0); @@ -336,12 +329,12 @@ async fn a_query_extended_like_the_write_matches_it() { let email: Encrypted = row.take("email").unwrap(); let email_plan = users_plan.field("email").unwrap(); let query = |extend: Option| { - let chain = cipher.query("bob@example.com").using(&email_plan); + let chain = cipher.query(op::Eq, "bob@example.com"); let chain = match extend { Some(parts) => chain.extend(parts), None => chain, }; - chain.equality() + chain.on(&email_plan) }; assert_eq!(query(Some(7)).await.unwrap(), email.terms.0); assert_ne!(query(None).await.unwrap(), email.terms.0); @@ -356,21 +349,21 @@ async fn a_query_against_an_undeclared_index_or_type_is_refused() { let notes_plan = users_plan.field("notes").unwrap(); assert_eq!( - plan_error(cipher.query(&34u32).using(&age_plan).index(Ope).await), + plan_error(cipher.query(op::Lt, &34u32).via(Ope).on(&age_plan).await), PlanError::IndexNotDeclared { field: "age".into(), index: "ope" } ); assert_eq!( - plan_error(cipher.query("x").using(¬es_plan).equality().await), + plan_error(cipher.query(op::Eq, "x").on(¬es_plan).await), PlanError::IndexNotDeclared { field: "notes".into(), index: "eq" } ); assert_eq!( - plan_error(cipher.query(&34u64).using(&age_plan).equality().await), + plan_error(cipher.query(op::Eq, &34u64).on(&age_plan).await), PlanError::FieldType { field: "age".into(), expected: "u32" @@ -402,19 +395,9 @@ async fn a_one_value_plan_writes_queries_by_type_and_reads_back() { assert_eq!(chained.terms.0, out.terms.0); assert_eq!(chained.terms.1.to_bytes(), out.terms.1.to_bytes()); - let eq = cipher - .query(&34u32) - .using(&age_plan) - .equality() - .await - .unwrap(); + let eq = cipher.query(op::Eq, &34u32).on(&age_plan).await.unwrap(); assert_eq!(eq, out.terms.0); - let ore = cipher - .query(&34u32) - .using(&age_plan) - .index::() - .await - .unwrap(); + let ore = cipher.query(op::Gte, &34u32).on(&age_plan).await.unwrap(); assert_eq!(ore.to_bytes(), out.terms.1.to_bytes()); // Byte-identical to the combinator, under the same label. @@ -510,7 +493,7 @@ async fn a_one_value_plan_extended_on_write_needs_the_extension_to_query_and_ope assert_eq!(sent.lock().unwrap().generated(), ["(users/age)/7u64"]); let query = |parts: Option| { - let chain = cipher.query(&34u32).using(&age_plan).equality(); + let chain = cipher.query(op::Eq, &34u32).on(&age_plan); match parts { Some(parts) => chain.extend(parts), None => chain, @@ -545,7 +528,7 @@ async fn an_index_only_field_matches_its_query_and_mints_no_data_key() { let (cipher, sent) = recording_cipher().await; let tokens_plan: Plan = Plan::context("users") .fields() - .index::("email", (Equality, Match::default())) + .index::("email", (Equality, Match)) .encrypt::("age") .encrypt::("notes") .passthrough::("id") @@ -561,9 +544,8 @@ async fn an_index_only_field_matches_its_query_and_mints_no_data_key() { let email_plan = tokens_plan.field("email").unwrap(); let query = cipher - .query("bob@example.com") - .using(&email_plan) - .equality() + .query(op::Eq, "bob@example.com") + .on(&email_plan) .await .unwrap(); assert_eq!(query, eq, "the query derives under the write's label"); @@ -861,9 +843,9 @@ async fn a_refused_chain_never_loads_the_keyset_it_names() { assert!(matches!( plan_error( cipher - .query(&34u32) - .using(&age_plan) - .index(Ope) + .query(op::Gt, &34u32) + .via(Ope) + .on(&age_plan) .keyset("tenant") .await ), @@ -963,13 +945,7 @@ async fn a_passthrough_name_need_not_be_a_label_segment() { let passthrough_plan = odd_plan.field("2fa_enabled").unwrap(); assert_eq!( - plan_error( - cipher - .query(&1u64) - .using(&passthrough_plan) - .equality() - .await - ), + plan_error(cipher.query(op::Eq, &1u64).on(&passthrough_plan).await), PlanError::IndexNotDeclared { field: "2fa_enabled".into(), index: "eq" @@ -1224,14 +1200,17 @@ async fn match_options_must_agree_for_a_query_to_be_declared() { } } } + impl stack_encrypt::op::MatchCase for Shingles { + type Case = op::CaseSensitive; + } let cipher = stack_cipher().await; let users_plan: Plan = users_plan(); let email_plan = users_plan.field("email").unwrap(); let refused = plan_error( cipher - .query("bob") - .using(&email_plan) - .index(Match::::new()) + .query(op::Matches.case_sensitive(), "bob") + .via(Match::::new()) + .on(&email_plan) .await, ); assert_eq!( @@ -1259,10 +1238,7 @@ async fn all_settles_several_chains_in_one_request() { let (row, probe) = stack_encrypt::all(( cipher.encrypt(&user).using(&users_plan), - cipher - .query("bob@example.com") - .using(&email_plan) - .equality(), + cipher.query(op::Eq, "bob@example.com").on(&email_plan), )) .await .unwrap(); @@ -1747,9 +1723,13 @@ async fn a_chain_shows_no_value() { format!("{:?}", cipher.encrypt(&secret).context("x").with(Equality)), format!("{:?}", cipher.encrypt(&user()).context("x").fields()), format!("{:?}", cipher.encrypt(&user()).using(&users_plan)), - format!("{:?}", cipher.query(&secret)), - format!("{:?}", cipher.query(&secret).using(&email_plan)), - format!("{:?}", cipher.query(&secret).using(&email_plan).equality()), + format!("{:?}", cipher.query(op::Eq, &secret)), + format!("{:?}", cipher.query(op::Eq, &secret).via(Equality)), + format!("{:?}", cipher.query(op::Eq, &secret).on(&email_plan)), + format!( + "{:?}", + cipher.query(op::Between, &(secret.clone(), secret.clone())) + ), format!("{:?}", cipher.open(secret.clone())), format!("{:?}", cipher.open(FieldValues::new()).using(&users_plan)), format!( @@ -1872,16 +1852,14 @@ async fn every_chain_honours_its_named_keyset() { let email: Encrypted = row.take("email").unwrap(); let email_plan = users_plan.field("email").unwrap(); let under_tenant = cipher - .query("bob@example.com") - .using(&email_plan) - .equality() + .query(op::Eq, "bob@example.com") + .on(&email_plan) .keyset("tenant") .await .unwrap(); let under_default = cipher - .query("bob@example.com") - .using(&email_plan) - .equality() + .query(op::Eq, "bob@example.com") + .on(&email_plan) .await .unwrap(); assert_eq!(under_tenant, email.terms.0); diff --git a/packages/stack-encrypt/tests/plan_grammar.rs b/packages/stack-encrypt/tests/plan_grammar.rs index e88397b63..3e2a77fcc 100644 --- a/packages/stack-encrypt/tests/plan_grammar.rs +++ b/packages/stack-encrypt/tests/plan_grammar.rs @@ -12,6 +12,7 @@ use std::sync::atomic::Ordering; use common::{counting_cipher, loads_counting_cipher, recording_cipher, stack_cipher}; use stack_encrypt::kms::FakeDataKeySource; +use stack_encrypt::op; use stack_encrypt::plan::{pick, Field, FieldKind, FieldValues, Fields, Opens, PlanError, Runs}; use stack_encrypt::sem::{ EqualityTerm, MatchConfig, MatchOptions, MatchTerms, OpeTerm, OreTerm, Tokenizer, @@ -141,10 +142,9 @@ async fn a_plan_built_without_a_context_takes_the_calls() { let stored: Encrypted = record.take("email").unwrap(); let query_value = cipher - .query("bob@example.com") + .query(op::Eq, "bob@example.com") .context("tenants/acme") - .using(&email_plan) - .equality() + .on(&email_plan) .await .unwrap(); assert_eq!( @@ -152,10 +152,9 @@ async fn a_plan_built_without_a_context_takes_the_calls() { "a query naming the same context matches" ); let elsewhere = cipher - .query("bob@example.com") + .query(op::Eq, "bob@example.com") .context("tenants/globex") - .using(&email_plan) - .equality() + .on(&email_plan) .await .unwrap(); assert_ne!(elsewhere, stored.terms); @@ -185,9 +184,8 @@ async fn a_plan_run_with_no_context_is_refused_before_any_key_request() { assert_eq!( plan_error( cipher - .query("bob@example.com") - .using(&users_plan.field("email").unwrap()) - .equality() + .query(op::Eq, "bob@example.com") + .on(&users_plan.field("email").unwrap()) .await ), PlanError::NoContext @@ -210,7 +208,7 @@ async fn a_plan_run_with_no_context_is_refused_before_any_key_request() { PlanError::NoContext ); assert_eq!( - plan_error(cipher.query(&34u32).using(&age_plan).equality().await), + plan_error(cipher.query(op::Eq, &34u32).on(&age_plan).await), PlanError::NoContext ); let age = cipher @@ -289,10 +287,9 @@ async fn a_context_given_twice_is_refused_at_the_call_before_any_key_request() { assert_eq!( plan_error( cipher - .query("bob@example.com") + .query(op::Eq, "bob@example.com") .context("users") - .using(&users_plan.field("email").unwrap()) - .equality() + .on(&users_plan.field("email").unwrap()) .await ), two("the plan", "the call") @@ -339,10 +336,9 @@ async fn a_context_given_twice_is_refused_at_the_call_before_any_key_request() { assert_eq!( plan_error( cipher - .query(&34u32) + .query(op::Eq, &34u32) .context("users/age") - .using(&age_plan) - .equality() + .on(&age_plan) .await ), two("the plan", "the call") @@ -365,10 +361,9 @@ async fn a_call_context_that_is_not_a_label_is_refused() { ))); assert!(bad(plan_error( cipher - .query("bob@example.com") + .query(op::Eq, "bob@example.com") .context("a//b") - .using(&users_plan.field("email").unwrap()) - .equality() + .on(&users_plan.field("email").unwrap()) .await ))); assert!(bad(plan_error( @@ -836,10 +831,9 @@ async fn a_context_field_is_the_context_of_every_other_field() { // A query names the context field's value. let query_value = cipher - .query("bob@example.com") + .query(op::Eq, "bob@example.com") .context("tenants/acme") - .using(&records_plan.field("email").unwrap()) - .equality() + .on(&records_plan.field("email").unwrap()) .await .unwrap(); assert_eq!(query_value, stored.terms); @@ -966,7 +960,7 @@ struct One { /// other plan. async fn same_field_bytes(value: F, indexes: X) where - F: Encrypt + Decrypt<'static> + Clone + Send + Sync + PartialEq + Debug + 'static, + F: Encrypt + Decrypt + Clone + Send + Sync + PartialEq + Debug + 'static, Terms: TermSet + PartialEq + Debug + Send, X: Indexes + Clone + Send + Sync + 'static, { @@ -1090,7 +1084,7 @@ fn a_five_index_field_is_refused_by_both_spellings() { .fields::, FakeDataKeySource>() .encrypt_index( pick("v", |o: &One| &o.v), - (Equality, Match::default(), Ore, Ope, Match::::new()), + (Equality, Match, Ore, Ope, Match::::new()), ) .build(); assert_eq!(plan_error(data), refused()); @@ -1128,38 +1122,35 @@ async fn a_typed_field_answers_the_queries_its_target_declares_and_no_other() { let email_plan = users_plan.field("email").unwrap(); let query_value = cipher - .query("bob@example.com") - .using(&email_plan) - .equality() + .query(op::Eq, "bob@example.com") + .on(&email_plan) .await .unwrap(); assert_eq!(query_value, stored.terms.0); let matched = cipher - .query("bob@example.com") - .using(&email_plan) - .index(Match::default()) + .query(op::Matches, "bob@example.com") + .on(&email_plan) .await .unwrap(); - assert_eq!(matched, stored.terms.1); + assert_eq!(matched.positions(), stored.terms.1.positions()); assert_eq!( plan_error( cipher - .query("bob@example.com") - .using(&email_plan) - .index(Ore) + .query(op::Lt, &34u32) + .via(Ope) + .on(&users_plan.field("age").unwrap()) .await ), PlanError::IndexNotDeclared { - field: "email".into(), - index: "ore" + field: "age".into(), + index: "ope" } ); assert_eq!( plan_error( cipher - .query(&34u32) - .using(&users_plan.field("age").unwrap()) - .equality() + .query(op::Eq, &34u32) + .on(&users_plan.field("age").unwrap()) .await ), PlanError::IndexNotDeclared { @@ -1183,9 +1174,8 @@ async fn a_typed_field_of_terms_alone_does_not_come_back() { let mut record = cipher.encrypt(&user()).using(&users_plan).await.unwrap(); let term: EqualityTerm = record.take("email").unwrap(); let query_value = cipher - .query("bob@example.com") - .using(&users_plan.field("email").unwrap()) - .equality() + .query(op::Eq, "bob@example.com") + .on(&users_plan.field("email").unwrap()) .await .unwrap(); assert_eq!(query_value, term); @@ -1332,23 +1322,22 @@ async fn a_one_value_typed_plan_answers_its_targets_queries_and_no_other() { let email = String::from("bob@example.com"); let (_, hm) = cipher.encrypt(&email).using(&email_plan).await.unwrap(); let query_value = cipher - .query("bob@example.com") - .using(&email_plan) - .equality() + .query(op::Eq, "bob@example.com") + .on(&email_plan) .await .unwrap(); assert_eq!(query_value, hm); assert_eq!( plan_error( cipher - .query("bob@example.com") - .using(&email_plan) - .index(Ore) + .query(op::Matches, "bob") + .via(Match) + .on(&email_plan) .await ), PlanError::IndexNotDeclared { field: "the value".into(), - index: "ore" + index: "match" } ); } @@ -1367,17 +1356,17 @@ async fn a_one_value_plan_quotes_no_call_context_in_its_refusals() { let error = plan_error( cipher - .query("bob@example.com") + .query(op::Matches, "bob") .context(marker) - .using(&plan) - .index(Ore) + .via(Match) + .on(&plan) .await, ); assert_eq!( error, PlanError::IndexNotDeclared { field: "the value".into(), - index: "ore" + index: "match" } ); let message = error.to_string(); @@ -1630,9 +1619,8 @@ async fn a_pinned_identity_rescues_a_field_name_that_is_not_plain() { ); let value: Encrypted = record.take("0").unwrap(); let query_value = cipher - .query(&21u32) - .using(&readings_plan.field("0").unwrap()) - .equality() + .query(op::Eq, &21u32) + .on(&readings_plan.field("0").unwrap()) .await .unwrap(); assert_eq!(query_value, value.terms); @@ -1683,10 +1671,9 @@ async fn a_pinned_identity_keys_a_call_context_plan_for_query_and_open() { assert_eq!(sent.lock().unwrap().generated(), ["reading/value"]); let stored: Encrypted = record.take("0").unwrap(); let query_value = cipher - .query(&21u32) + .query(op::Eq, &21u32) .context("reading") - .using(&readings_plan.field("0").unwrap()) - .equality() + .on(&readings_plan.field("0").unwrap()) .await .unwrap(); assert_eq!(query_value, stored.terms); diff --git a/packages/stack-encrypt/tests/query_operators.rs b/packages/stack-encrypt/tests/query_operators.rs new file mode 100644 index 000000000..71c76870c --- /dev/null +++ b/packages/stack-encrypt/tests/query_operators.rs @@ -0,0 +1,394 @@ +//! The query fixture: a query a binding names by operator derives the term +//! the typed query chain derives, and a probabilistic term's two questions +//! answer as the typed `MatchQuery` answers them (ADR-0009; ADR-0007, +//! amended 2026-10-16). `tests/fixtures/query_operators.json` records each +//! query's term, a page of verified values and a few fetch limits, so the +//! Go SDK's tests can hold the guest's `se_query_term`, `se_verify` and +//! `se_target_limit` exports to the same results; its README gives the +//! schema. +//! +//! Every query derives under the deterministic key source the record +//! fixture uses, whose index key is `FakeDataKeySource`'s, so nothing in the +//! file depends on a nonce: a run that derives other bytes fails, and +//! `STACK_ENCRYPT_UPDATE_FIXTURES=1 cargo test --test query_operators +//! --all-features` rewrites the file when a derivation changes on purpose. +#![cfg(feature = "dynamic")] + +mod common; + +use std::path::PathBuf; + +use common::frames::{frame, object}; +use common::{deterministic_cipher, DeterministicSource}; +use serde_json::{json, Value as Json}; +use stack_encrypt::dynamic::{self, record, NoTargets, OpSpec, Operand, QueryTerm, ValueFrame}; +use stack_encrypt::op::{self, Limit, Probabilistic, Stats}; +use stack_encrypt::{Equality, KeysetCipher, Match, Ore, Plan, StackCipher}; +use vitaminc_aead::plaintext::{Physical, Raw}; + +const SEED: [u8; 32] = *b"stack-encrypt record fixture v1 "; + +/// The declaration every query runs on, in the data grammar. +fn plan_json() -> Json { + json!({ + "email": { "context": ["users", "email"], "outputs": ["c", "eq"], "type": "string" }, + "age": { "context": ["users", "age"], "outputs": ["c", "eq", "ore"], "type": "uint32" }, + "name": { "context": ["users", "name"], "outputs": ["c", "match"], "type": "string" }, + "score": { "context": ["users", "score"], "outputs": ["c", "ore"], "type": "float64" } + }) +} + +/// Each query: a field, an operator and its input, as a binding sends them. +fn queries() -> Vec<(&'static str, OpSpec, Json)> { + vec![ + ("email", OpSpec::Eq, json!("bob@example.com")), + ("age", OpSpec::Eq, json!(34)), + ("age", OpSpec::Lt, json!(40)), + ("age", OpSpec::Lte, json!(40)), + ("age", OpSpec::Gt, json!(18)), + ("age", OpSpec::Gte, json!(18)), + ("age", OpSpec::Between, json!([18, 65])), + ("name", OpSpec::Matches, json!("alice")), + ("name", OpSpec::Matches, json!("ali")), + ("score", OpSpec::Lt, json!(1.5)), + ("score", OpSpec::Between, json!([-0.5, 2.5])), + ] +} + +/// The page `verify` answers for `matches "alice"` on `name`. +fn page() -> Json { + json!(["Alice Smith", "alicia", "Bob", "malice", "ALICE", null]) +} + +/// The statistics each recorded limit is sized under. +fn stats_cases() -> Vec<(Json, Stats)> { + vec![ + ( + json!({ "rows": 1_000_000, "histogram": [[40, 500_000], [120, 500_000]] }), + Stats::measured(1_000_000, [(40, 500_000), (120, 500_000)]), + ), + ( + json!({ "rows": 1_000_000, "histogram": [[40, 1_000_000]], "confidence": 0.5 }), + Stats::measured(1_000_000, [(40, 1_000_000)]).with_confidence(0.5), + ), + (json!({ "rows": 1_000_000 }), Stats::declared(1_000_000)), + ] +} + +/// A plan written as JSON, as frame bytes: what a binding sends. +fn frame_of_json(value: &Json) -> Vec { + vitaminc_aead_frame::serde::to_vec(value).expect("frames") +} + +/// A JSON value as the frame a binding sends: a number is a `u64` when it +/// is one, else an `f64`. +fn frame_of_value(value: &Json) -> ValueFrame { + match value { + Json::Null => frame(Raw(None, Physical::Null)), + Json::String(s) => frame(s.as_str()), + Json::Array(items) => frame(items.iter().map(frame_of_value).collect::>()), + Json::Object(entries) => object( + entries + .iter() + .map(|(k, v)| (k.as_str(), frame_of_value(v))) + .collect(), + ), + Json::Number(n) => match n.as_u64() { + Some(n) => frame(n), + None => frame(n.as_f64().expect("a number")), + }, + Json::Bool(b) => frame(*b), + } +} + +fn hex(bytes: &[u8]) -> String { + bytes.iter().map(|b| format!("{b:02x}")).collect() +} + +/// A query term as the fixture holds it: the wire form's keys, the bytes in +/// hex. +fn json_of_term(term: &QueryTerm) -> Json { + json!({ + "operator": term.operator().name(), + "fidelity": term.fidelity().name(), + "index": term.index().key(), + "domain": term.domain(), + "term": match term.operand() { + Operand::One(bytes) => json!(hex(bytes)), + Operand::Range { lo, hi } => json!([hex(lo), hex(hi)]), + }, + }) +} + +fn limit_json(limit: Limit) -> Json { + limit.rows().map_or(Json::Null, |rows| json!(rows)) +} + +/// The typed chain's term for the same query, as the operand's bytes: the +/// proof that the data path derives what a Rust caller does. +async fn typed_operand( + cipher: &StackCipher, + field: &str, + operator: OpSpec, + input: &Json, +) -> Operand { + let int = |value: &Json| u32::try_from(value.as_u64().expect("an integer")).expect("a u32"); + let text = |value: &Json| value.as_str().expect("text").to_owned(); + let age = Plan::context("users/age") + .with::((Equality, Ore)) + .build() + .expect("plan"); + let one = Operand::One; + match (field, operator) { + ("email", OpSpec::Eq) => { + let plan = Plan::context("users/email") + .with::(Equality) + .build() + .expect("plan"); + one(cipher + .query(op::Eq, &text(input)) + .on(&plan) + .await + .expect("eq") + .to_bytes()) + } + ("age", OpSpec::Eq) => one(cipher + .query(op::Eq, &int(input)) + .on(&age) + .await + .expect("eq") + .to_bytes()), + ("age", OpSpec::Lt) => one(cipher + .query(op::Lt, &int(input)) + .on(&age) + .await + .expect("lt") + .to_bytes()), + ("age", OpSpec::Lte) => one(cipher + .query(op::Lte, &int(input)) + .on(&age) + .await + .expect("lte") + .to_bytes()), + ("age", OpSpec::Gt) => one(cipher + .query(op::Gt, &int(input)) + .on(&age) + .await + .expect("gt") + .to_bytes()), + ("age", OpSpec::Gte) => one(cipher + .query(op::Gte, &int(input)) + .on(&age) + .await + .expect("gte") + .to_bytes()), + ("age", OpSpec::Between) => { + let range = cipher + .query(op::Between, &(int(&input[0]), int(&input[1]))) + .on(&age) + .await + .expect("between"); + Operand::Range { + lo: range.lo().to_bytes(), + hi: range.hi().to_bytes(), + } + } + ("name", OpSpec::Matches) => one(typed_match(cipher, &text(input)).await.to_bytes()), + ("score", operator) => { + let float = |value: &Json| value.as_f64().expect("a number"); + let score = Plan::context("users/score") + .with::(Ore) + .build() + .expect("plan"); + match operator { + OpSpec::Lt => one(cipher + .query(op::Lt, &float(input)) + .on(&score) + .await + .expect("lt") + .to_bytes()), + OpSpec::Between => { + let range = cipher + .query(op::Between, &(float(&input[0]), float(&input[1]))) + .on(&score) + .await + .expect("between"); + Operand::Range { + lo: range.lo().to_bytes(), + hi: range.hi().to_bytes(), + } + } + other => panic!("no typed score query for {other}"), + } + } + other => panic!("no typed query for {other:?}"), + } +} + +async fn typed_match( + cipher: &StackCipher, + input: &str, +) -> stack_encrypt::sem::MatchQuery { + let plan = Plan::context("users/name") + .with::(Match::default()) + .build() + .expect("plan"); + cipher + .query(op::Matches, input) + .on(&plan) + .await + .expect("matches") +} + +async fn data_term( + keyset: &KeysetCipher<'_, DeterministicSource>, + plan: &record::Plan, + field: &str, + operator: OpSpec, + input: &Json, +) -> QueryTerm { + dynamic::query_term( + keyset, + plan, + field, + operator, + frame_of_value(input), + &NoTargets, + ) + .expect("the query is answered") + .await + .expect("the term derives") +} + +/// The fixture as this run derives it, checked against the typed path as +/// it is built. +async fn derived() -> Json { + let cipher = deterministic_cipher(SEED).await; + let keyset = cipher.default_keyset(); + let plan = record::plan(&frame_of_json(&plan_json())).expect("the plan parses"); + + let mut terms = Vec::new(); + for (field, operator, input) in queries() { + let term = data_term(&keyset, &plan, field, operator, &input).await; + assert_eq!( + term.operand(), + &typed_operand(&cipher, field, operator, &input).await, + "{operator} on {field}: the data path derives the typed chain's term" + ); + terms.push(json!({ + "field": field, + "operator": operator.name(), + "input": input, + "term": json_of_term(&term), + })); + } + + let typed = typed_match(&cipher, "alice").await; + let values: Vec = page() + .as_array() + .expect("a list") + .iter() + .map(frame_of_value) + .collect(); + let verified = dynamic::verify( + &plan, + "name", + OpSpec::Matches, + frame_of_value(&json!("alice")), + &values, + &NoTargets, + ) + .expect("verify"); + let typed_verified: Vec = page() + .as_array() + .expect("a list") + .iter() + .map(|value| value.as_str().is_some_and(|text| typed.verify(text))) + .collect(); + assert_eq!(verified, typed_verified, "verify is the typed MatchQuery's"); + + let mut limits = Vec::new(); + for input in ["ali", "alice"] { + let term = data_term(&keyset, &plan, "name", OpSpec::Matches, &json!(input)).await; + let Operand::One(bytes) = term.operand() else { + panic!("a match term is one term"); + }; + let typed = typed_match(&cipher, input).await; + for (stats_json, stats) in stats_cases() { + let read = + Stats::from_frame(frame_of_value(&stats_json).risky_ref()).expect("stats read"); + assert_eq!(read, stats, "the wire form reads as the typed stats"); + let limit = + dynamic::target_limit(&plan, "name", OpSpec::Matches, bytes, 10, &read, &NoTargets) + .expect("a limit"); + assert_eq!( + limit, + typed.target_limit(10, &stats), + "target_limit is the typed MatchQuery's" + ); + limits.push(json!({ + "field": "name", + "operator": "matches", + "input": input, + "term": hex(bytes), + "want": 10, + "stats": stats_json, + "limit": limit_json(limit), + })); + } + } + + json!({ + "_comment": "Query terms derived by operator through the data path (stack_encrypt::dynamic::query_term), each equal to the typed query chain's, with a verified page and fetch limits. Read by tests/query_operators.rs and the Go SDK's tests; the schema is in README.md beside this file. Regenerate with STACK_ENCRYPT_UPDATE_FIXTURES=1; do not edit by hand.", + "key_source": { "kind": "deterministic-sha256", "seed": hex(&SEED) }, + "keyset_id": keyset.keyset_id().to_string(), + "plan": plan_json(), + "queries": terms, + "verify": { + "field": "name", + "operator": "matches", + "input": "alice", + "values": page(), + "verified": verified, + }, + "target_limit": limits, + }) +} + +fn fixture_path() -> PathBuf { + PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/query_operators.json") +} + +/// The committed fixture is what this run derives. With +/// `STACK_ENCRYPT_UPDATE_FIXTURES=1` it is written first. +#[tokio::test] +async fn the_committed_query_fixture_is_what_the_engine_derives() { + let now = derived().await; + let path = fixture_path(); + if std::env::var_os("STACK_ENCRYPT_UPDATE_FIXTURES").is_some() { + let mut text = serde_json::to_string_pretty(&now).expect("serialise"); + text.push('\n'); + std::fs::write(&path, text).expect("write the fixture"); + } + let committed: Json = + serde_json::from_str(&std::fs::read_to_string(&path).expect("the fixture is committed")) + .expect("the fixture is JSON"); + assert_eq!(committed, now, "the committed query fixture is today's"); +} + +/// The fixture pins more than one answer of each kind: a verified page +/// with both outcomes, and limits both finite and unbounded. +#[tokio::test] +async fn the_fixture_pins_both_outcomes() { + let now = derived().await; + let verified = now["verify"]["verified"].as_array().expect("a list"); + assert!(verified.contains(&json!(true)) && verified.contains(&json!(false))); + let limits: Vec<&Json> = now["target_limit"] + .as_array() + .expect("a list") + .iter() + .map(|case| &case["limit"]) + .collect(); + assert!(limits.iter().any(|limit| limit.is_u64())); + assert!(limits.iter().any(|limit| limit.is_null())); +} diff --git a/packages/stack-encrypt/tests/record_lowering.rs b/packages/stack-encrypt/tests/record_lowering.rs index dce2f8a5c..16dbcbdd4 100644 --- a/packages/stack-encrypt/tests/record_lowering.rs +++ b/packages/stack-encrypt/tests/record_lowering.rs @@ -1,10 +1,10 @@ //! The record fixture is the proof of the lowering (ADR-0007, amended //! 2026-10-06): a Rust chain and the data-plan lowering each open the //! records the other sealed, and both derive the same bytes for each term. -//! The chain's fields are `dynamic::Value`s, the plaintext type a binding's +//! The chain's fields are `dynamic::ValueFrame`s, the plaintext type a binding's //! values have, so the two authors write one declaration over one type; a -//! chain over bare `u32`/`String` fields shares the terms and not the leaves -//! (see `dynamic::record`). `tests/fixtures/record_lowering.json` holds one +//! chain over bare `u32`/`String` fields seals the same tagged leaves (see +//! `dynamic::record`). `tests/fixtures/record_lowering.json` holds one //! record from each author, sealed under a deterministic key source so the //! bytes open in any process, and its README gives the schema a Go test //! reads later. @@ -26,35 +26,36 @@ mod common; use std::collections::BTreeMap; use std::path::PathBuf; +use common::frames::{frame, object, payload}; use common::{deterministic_cipher, DeterministicSource}; use serde_json::{json, Map, Value as Json}; use stack_encrypt::dynamic::record::{self, Plan as DataPlan}; -use stack_encrypt::dynamic::{FfiValue, Scope, TermBytes, Value}; +use stack_encrypt::dynamic::{Scope, TermBytes, ValueFrame, ValueKind}; use stack_encrypt::plan::{pick, FieldValues}; use stack_encrypt::sem::MatchOptions; use stack_encrypt::target::{Encrypted, IndexSpec}; use stack_encrypt::{CipherText, Error, Label, Plan, SealedValue, StackCipher, StackCipherText}; -use vitaminc_protected::Controlled; +use vitaminc_aead_frame::serde::from_slice; const SEED: [u8; 32] = *b"stack-encrypt record fixture v1 "; struct User { - age: Value, - email: Value, - notes: Value, + age: ValueFrame, + email: ValueFrame, + notes: ValueFrame, id: u32, } fn user() -> User { User { - age: Value::new(FfiValue::UInt32(34)), - email: Value::new(FfiValue::String("bob@example.com".into())), - notes: Value::new(FfiValue::String("likes cats".into())), + age: frame(34u32), + email: frame("bob@example.com"), + notes: frame("likes cats"), id: 42, } } -/// The one declaration, as the Rust chain writes it over `Value` fields. +/// The one declaration, as the Rust chain writes it over `ValueFrame` fields. fn typed_plan() -> Plan { Plan::context("users") .fields() @@ -89,60 +90,79 @@ fn plaintext_json() -> Json { json!({ "age": 34, "email": "bob@example.com", "notes": "likes cats", "id": 42 }) } -// ---- JSON <-> FfiValue, for the subset the fixture uses -------------------- +// ---- JSON <-> frames, for the subset the fixture uses --------------------- -fn ffi_of_json(value: &Json) -> FfiValue { - match value { - Json::String(s) => FfiValue::String(s.as_str().into()), - Json::Array(items) => FfiValue::Array(items.iter().map(ffi_of_json).collect()), - Json::Object(entries) => FfiValue::Object( - entries - .iter() - .map(|(k, v)| (k.clone(), ffi_of_json(v))) - .collect(), - ), - Json::Number(n) => FfiValue::UInt64(n.as_u64().expect("a non-negative integer")), - other => panic!("the fixture does not use {other}"), - } +/// A plan written as JSON, as frame bytes: what a binding sends. +fn frame_of_json(value: &Json) -> Vec { + vitaminc_aead_frame::serde::to_vec(value).expect("frames") } /// The plaintext as the binding sends it: each field at the kind the plan /// declares for it. -fn source_of(plaintext: &Json, plan: &DataPlan) -> FfiValue { +fn source_of(plaintext: &Json, plan: &DataPlan) -> ValueFrame { let fields = plaintext.as_object().expect("an object"); - FfiValue::Object( + object( plan.fields() .iter() .map(|field| { let value = &fields[field.name()]; let value = match field.field_type().expect("every fixture field is typed") { - stack_encrypt::dynamic::ValueKind::UInt32 => FfiValue::UInt32( + stack_encrypt::dynamic::ValueKind::UInt32 => frame( u32::try_from(value.as_u64().expect("an integer")).expect("fits a u32"), ), stack_encrypt::dynamic::ValueKind::String => { - FfiValue::String(value.as_str().expect("text").into()) + frame(value.as_str().expect("text")) } other => panic!("the fixture does not use {other}"), }; - (field.name().to_string(), value) + (field.name(), value) }) .collect(), ) } -fn json_of_opened(value: FfiValue) -> Json { - match value { - FfiValue::Object(entries) => Json::Object( - entries - .into_iter() - .map(|(k, v)| (k, json_of_opened(v))) - .collect(), - ), - FfiValue::UInt32(v) => json!(v), - FfiValue::String(s) => { - Json::String(String::from_utf8(s.risky_ref().to_vec()).expect("utf8")) +/// An opened value, read back from its frame as JSON. +fn json_of_opened(value: ValueFrame) -> Json { + exact(value.risky_ref()) +} + +/// A frame read as JSON, holding the fixture's kinds and nothing else: an +/// object, a `u32` or text. Another kind, a `u64` or a `u8` included, fails +/// the test, so both authors are held to the width the plan declares. +fn exact(frame: &[u8]) -> Json { + from_slice::(frame) + .expect("an object, a u32 or text") + .0 +} + +struct Exact(Json); + +impl<'de> serde::Deserialize<'de> for Exact { + fn deserialize>(d: D) -> Result { + struct V; + impl<'de> serde::de::Visitor<'de> for V { + type Value = Exact; + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("an object, a u32 or text") + } + fn visit_u32(self, v: u32) -> Result { + Ok(Exact(json!(v))) + } + fn visit_str(self, v: &str) -> Result { + Ok(Exact(json!(v))) + } + fn visit_map>( + self, + mut map: A, + ) -> Result { + let mut out = Map::new(); + while let Some((key, Exact(value))) = map.next_entry::()? { + let _ = out.insert(key, value); + } + Ok(Exact(Json::Object(out))) + } } - _ => panic!("the fixture does not use this kind"), + d.deserialize_any(V) } } @@ -178,19 +198,13 @@ fn json_of_record(tree: StackCipherText) -> Json { let value = match (key.as_str(), node) { ("c", CipherText::Single(leaf)) => json!(hex(&leaf.to_bytes())), ("passthrough", CipherText::Passthrough(payload)) => { - match *payload.downcast::().expect("a value") { - FfiValue::UInt32(v) => json!(v), - FfiValue::String(s) => { - json!(String::from_utf8(s.risky_ref().to_vec()).expect("utf8")) - } - _ => panic!("the fixture's passthroughs are a u32 and text"), - } + // The fixture's passthroughs are a u32 and text. + exact(&payload.0) } (_, CipherText::Passthrough(payload)) => { - match *payload.downcast::().expect("a value") { - FfiValue::Bytes(bytes) => json!(hex(bytes.risky_ref())), - _ => panic!("a term is bytes"), - } + json!(hex( + from_slice::<&[u8]>(&payload.0).expect("a term is bytes") + )) } (key, _) => panic!("unexpected output {key}"), }; @@ -201,6 +215,11 @@ fn json_of_record(tree: StackCipherText) -> Json { Json::Object(out) } +/// A value as a passthrough node: its frame, in the clear. +fn passthrough(value: T) -> StackCipherText { + CipherText::Passthrough(stack_encrypt::PassthroughFrame(payload(value))) +} + fn record_of_json(record: &Json) -> StackCipherText { let fields = record.as_object().expect("an object"); CipherText::Map( @@ -216,20 +235,14 @@ fn record_of_json(record: &Json) -> StackCipherText { SealedValue::from_bytes(&unhex(value.as_str().expect("hex"))) .expect("a frozen leaf"), ), - "passthrough" => CipherText::Passthrough(Box::new(match value { - Json::String(text) => FfiValue::String(text.as_str().into()), - _ => FfiValue::UInt32( + "passthrough" => passthrough(match value { + Json::String(text) => frame(text.as_str()), + _ => frame( u32::try_from(value.as_u64().expect("an integer")) .expect("u32"), ), - }) - as stack_encrypt::BoxedPassthrough), - _ => CipherText::Passthrough(Box::new(FfiValue::Bytes( - vitaminc_protected::Protected::new(unhex( - value.as_str().expect("hex"), - )), - )) - as stack_encrypt::BoxedPassthrough), + }), + _ => passthrough(unhex(value.as_str().expect("hex"))), }; (key.clone(), node) }) @@ -247,12 +260,7 @@ fn record_of_typed(mut values: FieldValues) -> StackCipherText { let email: Encrypted<(TermBytes, TermBytes)> = values.take("email").expect("email"); let notes: StackCipherText = values.take("notes").expect("notes"); let id: u32 = values.take("id").expect("id"); - let term = |bytes: Vec| -> StackCipherText { - CipherText::Passthrough( - Box::new(FfiValue::Bytes(vitaminc_protected::Protected::new(bytes))) - as stack_encrypt::BoxedPassthrough, - ) - }; + let term = |bytes: Vec| -> StackCipherText { passthrough(bytes) }; CipherText::Map(vec![ ( "age".into(), @@ -273,12 +281,7 @@ fn record_of_typed(mut values: FieldValues) -> StackCipherText { ("notes".into(), CipherText::Map(vec![("c".into(), notes)])), ( "id".into(), - CipherText::Map(vec![( - "passthrough".into(), - CipherText::Passthrough( - Box::new(FfiValue::UInt32(id)) as stack_encrypt::BoxedPassthrough - ), - )]), + CipherText::Map(vec![("passthrough".into(), passthrough(id))]), ), ]) } @@ -303,10 +306,8 @@ fn typed_of_record(tree: StackCipherText) -> FieldValues { let CipherText::Passthrough(payload) = node else { panic!("a passthrough node"); }; - let FfiValue::UInt32(id) = *payload.downcast::().expect("a value") - else { - panic!("a u32"); - }; + let id: u32 = from_slice(&payload.0).expect("a u32"); + assert_eq!(payload.0, common::frames::payload(id), "the id is a u32"); let _ = values.insert(&name, id); } _ => {} @@ -366,8 +367,7 @@ async fn open_typed(cipher: &StackCipher, tree: StackCipher .using(&typed_plan()) .await .expect("the typed chain opens it"); - let mut value = - |name: &str| json_of_opened(opened.take::(name).expect(name).into_inner()); + let mut value = |name: &str| json_of_opened(opened.take::(name).expect(name)); let (age, email, notes) = (value("age"), value("email"), value("notes")); json!({ "age": age, @@ -395,7 +395,7 @@ async fn open_lowered( #[tokio::test] async fn the_chain_and_the_lowering_are_one_engine_today() { let cipher = deterministic_cipher(SEED).await; - let plan = record::plan(ffi_of_json(&data_plan_json())).expect("the data plan parses"); + let plan = record::plan(&frame_of_json(&data_plan_json())).expect("the data plan parses"); let typed = json_of_record(seal_typed(&cipher).await); let lowered = json_of_record(seal_lowered(&cipher, &plan).await); @@ -425,7 +425,7 @@ async fn the_chain_and_the_lowering_are_one_engine_today() { #[tokio::test] async fn the_committed_fixture_opens_both_ways() { let cipher = deterministic_cipher(SEED).await; - let plan = record::plan(ffi_of_json(&data_plan_json())).expect("the data plan parses"); + let plan = record::plan(&frame_of_json(&data_plan_json())).expect("the data plan parses"); let path = fixture_path(); if std::env::var_os("STACK_ENCRYPT_UPDATE_FIXTURES").is_some() { @@ -524,15 +524,15 @@ fn write_fixture(path: &PathBuf, fixture: &Json) { /// context, `text` is sealed and indexed under `/text`, `id` is /// carried through. struct Note { - tenant: Value, - text: Value, + tenant: ValueFrame, + text: ValueFrame, id: u32, } fn note() -> Note { Note { - tenant: Value::new(FfiValue::String("tenants/acme".into())), - text: Value::new(FfiValue::String("hello".into())), + tenant: frame("tenants/acme"), + text: frame("hello"), id: 42, } } @@ -573,38 +573,24 @@ fn globex() -> Label { /// The typed chain's note record, shaped as the stored tree. fn record_of_note(mut values: FieldValues) -> StackCipherText { - let tenant: Value = values.take("tenant").expect("tenant"); + let tenant: ValueFrame = values.take("tenant").expect("tenant"); let text: Encrypted = values.take("text").expect("text"); let id: u32 = values.take("id").expect("id"); - let passthrough = |value: FfiValue| -> StackCipherText { - CipherText::Passthrough(Box::new(value) as stack_encrypt::BoxedPassthrough) - }; CipherText::Map(vec![ ( "tenant".into(), - CipherText::Map(vec![( - "passthrough".into(), - passthrough(tenant.into_inner()), - )]), + CipherText::Map(vec![("passthrough".into(), passthrough(tenant))]), ), ( "text".into(), CipherText::Map(vec![ ("c".into(), text.ciphertext), - ( - "eq".into(), - passthrough(FfiValue::Bytes(vitaminc_protected::Protected::new( - text.terms.into_bytes(), - ))), - ), + ("eq".into(), passthrough(text.terms.into_bytes())), ]), ), ( "id".into(), - CipherText::Map(vec![( - "passthrough".into(), - passthrough(FfiValue::UInt32(id)), - )]), + CipherText::Map(vec![("passthrough".into(), passthrough(id))]), ), ]) } @@ -628,12 +614,16 @@ fn note_of_record(tree: StackCipherText) -> FieldValues { let CipherText::Passthrough(payload) = node else { panic!("a passthrough node"); }; - match *payload.downcast::().expect("a value") { - FfiValue::UInt32(id) => { + // The id is a u32; the tenant is text, kept as its frame. + match from_slice::(&payload.0) { + Ok(id) => { + assert_eq!(payload.0, common::frames::payload(id), "the id is a u32"); let _ = values.insert(&name, id); } - text => { - let _ = values.insert(&name, Value::new(text)); + Err(_) => { + let text = ValueFrame::from_bytes(&payload.0).expect("a value"); + assert_eq!(text.kind(), Some(ValueKind::String), "the tenant is text"); + let _ = values.insert(&name, text); } } } @@ -679,8 +669,7 @@ async fn open_note_typed( Some(expected) => open.context(expected).using(¬e_plan()).await?, None => open.using(¬e_plan()).await?, }; - let mut value = - |name: &str| json_of_opened(opened.take::(name).expect(name).into_inner()); + let mut value = |name: &str| json_of_opened(opened.take::(name).expect(name)); let (tenant, text) = (value("tenant"), value("text")); Ok(json!({ "tenant": tenant, "text": text, "id": opened.take::("id").expect("id") })) } @@ -704,7 +693,7 @@ async fn open_note_lowered( #[tokio::test] async fn the_chain_and_the_lowering_agree_on_a_context_field_today() { let cipher = deterministic_cipher(SEED).await; - let plan = record::plan(ffi_of_json(¬e_plan_json())).expect("the data plan parses"); + let plan = record::plan(&frame_of_json(¬e_plan_json())).expect("the data plan parses"); assert_eq!(plan.context_field(), Some("tenant")); let typed = json_of_record(seal_note_typed(&cipher).await); @@ -751,7 +740,7 @@ async fn the_chain_and_the_lowering_agree_on_a_context_field_today() { #[tokio::test] async fn the_committed_context_field_case_opens_both_ways() { let cipher = deterministic_cipher(SEED).await; - let plan = record::plan(ffi_of_json(¬e_plan_json())).expect("the data plan parses"); + let plan = record::plan(&frame_of_json(¬e_plan_json())).expect("the data plan parses"); let path = fixture_path(); if std::env::var_os("STACK_ENCRYPT_UPDATE_FIXTURES").is_some() { @@ -823,7 +812,7 @@ async fn the_committed_context_field_case_opens_both_ways() { #[tokio::test] async fn the_fixture_records_are_bound_to_their_labels() { let cipher = deterministic_cipher(SEED).await; - let plan = record::plan(ffi_of_json(&data_plan_json())).expect("plan"); + let plan = record::plan(&frame_of_json(&data_plan_json())).expect("plan"); let sealed = seal_lowered(&cipher, &plan).await; let CipherText::Map(mut fields) = sealed else { panic!("a map"); diff --git a/packages/stack-encrypt/tests/roundtrip.rs b/packages/stack-encrypt/tests/roundtrip.rs index 985f65792..def78a5a3 100644 --- a/packages/stack-encrypt/tests/roundtrip.rs +++ b/packages/stack-encrypt/tests/roundtrip.rs @@ -6,12 +6,10 @@ use std::collections::HashMap; -use stack_encrypt::{ - BoxedPassthrough, Cipher, CipherText, ContextTag, Element, Encrypt, IntoAad, SealedValue, - StackCipher, -}; +use stack_encrypt::{CipherText, ContextTag, Encrypt, PassthroughFrame, SealedValue, StackCipher}; use stack_kms::FakeDataKeySource; -use vitaminc_aead::{MapCipher, Passthrough}; +use vitaminc_aead::plaintext::{MapSink, Sink}; +use vitaminc_aead::Decrypt; use vitaminc_protected::{Controlled, Protected}; async fn cipher() -> StackCipher { @@ -126,9 +124,8 @@ async fn option_none_roundtrips() { #[tokio::test] async fn protected_roundtrip() { - // Exercises the `Protected` Decrypt impl, the sole user of `Decipher::map_ok`. - // (`Vec` would encrypt element-wise as a sequence of `u8`, not as bytes, - // so a string leaf is used here.) + // Exercises the `Protected` Decrypt impl, which builds the value inside + // the wrapper. let cipher = cipher().await; let keyset = cipher.default_keyset(); let secret = Protected::new("classified".to_string()); @@ -150,12 +147,15 @@ async fn nested_vec_roundtrips() { assert_eq!(pt, nested); } +/// The context a `ContextTag` binds is an AAD like any other: a value +/// sealed under `ContextTag::aad(tag)` opens under the same, and only the +/// same, tag. #[tokio::test] async fn context_tag_binds_and_roundtrips() { let cipher = cipher().await; let keyset = cipher.default_keyset(); let ct = keyset - .encrypt(ContextTag::new("token".to_string(), "user:42"), ()) + .encrypt("token".to_string(), ContextTag::aad("user:42")) .await .expect("encrypt"); @@ -172,7 +172,7 @@ async fn context_tag_wrong_context_fails() { let cipher = cipher().await; let keyset = cipher.default_keyset(); let ct = keyset - .encrypt(ContextTag::new("token".to_string(), "user:42"), ()) + .encrypt("token".to_string(), ContextTag::aad("user:42")) .await .expect("encrypt"); @@ -218,8 +218,7 @@ async fn empty_marker_does_not_decode_under_wrong_aad() { } /// A hand-written record carrying one field in the clear, through the -/// type-erased `passthrough_entry_boxed` a cipher-generic `Encrypt` has to -/// use. +/// sink's passthrough. struct Row { id: u32, email: String, @@ -244,21 +243,26 @@ impl Row { } impl Encrypt for Row { - fn encrypt_with_aad<'a, C, A>(self, cipher: C, aad: A) -> Result - where - C: Cipher, - A: IntoAad<'a>, - { - let mut map = cipher - .encrypt_map(aad) - .passthrough_entry_boxed("id", Box::new(self.id))?; + fn visit(self, sink: S) -> Result { + let mut map = sink.map(None)?; + map.entry("id")?.passthrough(self.id)?; if self.repeat_id { - map = map.passthrough_entry_boxed("id", Box::new(self.id))?; + map.entry("id")?.passthrough(self.id)?; } - map.encrypt_entry("email", self.email)?.end() + self.email.visit(map.entry("email")?)?; + map.end() } } +/// A passthrough payload: the frame of `value`, in the clear. +fn clear(value: u32) -> PassthroughFrame { + PassthroughFrame( + vitaminc_aead::to_frame(value) + .expect("a u32 frames") + .risky_unwrap(), + ) +} + /// A passthrough entry lands in the map as given, beside the sealed ones; /// a key given twice is refused like any repeated map key, since a map the /// cipher would refuse to open must never be produced. @@ -271,10 +275,15 @@ async fn a_passthrough_map_entry_is_stored_in_the_clear_once() { panic!("a record encrypts as a map: {ct:?}"); }; let entry = |name: &str| entries.iter().find(|(key, _)| key == name).map(|(_, v)| v); - assert!( - matches!(entry("id"), Some(CipherText::Passthrough(v)) if v.downcast_ref::() == Some(&7)), - "{entries:?}" - ); + let Some(CipherText::Passthrough(id)) = entry("id") else { + panic!("the id rides in the clear: {entries:?}"); + }; + let id = id + .parse() + .expect("one frame") + .visit(u32::sink()) + .expect("a u32"); + assert_eq!(id, 7, "the passthrough carries the value as given"); assert!( matches!(entry("email"), Some(CipherText::Single(_))), "{entries:?}" @@ -288,12 +297,11 @@ async fn a_passthrough_map_entry_is_stored_in_the_clear_once() { /// none — no entries at all, or only passthroughs, which carry no tag — /// would verify under *any* AAD. The encrypt side never produces one /// (emptiness is the authenticated `Empty*` marker); the decrypt side must -/// refuse to open one, even for a type that reads passthroughs back. +/// refuse to open one, on the tree's shape, before any sink sees it. #[tokio::test] async fn a_container_with_nothing_sealed_in_it_does_not_open() { let cipher = cipher().await; let aad = b"users".as_slice(); - let clear = |value: u32| CipherText::Passthrough(Box::new(value) as BoxedPassthrough); let result: Result, _> = cipher.decrypt(CipherText::Sequence(vec![]), aad).await; assert!(result.is_err(), "an entry-less sequence proves nothing"); @@ -301,15 +309,24 @@ async fn a_container_with_nothing_sealed_in_it_does_not_open() { cipher.decrypt(CipherText::Map(vec![]), aad).await; assert!(result.is_err(), "an entry-less map proves nothing"); - let result: Result>, _> = cipher - .decrypt(CipherText::Sequence(vec![clear(1), clear(2)]), aad) + let result: Result, _> = cipher + .decrypt( + CipherText::Sequence(vec![ + CipherText::Passthrough(clear(1)), + CipherText::Passthrough(clear(2)), + ]), + aad, + ) .await; assert!( result.is_err(), "an all-passthrough sequence proves nothing" ); - let result: Result>, _> = cipher - .decrypt(CipherText::Map(vec![("id".to_string(), clear(1))]), aad) + let result: Result, _> = cipher + .decrypt( + CipherText::Map(vec![("id".to_string(), CipherText::Passthrough(clear(1)))]), + aad, + ) .await; assert!(result.is_err(), "an all-passthrough map proves nothing"); } @@ -360,94 +377,6 @@ async fn sequence_element_cannot_be_rehomed_as_scalar() { ); } -#[tokio::test] -async fn element_roundtrips_under_bare_caller_aad() { - // `Element` derives `for_sequence_element` inside its own Encrypt/Decrypt - // impls. Both sides must honour that derivation: the decipher opens the leaf - // under the AAD the Decrypt drive supplies, not a pre-derived one. - let cipher = cipher().await; - let keyset = cipher.default_keyset(); - let ct = keyset - .encrypt(Element("row".to_string()), b"users".as_slice()) - .await - .expect("encrypt"); - let pt: Element = cipher - .decrypt(ct, b"users".as_slice()) - .await - .expect("Element must round-trip under the bare caller AAD"); - assert_eq!(pt.into_inner(), "row"); -} - -#[tokio::test] -async fn element_interchanges_with_vec_element() { - // A row sealed as one element of a `Vec` decrypts alone as `Element` - // under the same caller AAD (Element's documented use-case), and a lone - // `Element` ciphertext decrypts as a one-element `Vec`. - let cipher = cipher().await; - let keyset = cipher.default_keyset(); - let aad = b"users".as_slice(); - - let ct = keyset - .encrypt(vec!["a".to_string(), "b".to_string()], aad) - .await - .expect("encrypt"); - let second = match ct { - CipherText::Sequence(mut items) => items.remove(1), - other => other, - }; - let pt: Element = cipher - .decrypt(second, aad) - .await - .expect("spliced element must decrypt as Element"); - assert_eq!(pt.into_inner(), "b"); - - let lone = keyset - .encrypt(Element("c".to_string()), aad) - .await - .expect("encrypt"); - let wrapped = CipherText::Sequence(vec![lone]); - let pt: Vec = cipher - .decrypt(wrapped, aad) - .await - .expect("lone Element must decrypt as a one-element Vec"); - assert_eq!(pt, vec!["c".to_string()]); -} - -#[tokio::test] -async fn element_fails_under_wrong_caller_aad() { - let cipher = cipher().await; - let keyset = cipher.default_keyset(); - let ct = keyset - .encrypt(Element("row".to_string()), b"users".as_slice()) - .await - .expect("encrypt"); - let result: Result, _> = cipher.decrypt(ct, b"orders".as_slice()).await; - assert!( - result.is_err(), - "Element under the wrong caller AAD must not decrypt" - ); -} - -/// The derivation that binds a sequence element to its position is the -/// library's, applied by `Element` itself — there is no entry point that -/// lets a caller retrieve keys under one context and authenticate under -/// another, so a batched row is read back by naming the type, not by -/// reconstructing the AAD. -#[tokio::test] -async fn a_batched_element_opens_by_naming_the_type() { - let cipher = cipher().await; - let keyset = cipher.default_keyset(); - let ct = keyset - .encrypt(Element("row".to_string()), b"users".as_slice()) - .await - .expect("encrypt"); - let opened: Element = cipher - .decrypt(ct, b"users".as_slice()) - .await - .expect("Element applies its own derivation on open"); - assert_eq!(opened.into_inner(), "row"); -} - #[tokio::test] async fn wrong_shape_fails() { // A scalar ciphertext must not decode as a sequence. diff --git a/packages/stack-encrypt/tests/sem_terms.rs b/packages/stack-encrypt/tests/sem_terms.rs index 1ce6b799f..41e435f2e 100644 --- a/packages/stack-encrypt/tests/sem_terms.rs +++ b/packages/stack-encrypt/tests/sem_terms.rs @@ -286,38 +286,47 @@ async fn match_rejects_invalid_options() { } #[tokio::test] -async fn match_rejects_text_that_yields_no_tokens() { - use stack_encrypt::sem::TermError; - +async fn match_stores_text_that_yields_no_tokens_as_the_empty_filter() { let cipher = generator().await; let gen = cipher.default_keyset(); + let query = gen + .match_terms::("hello", nonempty!("users/bio")) + .await + .unwrap(); - // An empty term used as a query would vacuously match every stored row. - for text in ["", " "] { + // Empty or separator-only text, and text shorter than the n-gram, cut + // no token. The stored side keeps such a value as the empty filter: a + // query always has a token, and the empty filter holds none of its + // positions, so no query matches the value. (A query of such text is + // refused by the query chain instead; `tests/op.rs` holds that.) + for text in ["", " ", "hi"] { + let stored = gen + .match_terms::(text, nonempty!("users/bio")) + .await + .unwrap_or_else(|error| panic!("{text:?} stores: {error}")); assert!( - matches!( - gen.match_terms::(text, nonempty!("users/bio")) - .await, - Err(Error::Term(TermError::EmptyTermText)) - ), - "{text:?} must be rejected" + stored.positions().is_empty(), + "{text:?} is the empty filter" + ); + assert!(stored.to_bytes().is_empty()); + assert!(!stored.contains(&query), "{text:?}: no query matches it"); + assert!( + !query.contains(&stored), + "{text:?}: and the empty filter, as a query, matches nothing" + ); + assert_eq!( + MatchTerms::::from_bytes(&stored.to_bytes()).unwrap(), + stored, + "{text:?}: the empty filter round-trips through its bytes" ); } - // A probe shorter than the n-gram length could never match a stored gram - // (v1 indexer semantics) — rejected instead of a silent false negative. - assert!(matches!( - gen.match_terms::("hi", nonempty!("users/bio")) - .await, - Err(Error::Term(TermError::EmptyTermText)) - )); - // Separator-only text under the Standard tokenizer. - assert!(matches!( - gen.match_terms::(" ,;:! ", nonempty!("users/bio")) - .await, - Err(Error::Term(TermError::EmptyTermText)) - )); + let stored = gen + .match_terms::(" ,;:! ", nonempty!("users/bio")) + .await + .unwrap(); + assert!(stored.positions().is_empty()); } #[tokio::test] @@ -366,11 +375,11 @@ async fn string_ore_terms_preserve_lexicographic_order() { let cipher = generator().await; let gen = cipher.default_keyset(); let apple = gen - .ore_term("apple", nonempty!("users/name")) + .ore_term("apple".to_string(), nonempty!("users/name")) .await .unwrap(); let banana = gen - .ore_term("banana", nonempty!("users/name")) + .ore_term("banana".to_string(), nonempty!("users/name")) .await .unwrap(); assert_eq!(apple.cmp(&banana), Ordering::Less); @@ -398,28 +407,3 @@ async fn ore_and_ope_keys_are_domain_separated() { let ope = gen.ope_term(42u64, nonempty!("users/age")).await.unwrap(); assert_ne!(ore.as_ref(), ope.as_ref()); } - -#[tokio::test] -async fn owned_and_borrowed_text_yield_identical_ore_and_ope_terms() { - let cipher = generator().await; - let gen = cipher.default_keyset(); - let borrowed = gen - .ore_term("apple", nonempty!("users/name")) - .await - .unwrap(); - let owned = gen - .ore_term(String::from("apple"), nonempty!("users/name")) - .await - .unwrap(); - assert_eq!(borrowed.as_ref(), owned.as_ref()); - - let borrowed = gen - .ope_term("apple", nonempty!("users/name")) - .await - .unwrap(); - let owned = gen - .ope_term(String::from("apple"), nonempty!("users/name")) - .await - .unwrap(); - assert_eq!(borrowed.as_ref(), owned.as_ref()); -} diff --git a/packages/stack-encrypt/tests/source_mode.rs b/packages/stack-encrypt/tests/source_mode.rs index 0489248b0..1d7e3b269 100644 --- a/packages/stack-encrypt/tests/source_mode.rs +++ b/packages/stack-encrypt/tests/source_mode.rs @@ -1,6 +1,6 @@ //! How a description receives its plaintext (`target::{Borrowed, Owned}`). //! -//! Vitamin C's `Encrypt` and `PrfValue` consume their input. A description +//! Vitamin C's by-value `Encrypt` walk and `PrfValue` consume their input. A description //! handed a borrow (the default, and what every `EncryptFrom` declaration //! runs in) clones before an operation consumes; one handed the value //! (`Owned`) gives it to the operation. These tests hold the two claims that @@ -23,7 +23,7 @@ use stack_encrypt::target::{ }; use stack_encrypt::{nonempty, Encrypt, NonEmpty, StackCipherText}; use stack_kms::FakeDataKeySource; -use vitaminc_aead::{Cipher, IntoAad}; +use vitaminc_aead::plaintext::Sink; use vitaminc_prf::{IntoPrfContext, Prf, PrfValue, PrfVisitor}; use vitaminc_protected::{Controlled, Protected}; @@ -53,12 +53,8 @@ impl Secret { } } impl Encrypt for Secret { - fn encrypt_with_aad<'a, C, A>(self, cipher: C, aad: A) -> Result - where - C: Cipher, - A: IntoAad<'a>, - { - self.0.encrypt_with_aad(cipher, aad) + fn visit(self, sink: S) -> Result { + self.0.visit(sink) } } impl PrfValue for Secret { @@ -104,12 +100,8 @@ impl Clone for Counted { } } impl Encrypt for Counted { - fn encrypt_with_aad<'a, C, A>(self, cipher: C, aad: A) -> Result - where - C: Cipher, - A: IntoAad<'a>, - { - self.text.encrypt_with_aad(cipher, aad) + fn visit(self, sink: S) -> Result { + self.text.visit(sink) } } impl PrfValue for Counted { @@ -181,12 +173,12 @@ async fn a_plaintext_that_is_not_clone_derives_a_match_term_alone() { ); } -/// The case the owned mode exists for: the dynamic value an FFI binding -/// decodes is zeroized on drop and is not `Clone`. +/// The dynamic value an FFI binding decodes, its frame, is wiped on drop: +/// owned, it seals by value through a ciphertext alone. #[cfg(feature = "dynamic")] #[tokio::test] -async fn a_zeroizing_ffi_value_seals_through_ciphertext_alone() { - use vitaminc_aead_value::FfiValue; +async fn a_value_frame_seals_by_value_through_ciphertext_alone() { + use stack_encrypt::dynamic::ValueFrame; let cipher = stack_cipher().await; let keyset = cipher.default_keyset(); @@ -194,20 +186,16 @@ async fn a_zeroizing_ffi_value_seals_through_ciphertext_alone() { let sealed: StackCipherText = keyset .run( ciphertext::<_, _, Owned>(), - FfiValue::String(NUMBER.into()), + ValueFrame::of(NUMBER).unwrap(), aead(), ) .await .unwrap(); - let opened: FfiValue = cipher.decrypt_as(sealed, aead()).await.unwrap(); - let FfiValue::String(text) = opened else { - panic!("an FfiValue string should open to a string"); - }; + let opened: String = cipher.decrypt_as(sealed, aead()).await.unwrap(); assert_eq!( - text.risky_ref(), - NUMBER.as_bytes(), - "an FfiValue should seal by value and open to the same text" + opened, NUMBER, + "a value frame should seal by value and open to the same text" ); } @@ -351,12 +339,8 @@ impl Drop for Dropped { } } impl Encrypt for Dropped { - fn encrypt_with_aad<'a, C, A>(mut self, cipher: C, aad: A) -> Result - where - C: Cipher, - A: IntoAad<'a>, - { - std::mem::take(&mut self.text).encrypt_with_aad(cipher, aad) + fn visit(mut self, sink: S) -> Result { + std::mem::take(&mut self.text).visit(sink) } } impl PrfValue for Dropped { diff --git a/packages/stack-encrypt/tests/stored_rows.rs b/packages/stack-encrypt/tests/stored_rows.rs new file mode 100644 index 000000000..bc5aba38a --- /dev/null +++ b/packages/stack-encrypt/tests/stored_rows.rs @@ -0,0 +1,616 @@ +//! Stored rows, frozen: records the `next` build wrote, which every later +//! build must still open, and whose terms every later build must still +//! derive. +//! +//! The other record fixtures (`record_lowering.json`, `value_kinds.json`, +//! `query_operators.json`) prove that two authors of one record agree +//! *today*, and are regenerated when the encoding moves. This one is the +//! opposite: `tests/fixtures/stored_rows_v1.json` is written once and never +//! regenerated, so a change that alters the bytes of a stored row (the leaf +//! encoding, the AAD, a term derivation, the stored tree's shape) fails +//! here instead of being regenerated away. Nothing in this file writes it +//! except [`write_stored_rows_v1`], which is ignored, and refuses to run when +//! the file exists. `STACK_ENCRYPT_UPDATE_FIXTURES` does not touch it. +//! +//! A deliberate change to the stored format adds `stored_rows_v2.json` +//! beside this one. It never edits v1, and it says how v1 rows migrate. +//! Order terms are the one exception, for as long as the README says: a +//! deliberate change to how one is derived re-freezes only the `ore` and +//! `ope` terms that moved, by running the check with +//! `STACK_ENCRYPT_REFREEZE_ORDER_TERMS=1`. That run asserts nothing else +//! moved before it rewrites anything. +//! +//! The schema and the rules are in `tests/fixtures/README.md`. +#![cfg(feature = "dynamic")] + +mod common; + +use std::path::PathBuf; + +use common::{deterministic_cipher, DeterministicSource}; +use serde_json::{json, Map, Value as Json}; +use stack_encrypt::dynamic::record::{self, Plan as DataPlan}; +use stack_encrypt::dynamic::{admits, Scope, ValueFrame, ValueKind}; +use stack_encrypt::target::IndexSpec; +use stack_encrypt::StackCipherText as Node; +use stack_encrypt::{ + CipherText, Label, PassthroughFrame, SealedValue, StackCipher, StackCipherText, +}; +use vitaminc_aead::plaintext::{Float, Int, Logical, MapSink, Physical, SeqSink, Sink}; +use vitaminc_aead::FrameWriter; + +/// The seed of the deterministic key source the rows were sealed under. Part +/// of the frozen contract, as is `stack_kms::DeterministicSource` itself. +const SEED: [u8; 32] = *b"stack-encrypt stored rows v1 "; + +fn fixture_path() -> PathBuf { + PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/stored_rows_v1.json") +} + +// ---- hex ---------------------------------------------------------------------- + +fn hex(bytes: &[u8]) -> String { + bytes.iter().map(|b| format!("{b:02x}")).collect() +} + +fn unhex(text: &str) -> Vec { + assert!(text.len().is_multiple_of(2), "hex of odd length"); + (0..text.len()) + .step_by(2) + .map(|i| u8::from_str_radix(&text[i..i + 2], 16).expect("hex")) + .collect() +} + +// ---- a stored tree <-> JSON ------------------------------------------------- + +/// A stored tree as JSON, one object per node, so every shape round-trips: +/// `{"leaf": hex}` (a `SealedValue`'s frozen bytes), `{"seq": [..]}`, +/// `{"empty_seq": hex}`, `{"map": [[key, node], ..]}` (in stored order), +/// `{"empty_map": hex}` and `{"passthrough": hex}` (the payload's frame). +fn json_of_node(node: Node) -> Json { + match node { + CipherText::Single(leaf) => json!({ "leaf": hex(&leaf.to_bytes()) }), + CipherText::Sequence(items) => { + json!({ "seq": items.into_iter().map(json_of_node).collect::>() }) + } + CipherText::EmptySequence(leaf) => json!({ "empty_seq": hex(&leaf.to_bytes()) }), + CipherText::Map(entries) => json!({ + "map": entries + .into_iter() + .map(|(key, node)| json!([key, json_of_node(node)])) + .collect::>() + }), + CipherText::EmptyMap(leaf) => json!({ "empty_map": hex(&leaf.to_bytes()) }), + CipherText::Passthrough(payload) => json!({ "passthrough": hex(&payload.0) }), + } +} + +fn leaf_of(value: &Json) -> SealedValue { + SealedValue::from_bytes(&unhex(value.as_str().expect("hex"))).expect("a frozen leaf") +} + +fn node_of_json(json: &Json) -> Node { + let object = json.as_object().expect("a node is an object"); + assert_eq!(object.len(), 1, "a node has one key: {json}"); + let (kind, value) = object.iter().next().expect("one entry"); + match kind.as_str() { + "leaf" => CipherText::Single(leaf_of(value)), + "seq" => CipherText::Sequence( + value + .as_array() + .expect("a list") + .iter() + .map(node_of_json) + .collect(), + ), + "empty_seq" => CipherText::EmptySequence(leaf_of(value)), + "map" => CipherText::Map( + value + .as_array() + .expect("a list") + .iter() + .map(|entry| { + let pair = entry.as_array().expect("a [key, node] pair"); + ( + pair[0].as_str().expect("a key").to_string(), + node_of_json(&pair[1]), + ) + }) + .collect(), + ), + "empty_map" => CipherText::EmptyMap(leaf_of(value)), + "passthrough" => { + CipherText::Passthrough(PassthroughFrame(unhex(value.as_str().expect("hex")))) + } + other => panic!("not a node kind: {other}"), + } +} + +/// What a stored tree must keep when it is sealed again: everything but the +/// sealed leaves, which carry a fresh nonce each time. Its shape, its map +/// keys in order, its terms and its passthroughs. +fn skeleton(json: &Json) -> Json { + let object = json.as_object().expect("a node"); + let (kind, value) = object.iter().next().expect("one entry"); + match kind.as_str() { + "leaf" | "empty_seq" | "empty_map" => json!(kind), + "seq" => { + json!({ "seq": value.as_array().expect("a list").iter().map(skeleton).collect::>() }) + } + "map" => json!({ + "map": value + .as_array() + .expect("a list") + .iter() + .map(|pair| json!([pair[0], skeleton(&pair[1])])) + .collect::>() + }), + _ => json.clone(), + } +} + +/// Whether a stored map entry is an order term: `["ore", {"passthrough": ..}]` +/// or the same under `"ope"`. +fn is_order_term(pair: &Json) -> bool { + matches!(pair[0].as_str(), Some("ore" | "ope")) + && pair[1] + .as_object() + .is_some_and(|node| node.contains_key("passthrough")) +} + +/// [`skeleton`] with every order term's bytes masked: what must stay +/// exactly as written when order terms are re-frozen. +fn without_order_terms(json: &Json) -> Json { + let object = json.as_object().expect("a node"); + let (kind, value) = object.iter().next().expect("one entry"); + match kind.as_str() { + "leaf" | "empty_seq" | "empty_map" => json!(kind), + "seq" => json!({ + "seq": value.as_array().expect("a list").iter().map(without_order_terms).collect::>() + }), + "map" => json!({ + "map": value + .as_array() + .expect("a list") + .iter() + .map(|pair| { + if is_order_term(pair) { + json!([pair[0], "order term"]) + } else { + json!([pair[0], without_order_terms(&pair[1])]) + } + }) + .collect::>() + }), + _ => json.clone(), + } +} + +/// Copy every order term of `resealed` over the one in the same place in +/// `stored`. The two have the same shape, which the caller has asserted. +fn refreeze_order_terms(stored: &mut Json, resealed: &Json) { + let Some(object) = stored.as_object_mut() else { + return; + }; + let (kind, value) = object.iter_mut().next().expect("one entry"); + let key = kind.clone(); + let theirs = &resealed[key.as_str()]; + match key.as_str() { + "seq" => { + for (index, node) in value.as_array_mut().expect("a list").iter_mut().enumerate() { + refreeze_order_terms(node, &theirs[index]); + } + } + "map" => { + for (index, pair) in value.as_array_mut().expect("a list").iter_mut().enumerate() { + if is_order_term(pair) { + pair[1] = theirs[index][1].clone(); + } else { + refreeze_order_terms(&mut pair[1], &theirs[index][1]); + } + } + } + _ => {} + } +} + +// ---- a plan as JSON --------------------------------------------------------- + +/// A plan written as JSON, as frame bytes: what a binding sends. +fn frame_of_json(value: &Json) -> Vec { + vitaminc_aead_frame::serde::to_vec(value).expect("frames") +} + +fn plan_of(json: &Json) -> DataPlan { + record::plan(&frame_of_json(json)).expect("the frozen plan parses") +} + +// ---- sealing and opening ---------------------------------------------------- + +async fn seal( + cipher: &StackCipher, + source: &[u8], + plan: &DataPlan, +) -> StackCipherText { + let source = ValueFrame::from_bytes(source).expect("the source is a value"); + record::encrypt(&cipher.default_keyset(), source, plan) + .expect("the source fits the plan") + .await + .expect("the record seals") +} + +async fn open( + cipher: &StackCipher, + stored: StackCipherText, + plan: &DataPlan, + expected: Option

for StoredLeaf { +impl DecryptInto

for StoredLeaf { type Context = CallerContext; fn decryption(self, context: Self::Context) -> Decryption { match SealedValue::from_bytes(&self.0) { @@ -223,12 +224,13 @@ async fn empty_stored_identifier_is_refused_before_any_key_is_retrieved() { #[derive(Clone)] struct WithoutSerde(String); impl Encrypt for WithoutSerde { - fn encrypt_with_aad<'a, C: Cipher, A: IntoAad<'a>>( - self, - cipher: C, - aad: A, - ) -> Result { - self.0.encrypt_with_aad(cipher, aad) + fn visit(self, sink: S) -> Result { + self.0.visit(sink) + } +} +impl Encrypt for &WithoutSerde { + fn visit(self, sink: S) -> Result { + (&self.0).visit(sink) } } #[tokio::test] @@ -248,7 +250,7 @@ async fn ciphertext_uses_plaintexts_native_contract_without_serde() { .unwrap(); assert_eq!( opened, "native", - "a plaintext without Serde seals through its own Encrypt impl and opens canonically" + "a plaintext without Serde seals through its own Plaintext impl and opens canonically" ); let text = String::from("borrowed"); let result: StoredLeaf = keyset @@ -298,7 +300,7 @@ impl EncryptFrom for FixedLeaf { .accepting() } } -impl + 'static> DecryptInto

for FixedLeaf { +impl DecryptInto

for FixedLeaf { type Context = (); fn decryption(self, (): ()) -> Decryption { self.0.decryption(nonempty!("fixed/leaf").into()) @@ -337,10 +339,9 @@ enum Stored { Value(SealedValue), List(Vec), Object(Vec<(String, Stored)>), - Absent(SealedValue), EmptyList(SealedValue), EmptyObject(SealedValue), - Metadata(stack_encrypt::BoxedPassthrough), + Metadata(PassthroughFrame), } struct TreeVisitor; impl Visitor for TreeVisitor { @@ -362,16 +363,13 @@ impl Visitor for TreeVisitor { } Ok(Stored::Object(output)) } - fn absent(self, marker: SealedValue) -> Result { - Ok(Stored::Absent(marker)) - } fn empty_sequence(self, marker: SealedValue) -> Result { Ok(Stored::EmptyList(marker)) } fn empty_map(self, marker: SealedValue) -> Result { Ok(Stored::EmptyObject(marker)) } - fn passthrough(self, value: stack_encrypt::BoxedPassthrough) -> Result { + fn passthrough(self, value: PassthroughFrame) -> Result { Ok(Stored::Metadata(value)) } } @@ -383,7 +381,6 @@ impl Stored { Self::Object(v) => { CipherText::Map(v.into_iter().map(|(k, v)| (k, v.native())).collect()) } - Self::Absent(v) => CipherText::None(v), Self::EmptyList(v) => CipherText::EmptySequence(v), Self::EmptyObject(v) => CipherText::EmptyMap(v), Self::Metadata(v) => CipherText::Passthrough(v), @@ -441,7 +438,7 @@ fn native_readers_report_the_number_of_remaining_entries() { } } - let value = || CipherText::Passthrough(Box::new(7_u32) as stack_encrypt::BoxedPassthrough); + let value = || CipherText::Passthrough(common::passthrough(7_u32)); let sequence: StackCipherText = CipherText::Sequence(vec![value(), value(), value()]); assert_eq!( sequence.read(LengthVisitor).unwrap(), @@ -521,14 +518,14 @@ async fn native_readers_preserve_map_keys_and_authenticated_markers() { opened.is_err(), "an empty-map marker is sealed under its context, not an unauthenticated empty container" ); - let stored = CipherText::Passthrough(Box::new(17u32) as stack_encrypt::BoxedPassthrough) + let stored = CipherText::Passthrough(common::passthrough(17u32)) .read(TreeVisitor) .unwrap(); let Stored::Metadata(value) = stored else { panic!("metadata") }; assert_eq!( - *value.downcast::().unwrap(), + common::passthrough_u32(&value), 17, "passthrough metadata reaches the destination as it was given" ); diff --git a/packages/stack-encrypt/tests/ui.rs b/packages/stack-encrypt/tests/ui.rs index 2ce0f68fd..e671d2465 100644 --- a/packages/stack-encrypt/tests/ui.rs +++ b/packages/stack-encrypt/tests/ui.rs @@ -5,9 +5,9 @@ //! The expectations are recorded with every feature on, as `test:unit` and //! CI run them (`--all-features`), and this test is only built with the //! `dynamic` feature (`required-features` in `Cargo.toml`): rustc lists a -//! trait's other implementors in its help, so that feature's `FfiValue` -//! joins one list and pushes another entry off it, and one recording cannot -//! hold under both feature sets. +//! trait's other implementors in its help, that feature adds implementors +//! (`ValueFrame`) that can join such a list, and one recording cannot be +//! relied on to hold under both feature sets. #[test] fn derive_diagnostics() { diff --git a/packages/stack-encrypt/tests/ui/decrypt_field_not_decryptable.stderr b/packages/stack-encrypt/tests/ui/decrypt_field_not_decryptable.stderr index 4a434533e..68a157b03 100644 --- a/packages/stack-encrypt/tests/ui/decrypt_field_not_decryptable.stderr +++ b/packages/stack-encrypt/tests/ui/decrypt_field_not_decryptable.stderr @@ -14,7 +14,7 @@ help: the trait `DecryptField` is not implemented for `Opaqu `(A, B, C)` implements `DecryptField` `(A, B, C, D)` implements `DecryptField` `(A, B, C, D, E)` implements `DecryptField` - `CipherText>` implements `DecryptField` + `CipherText` implements `DecryptField` `Encrypted` implements `DecryptField` `EqualityTerm` implements `DecryptField` `MatchTerms` implements `DecryptField` @@ -38,7 +38,7 @@ help: the trait `Decryptable` is not implemented for `Opaque` (A, B, C) (A, B, C, D) (A, B, C, D, E) - CipherText> + CipherText Encrypted EqualityTerm MatchTerms diff --git a/packages/stack-encrypt/tests/ui/drop_record.stderr b/packages/stack-encrypt/tests/ui/drop_record.stderr index acf842fcd..c3667678c 100644 --- a/packages/stack-encrypt/tests/ui/drop_record.stderr +++ b/packages/stack-encrypt/tests/ui/drop_record.stderr @@ -5,4 +5,4 @@ error[E0509]: cannot move out of type `Rec`, which implements the `Drop` trait | ^^^^^^^^^^^^^^^^^^ | | | cannot move out of here - | move occurs because value has type `CipherText>`, which does not implement the `Copy` trait + | move occurs because value has type `CipherText`, which does not implement the `Copy` trait diff --git a/packages/stack-encrypt/tests/ui/match_in_a_tuple_on_integer.rs b/packages/stack-encrypt/tests/ui/match_in_a_tuple_on_integer.rs index 6b363cb74..e601f4dd2 100644 --- a/packages/stack-encrypt/tests/ui/match_in_a_tuple_on_integer.rs +++ b/packages/stack-encrypt/tests/ui/match_in_a_tuple_on_integer.rs @@ -4,5 +4,5 @@ use stack_encrypt::target::{indexed, Borrowed, Equality, Match}; use stack_kms::FakeDataKeySource; fn main() { - let _ = indexed::((Equality, Match::default())); + let _ = indexed::((Equality, Match)); } diff --git a/packages/stack-encrypt/tests/ui/match_in_a_tuple_on_integer.stderr b/packages/stack-encrypt/tests/ui/match_in_a_tuple_on_integer.stderr index cb38e177b..f2afb651f 100644 --- a/packages/stack-encrypt/tests/ui/match_in_a_tuple_on_integer.stderr +++ b/packages/stack-encrypt/tests/ui/match_in_a_tuple_on_integer.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `u32: AsRef` is not satisfied --> tests/ui/match_in_a_tuple_on_integer.rs:7:13 | -7 | let _ = indexed::((Equality, Match::default())); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsRef` is not implemented for `u32` +7 | let _ = indexed::((Equality, Match)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsRef` is not implemented for `u32` | help: the trait `stack_encrypt::Index` is implemented for `stack_encrypt::Match` --> src/target/index.rs diff --git a/packages/stack-encrypt/tests/ui/match_on_integer.rs b/packages/stack-encrypt/tests/ui/match_on_integer.rs index 37298c7ee..39da28605 100644 --- a/packages/stack-encrypt/tests/ui/match_on_integer.rs +++ b/packages/stack-encrypt/tests/ui/match_on_integer.rs @@ -4,5 +4,5 @@ use stack_encrypt::target::{indexed, Borrowed, Match}; use stack_kms::FakeDataKeySource; fn main() { - let _ = indexed::(Match::default()); + let _ = indexed::(Match); } diff --git a/packages/stack-encrypt/tests/ui/match_on_integer.stderr b/packages/stack-encrypt/tests/ui/match_on_integer.stderr index 309411cc5..2843b7847 100644 --- a/packages/stack-encrypt/tests/ui/match_on_integer.stderr +++ b/packages/stack-encrypt/tests/ui/match_on_integer.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `u32: AsRef` is not satisfied --> tests/ui/match_on_integer.rs:7:13 | -7 | let _ = indexed::(Match::default()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsRef` is not implemented for `u32` +7 | let _ = indexed::(Match); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsRef` is not implemented for `u32` | help: the trait `stack_encrypt::Index` is implemented for `stack_encrypt::Match` --> src/target/index.rs diff --git a/packages/stack-encrypt/tests/ui/op_at_path_inherits_fidelity.rs b/packages/stack-encrypt/tests/ui/op_at_path_inherits_fidelity.rs new file mode 100644 index 000000000..c017a4a3e --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_at_path_inherits_fidelity.rs @@ -0,0 +1,10 @@ +//! An accessor is held to its leaf's requirement: `AtPath` needs a +//! probabilistic term, as `Matches` does, so an exact term cannot answer it. +use stack_encrypt::op::{self, TermFor}; +use stack_encrypt::sem::EqualityTerm; + +fn answers>() {} + +fn main() { + answers::, EqualityTerm>(); +} diff --git a/packages/stack-encrypt/tests/ui/op_at_path_inherits_fidelity.stderr b/packages/stack-encrypt/tests/ui/op_at_path_inherits_fidelity.stderr new file mode 100644 index 000000000..8463a62f4 --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_at_path_inherits_fidelity.stderr @@ -0,0 +1,21 @@ +error[E0277]: `EqualityTerm` cannot answer `AtPath` + --> tests/ui/op_at_path_inherits_fidelity.rs:9:40 + | +9 | answers::, EqualityTerm>(); + | ^^^^^^^^^^^^ this query term does not meet the operator's requirement + | + = help: the trait `stack_encrypt::op::Probabilistic` is not implemented for `EqualityTerm` + = note: a term that answers `op::Matches` must implement `op::Probabilistic` +help: the trait `stack_encrypt::op::Probabilistic` is implemented for `MatchQuery` + --> src/sem/mod.rs + | + | impl crate::op::Probabilistic for MatchQuery { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: required for `EqualityTerm` to implement `TermFor` + = note: 1 redundant requirement hidden + = note: required for `EqualityTerm` to implement `TermFor>` +note: required by a bound in `answers` + --> tests/ui/op_at_path_inherits_fidelity.rs:6:33 + | +6 | fn answers>() {} + | ^^^^^^^^^^^ required by this bound in `answers` diff --git a/packages/stack-encrypt/tests/ui/op_at_path_not_a_leaf.rs b/packages/stack-encrypt/tests/ui/op_at_path_not_a_leaf.rs new file mode 100644 index 000000000..59c0a8fba --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_at_path_not_a_leaf.rs @@ -0,0 +1,11 @@ +//! `AtPath` applies a leaf operator at a path: containment compares whole +//! documents, and an accessor already has a path, so neither is an +//! operator under `AtPath`. +use stack_encrypt::op; + +fn operator(_: Op) {} + +fn main() { + operator(op::AtPath(op::Contains)); + operator(op::AtPath(op::AtPath(op::Eq))); +} diff --git a/packages/stack-encrypt/tests/ui/op_at_path_not_a_leaf.stderr b/packages/stack-encrypt/tests/ui/op_at_path_not_a_leaf.stderr new file mode 100644 index 000000000..f9b886cc1 --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_at_path_not_a_leaf.stderr @@ -0,0 +1,49 @@ +error[E0277]: `Contains` is not a leaf operator, so it cannot be applied at a path + --> tests/ui/op_at_path_not_a_leaf.rs:9:25 + | +9 | operator(op::AtPath(op::Contains)); + | -------- ^^^^^^^^^^^^ `op::AtPath` takes a leaf operator + | | + | required by a bound introduced by this call + | + = help: the trait `Leaf` is not implemented for `Contains` + = note: `op::AtPath` applies `op::Eq`, `Lt`, `Lte`, `Gt`, `Gte`, `Between` or `Matches` at a path; `op::Contains` and `op::ContainedBy` compare whole documents, and an accessor does not nest + = help: the following other types implement trait `Leaf`: + stack_encrypt::op::Between + stack_encrypt::op::Eq + stack_encrypt::op::Gt + stack_encrypt::op::Gte + stack_encrypt::op::Lt + stack_encrypt::op::Lte + stack_encrypt::op::Matches + = note: required for `AtPath` to implement `Operator` +note: required by a bound in `operator` + --> tests/ui/op_at_path_not_a_leaf.rs:6:17 + | +6 | fn operator(_: Op) {} + | ^^^^^^^^^^^^ required by this bound in `operator` + +error[E0277]: `AtPath` is not a leaf operator, so it cannot be applied at a path + --> tests/ui/op_at_path_not_a_leaf.rs:10:25 + | +10 | operator(op::AtPath(op::AtPath(op::Eq))); + | -------- ^^^^^^^^^^^^^^^^^^ `op::AtPath` takes a leaf operator + | | + | required by a bound introduced by this call + | + = help: the trait `Leaf` is not implemented for `AtPath` + = note: `op::AtPath` applies `op::Eq`, `Lt`, `Lte`, `Gt`, `Gte`, `Between` or `Matches` at a path; `op::Contains` and `op::ContainedBy` compare whole documents, and an accessor does not nest + = help: the following other types implement trait `Leaf`: + stack_encrypt::op::Between + stack_encrypt::op::Eq + stack_encrypt::op::Gt + stack_encrypt::op::Gte + stack_encrypt::op::Lt + stack_encrypt::op::Lte + stack_encrypt::op::Matches + = note: required for `AtPath>` to implement `Operator` +note: required by a bound in `operator` + --> tests/ui/op_at_path_not_a_leaf.rs:6:17 + | + 6 | fn operator(_: Op) {} + | ^^^^^^^^^^^^ required by this bound in `operator` diff --git a/packages/stack-encrypt/tests/ui/op_between_takes_a_pair.rs b/packages/stack-encrypt/tests/ui/op_between_takes_a_pair.rs new file mode 100644 index 000000000..8d3b35836 --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_between_takes_a_pair.rs @@ -0,0 +1,16 @@ +//! `Between` takes a pair of bounds, and the other orderings one value: a +//! query given the wrong shape does not compile. +use stack_encrypt::kms::FakeDataKeySource; +use stack_encrypt::op; +use stack_encrypt::{Ore, Plan, StackCipher}; + +async fn query(cipher: &StackCipher) { + let age_plan = Plan::context("users/age") + .with::(Ore) + .build() + .unwrap(); + let _ = cipher.query(op::Between, &40u32).on(&age_plan); + let _ = cipher.query(op::Lt, &(18u32, 65)).on(&age_plan); +} + +fn main() {} diff --git a/packages/stack-encrypt/tests/ui/op_between_takes_a_pair.stderr b/packages/stack-encrypt/tests/ui/op_between_takes_a_pair.stderr new file mode 100644 index 000000000..a6c0d011e --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_between_takes_a_pair.stderr @@ -0,0 +1,63 @@ +error[E0277]: `u32` is not what a query of arity `Pair` takes + --> tests/ui/op_between_takes_a_pair.rs:12:39 + | +12 | let _ = cipher.query(op::Between, &40u32).on(&age_plan); + | ----- ^^^^^^ the operator takes another input + | | + | required by a bound introduced by this call + | + = help: the trait `Input` is not implemented for `u32` + = note: an operator of arity `One` takes one value, `op::Between` (arity `Pair`) takes a pair, `&(lo, hi)`, and `op::AtPath` (arity `Pathed`) takes no input yet: it arrives with the JSON index +help: the trait `Input` is implemented for `(S, S)` + --> src/op/mod.rs + | + | impl Input for (S, S) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: required by a bound in `plan::chain::>::query` + --> src/plan/chain.rs + | + | pub fn query<'a, Op, Q>(&'a self, op: Op, value: &Q) -> QueryBuilder<'a, Op, F, K> + | ----- required by a bound in this associated function +... + | F: Input, + | ^^^^^^^^^^^^^^^^ required by this bound in `plan::chain::>::query` + +error[E0599]: the method `on` exists for struct `QueryBuilder<'_, stack_encrypt::op::Between, u32, FakeDataKeySource>`, but its trait bounds were not satisfied + --> tests/ui/op_between_takes_a_pair.rs:12:47 + | +12 | let _ = cipher.query(op::Between, &40u32).on(&age_plan); + | ^^ + | + = note: the following trait bounds were not satisfied: + `u32: Input` + +error[E0271]: type mismatch resolving `<(u32, {integer}) as Input>::Plaintext == u32` + --> tests/ui/op_between_takes_a_pair.rs:13:48 + | +13 | let _ = cipher.query(op::Lt, &(18u32, 65)).on(&age_plan); + | ^^ expected `u32`, found `(u32, {integer})` + | + = note: expected type `u32` + found tuple `(u32, {integer})` + = note: required for `ValuePlan>` to implement `Chooses` + +error[E0277]: `(u32, {integer})` is not ordered: the ordering operators are answered over the integers of 16 bits and wider, the floats and text + --> tests/ui/op_between_takes_a_pair.rs:13:48 + | +13 | let _ = cipher.query(op::Lt, &(18u32, 65)).on(&age_plan); + | ^^ no ordering operator over this type + | + = help: the trait `Ordered` is not implemented for `(u32, {integer})` + = note: `Lt`, `Lte`, `Gt`, `Gte` and `Between` take `u16` to `u128`, `i16` to `i128`, `f32`, `f64` or a `String`; a `u8`, an `i8` and a `bool` have no order term + = help: the following other types implement trait `Ordered`: + f32 + f64 + i128 + i16 + i32 + i64 + std::string::String + u128 + and $N others + = note: required for `stack_encrypt::op::Lt` to implement `DefaultIndex<(u32, {integer})>` + = note: required for `ValuePlan>` to implement `Chooses` diff --git a/packages/stack-encrypt/tests/ui/op_case_mismatch.rs b/packages/stack-encrypt/tests/ui/op_case_mismatch.rs new file mode 100644 index 000000000..6e1d2e9a5 --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_case_mismatch.rs @@ -0,0 +1,18 @@ +//! The default match index folds case, so it answers only a +//! case-insensitive `Matches`: asking it for a case-sensitive one does not +//! compile, rather than quietly folding the query. +use stack_encrypt::kms::FakeDataKeySource; +use stack_encrypt::{op, Match, Plan, StackCipher}; + +async fn query(cipher: &StackCipher) { + let name_plan = Plan::context("users/name") + .with::(Match) + .build() + .unwrap(); + let _ = cipher + .query(op::Matches.case_sensitive(), "Ali") + .via(Match) + .on(&name_plan); +} + +fn main() {} diff --git a/packages/stack-encrypt/tests/ui/op_case_mismatch.stderr b/packages/stack-encrypt/tests/ui/op_case_mismatch.stderr new file mode 100644 index 000000000..fd7634477 --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_case_mismatch.stderr @@ -0,0 +1,37 @@ +error[E0271]: type mismatch resolving `::Case == CaseSensitive` + --> tests/ui/op_case_mismatch.rs:14:14 + | +14 | .via(Match) + | --- ^^^^^ expected `CaseSensitive`, found `CaseInsensitive` + | | + | required by a bound introduced by this call + | +note: required by a bound in `QueryBuilder::<'a, Op, F, K>::via` + --> src/plan/chain.rs + | + | pub fn via>(self, index: I) -> QueryVia<'a, Op, F, I, K> { + | ^^^^^^^^^^^^^^^ required by this bound in `QueryBuilder::<'a, Op, F, K>::via` + +error[E0599]: the method `on` exists for struct `QueryVia<'_, stack_encrypt::op::Matches, std::string::String, stack_encrypt::Match, FakeDataKeySource>`, but its trait bounds were not satisfied + --> tests/ui/op_case_mismatch.rs:15:10 + | +12 | let _ = cipher + | _____________- +13 | | .query(op::Matches.case_sensitive(), "Ali") +14 | | .via(Match) +15 | | .on(&name_plan); + | |_________-^^ + | + ::: src/target/index.rs + | + | pub struct Match { + | ---------------------------------- doesn't satisfy `_: Supports, String>` + | + ::: src/sem/mod.rs + | + | pub struct DefaultMatch; + | ----------------------- doesn't satisfy `<_ as MatchCase>::Case = CaseSensitive` + | + = note: the following trait bounds were not satisfied: + `::Case = CaseSensitive` + which is required by `stack_encrypt::Match: Supports, std::string::String>` diff --git a/packages/stack-encrypt/tests/ui/op_inexact_operator_needs_probabilistic.rs b/packages/stack-encrypt/tests/ui/op_inexact_operator_needs_probabilistic.rs new file mode 100644 index 000000000..22ea7d599 --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_inexact_operator_needs_probabilistic.rs @@ -0,0 +1,35 @@ +//! A text match is approximate, so an index that answers `Matches` must send +//! a term that says how its answer is checked: an exact term cannot answer +//! it. +use stack_encrypt::op; +use stack_encrypt::sem::EqualityTerm; +use stack_encrypt::target::{CallerContext, ConsumeSource, Encryption, Index, IndexSpec}; +use stack_encrypt::Equality; + +struct Shortcut; + +impl Index for Shortcut { + type Term = EqualityTerm; + fn spec(&self) -> IndexSpec { + IndexSpec::Equality + } + fn operation<'s, K: 'static, M: ConsumeSource<'s, String>>( + &self, + ) -> Encryption<'s, String, EqualityTerm, K, CallerContext, M> { + Index::::operation(&Equality) + } +} + +impl op::Supports for Shortcut { + type Query = EqualityTerm; + type Verifier = (); + fn check(&self, _: &String) -> Result<(), stack_encrypt::Error> { + Ok(()) + } + fn verifier(&self, _: &String) {} + fn query((): (), term: EqualityTerm, _: op::QueryToken) -> EqualityTerm { + term + } +} + +fn main() {} diff --git a/packages/stack-encrypt/tests/ui/op_inexact_operator_needs_probabilistic.stderr b/packages/stack-encrypt/tests/ui/op_inexact_operator_needs_probabilistic.stderr new file mode 100644 index 000000000..248900eee --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_inexact_operator_needs_probabilistic.stderr @@ -0,0 +1,19 @@ +error[E0277]: `EqualityTerm` cannot answer `stack_encrypt::op::Matches` + --> tests/ui/op_inexact_operator_needs_probabilistic.rs:24:18 + | +24 | type Query = EqualityTerm; + | ^^^^^^^^^^^^ this query term does not meet the operator's requirement + | + = help: the trait `stack_encrypt::op::Probabilistic` is not implemented for `EqualityTerm` + = note: a term that answers `op::Matches` must implement `op::Probabilistic` +help: the trait `stack_encrypt::op::Probabilistic` is implemented for `MatchQuery` + --> src/sem/mod.rs + | + | impl crate::op::Probabilistic for MatchQuery { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: required for `EqualityTerm` to implement `TermFor` +note: required by a bound in `stack_encrypt::op::Supports::Query` + --> src/op/mod.rs + | + | type Query: TermFor; + | ^^^^^^^^^^^ required by this bound in `Supports::Query` diff --git a/packages/stack-encrypt/tests/ui/op_json_not_answered.rs b/packages/stack-encrypt/tests/ui/op_json_not_answered.rs new file mode 100644 index 000000000..2f208e9fe --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_json_not_answered.rs @@ -0,0 +1,19 @@ +//! The JSON operators are declared and answered by no index: this crate has +//! no JSON index, so a containment query and a query at a path do not +//! compile on any plan. +use stack_encrypt::kms::FakeDataKeySource; +use stack_encrypt::op; +use stack_encrypt::{Equality, Plan, StackCipher}; + +async fn query(cipher: &StackCipher) { + let profile_plan = Plan::context("users/profile") + .with::(Equality) + .build() + .unwrap(); + let _ = cipher.query(op::Contains, "{}").on(&profile_plan); + let _ = cipher + .query(op::AtPath(op::Eq), &("$.address.city", "Sydney")) + .on(&profile_plan); +} + +fn main() {} diff --git a/packages/stack-encrypt/tests/ui/op_json_not_answered.stderr b/packages/stack-encrypt/tests/ui/op_json_not_answered.stderr new file mode 100644 index 000000000..0d2ea514f --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_json_not_answered.stderr @@ -0,0 +1,54 @@ +error[E0277]: `Contains` has no default index given `std::string::String` + --> tests/ui/op_json_not_answered.rs:13:46 + | +13 | let _ = cipher.query(op::Contains, "{}").on(&profile_plan); + | ^^ no default index answers this operator here + | + = help: the trait `DefaultIndex` is not implemented for `Contains` + = note: `op::Eq` defaults to `Equality`; `op::Matches` defaults to `Match` with the default configuration, which is case-insensitive and over text only; `op::Lt`, `Lte`, `Gt`, `Gte` and `Between` default to `Ore` over an integer, and `Between` takes a pair; name another index, such as `Ope`, with `.via(index)`; no index answers `op::Contains`, `op::ContainedBy` or `op::AtPath` yet, since this crate has no JSON index + = help: the following other types implement trait `DefaultIndex`: + `stack_encrypt::op::Between` implements `DefaultIndex<(S, S)>` + `stack_encrypt::op::Eq` implements `DefaultIndex` + `stack_encrypt::op::Gt` implements `DefaultIndex` + `stack_encrypt::op::Gte` implements `DefaultIndex` + `stack_encrypt::op::Lt` implements `DefaultIndex` + `stack_encrypt::op::Lte` implements `DefaultIndex` + `stack_encrypt::op::Matches<::Case>` implements `DefaultIndex` + = note: required for `ValuePlan>` to implement `Chooses` + +error[E0277]: `(&str, &str)` is not what a query of arity `Pathed` takes + --> tests/ui/op_json_not_answered.rs:15:36 + | +15 | .query(op::AtPath(op::Eq), &("$.address.city", "Sydney")) + | ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the operator takes another input + | | + | required by a bound introduced by this call + | + = note: an operator of arity `One` takes one value, `op::Between` (arity `Pair`) takes a pair, `&(lo, hi)`, and `op::AtPath` (arity `Pathed`) takes no input yet: it arrives with the JSON index +help: the trait `Input>` is not implemented for `(&str, &str)` + but trait `Input` is implemented for it + --> src/op/mod.rs + | + | impl Input for (S, S) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `Pair`, found `Pathed` +note: required by a bound in `plan::chain::>::query` + --> src/plan/chain.rs + | + | pub fn query<'a, Op, Q>(&'a self, op: Op, value: &Q) -> QueryBuilder<'a, Op, F, K> + | ----- required by a bound in this associated function +... + | F: Input, + | ^^^^^^^^^^^^^^^^ required by this bound in `plan::chain::>::query` + +error[E0599]: the method `on` exists for struct `QueryBuilder<'_, AtPath, (&str, &str), FakeDataKeySource>`, but its trait bounds were not satisfied + --> tests/ui/op_json_not_answered.rs:16:10 + | +14 | let _ = cipher + | _____________- +15 | | .query(op::AtPath(op::Eq), &("$.address.city", "Sydney")) +16 | | .on(&profile_plan); + | |_________-^^ + | + = note: the following trait bounds were not satisfied: + `(&str, &str): Input>` diff --git a/packages/stack-encrypt/tests/ui/op_matches_on_integer.rs b/packages/stack-encrypt/tests/ui/op_matches_on_integer.rs new file mode 100644 index 000000000..8408d9b3f --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_matches_on_integer.rs @@ -0,0 +1,11 @@ +//! `Matches` is text search: a field of integers has no index that answers +//! it, so the query does not compile. +use stack_encrypt::kms::FakeDataKeySource; +use stack_encrypt::{op, Equality, Plan, StackCipher}; + +async fn query(cipher: &StackCipher) { + let age_plan = Plan::context("users/age").with::(Equality).build().unwrap(); + let _ = cipher.query(op::Matches, &34u32).on(&age_plan); +} + +fn main() {} diff --git a/packages/stack-encrypt/tests/ui/op_matches_on_integer.stderr b/packages/stack-encrypt/tests/ui/op_matches_on_integer.stderr new file mode 100644 index 000000000..17e557577 --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_matches_on_integer.stderr @@ -0,0 +1,74 @@ +error[E0277]: the trait bound `u32: AsRef` is not satisfied + --> tests/ui/op_matches_on_integer.rs:8:47 + | +8 | let _ = cipher.query(op::Matches, &34u32).on(&age_plan); + | ^^ the trait `AsRef` is not implemented for `u32` + | +help: the following other types implement trait `Chooses` + --> src/plan/chain.rs + | + | / impl Chooses for ValuePlan> + | | where + | | Op: DefaultIndex, + | | Op::Via: Clone, + | | In: Input, + | | S: 'static, + | | X: Indexes + Select, + | |________________________________________^ `ValuePlan>` implements `Chooses` +... + | / impl Chooses for ValuePlan> + | | where + | | Op: Operator, + | | In: Input, +... | + | | T::Via: Default, + | | Typed: ValueShape, + | |____________________________^ `ValuePlan>` implements `Chooses` + = note: required for `stack_encrypt::op::Matches` to implement `DefaultIndex` + = note: required for `ValuePlan>` to implement `Chooses` + +error[E0277]: the trait bound `stack_encrypt::Equality: Select` is not satisfied + --> tests/ui/op_matches_on_integer.rs:8:47 + | +8 | let _ = cipher.query(op::Matches, &34u32).on(&age_plan); + | ^^ the trait `Select` is not implemented for `stack_encrypt::Equality` + | + = help: the following other types implement trait `Select`: + `(A, B)` implements `Select>` + `(A, B)` implements `Select>` + `(A, B, C)` implements `Select>` + `(A, B, C)` implements `Select>` + `(A, B, C)` implements `Select>` + `(A, B, C, D)` implements `Select>` + `(A, B, C, D)` implements `Select>` + `(A, B, C, D)` implements `Select>` + and $N others + = note: required for `ValuePlan>` to implement `Chooses` + +error[E0277]: the trait bound `stack_encrypt::Equality: Select` is not satisfied + --> tests/ui/op_matches_on_integer.rs:8:50 + | +8 | let _ = cipher.query(op::Matches, &34u32).on(&age_plan); + | -- ^^^^^^^^^ the trait `Select` is not implemented for `stack_encrypt::Equality` + | | + | required by a bound introduced by this call + | + = help: the following other types implement trait `Select`: + `(A, B)` implements `Select>` + `(A, B)` implements `Select>` + `(A, B, C)` implements `Select>` + `(A, B, C)` implements `Select>` + `(A, B, C)` implements `Select>` + `(A, B, C, D)` implements `Select>` + `(A, B, C, D)` implements `Select>` + `(A, B, C, D)` implements `Select>` + and $N others + = note: required for `ValuePlan>` to implement `Chooses` +note: required by a bound in `QueryBuilder::<'a, Op, F, K>::on` + --> src/plan/chain.rs + | + | pub fn on(self, plan: &P) -> QueryOp<'a, F, Op, P::Via, K> + | -- required by a bound in this associated function + | where + | P: Chooses, + | ^^^^^^^^^^^^^^^^^^ required by this bound in `QueryBuilder::<'a, Op, F, K>::on` diff --git a/packages/stack-encrypt/tests/ui/op_order_on_bytes.rs b/packages/stack-encrypt/tests/ui/op_order_on_bytes.rs new file mode 100644 index 000000000..a2cecbbf9 --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_order_on_bytes.rs @@ -0,0 +1,16 @@ +//! The ordering operators are answered over the integer types, the floats and text. +//! Bytes have no order key the ordering operators compare, so an ordering on +//! a bytes plan does not compile, even where the plan declares an ORE index. +use stack_encrypt::kms::FakeDataKeySource; +use stack_encrypt::op; +use stack_encrypt::{Ore, Plan, StackCipher}; + +async fn query(cipher: &StackCipher) { + let blob_plan = Plan::context("users/blob") + .with::, _>(Ore) + .build() + .unwrap(); + let _ = cipher.query(op::Lt, &vec![1u8, 2]).on(&blob_plan); +} + +fn main() {} diff --git a/packages/stack-encrypt/tests/ui/op_order_on_bytes.stderr b/packages/stack-encrypt/tests/ui/op_order_on_bytes.stderr new file mode 100644 index 000000000..870e876b1 --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_order_on_bytes.stderr @@ -0,0 +1,20 @@ +error[E0277]: `Vec` is not ordered: the ordering operators are answered over the integers of 16 bits and wider, the floats and text + --> tests/ui/op_order_on_bytes.rs:13:49 + | +13 | let _ = cipher.query(op::Lt, &vec![1u8, 2]).on(&blob_plan); + | ^^ no ordering operator over this type + | + = help: the trait `Ordered` is not implemented for `Vec` + = note: `Lt`, `Lte`, `Gt`, `Gte` and `Between` take `u16` to `u128`, `i16` to `i128`, `f32`, `f64` or a `String`; a `u8`, an `i8` and a `bool` have no order term + = help: the following other types implement trait `Ordered`: + f32 + f64 + i128 + i16 + i32 + i64 + std::string::String + u128 + and $N others + = note: required for `stack_encrypt::op::Lt` to implement `DefaultIndex>` + = note: required for `ValuePlan, Indexed>` to implement `Chooses, Whole>` diff --git a/packages/stack-encrypt/tests/ui/op_target_does_not_answer.rs b/packages/stack-encrypt/tests/ui/op_target_does_not_answer.rs new file mode 100644 index 000000000..3dee1da94 --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_target_does_not_answer.rs @@ -0,0 +1,16 @@ +//! A target answers only the operators its type implements `Answers` for: +//! an equality term is not searchable text. +use stack_encrypt::kms::FakeDataKeySource; +use stack_encrypt::sem::EqualityTerm; +use stack_encrypt::{op, Plan, StackCipher}; + +async fn query(cipher: &StackCipher) { + let email_plan = Plan::value::() + .context("users/email") + .encrypt_into::() + .build() + .unwrap(); + let _ = cipher.query(op::Matches, "bob").on(&email_plan); +} + +fn main() {} diff --git a/packages/stack-encrypt/tests/ui/op_target_does_not_answer.stderr b/packages/stack-encrypt/tests/ui/op_target_does_not_answer.stderr new file mode 100644 index 000000000..81b87a000 --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_target_does_not_answer.stderr @@ -0,0 +1,15 @@ +error[E0277]: `EqualityTerm` does not answer `stack_encrypt::op::Matches` given `std::string::String` + --> tests/ui/op_target_does_not_answer.rs:13:46 + | +13 | let _ = cipher.query(op::Matches, "bob").on(&email_plan); + | ^^ this target type does not answer the operator + | + = note: a target answers the operators its type implements `Answers` for; `.via(index)` names an index the target declares +help: the trait `Answers` is not implemented for `EqualityTerm` + but trait `Answers` is implemented for it + --> src/op/mod.rs + | + | impl Answers for EqualityTerm { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: for that trait implementation, expected `stack_encrypt::op::Eq`, found `stack_encrypt::op::Matches` + = note: required for `ValuePlan>` to implement `Chooses` diff --git a/packages/stack-encrypt/tests/ui/op_verify_exact_term.rs b/packages/stack-encrypt/tests/ui/op_verify_exact_term.rs new file mode 100644 index 000000000..d83af5055 --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_verify_exact_term.rs @@ -0,0 +1,16 @@ +//! An exact query term has nothing to verify: the server's answer is the +//! answer, so `verify` on an equality term does not compile. +use stack_encrypt::kms::FakeDataKeySource; +use stack_encrypt::op::{self, Probabilistic}; +use stack_encrypt::{Equality, Plan, StackCipher}; + +async fn query(cipher: &StackCipher) { + let plan = Plan::context("users/email") + .with::(Equality) + .build() + .unwrap(); + let term = cipher.query(op::Eq, "bob").on(&plan).await.unwrap(); + let _ = term.verify("bob"); +} + +fn main() {} diff --git a/packages/stack-encrypt/tests/ui/op_verify_exact_term.stderr b/packages/stack-encrypt/tests/ui/op_verify_exact_term.stderr new file mode 100644 index 000000000..2ffdf93b3 --- /dev/null +++ b/packages/stack-encrypt/tests/ui/op_verify_exact_term.stderr @@ -0,0 +1,5 @@ +error[E0599]: no method named `verify` found for struct `EqualityTerm` in the current scope + --> tests/ui/op_verify_exact_term.rs:13:18 + | +13 | let _ = term.verify("bob"); + | ^^^^^^ method not found in `EqualityTerm` diff --git a/packages/stack-encrypt/tests/ui/order_term_of_an_8_bit_integer.rs b/packages/stack-encrypt/tests/ui/order_term_of_an_8_bit_integer.rs new file mode 100644 index 000000000..9a47e964b --- /dev/null +++ b/packages/stack-encrypt/tests/ui/order_term_of_an_8_bit_integer.rs @@ -0,0 +1,19 @@ +//! A `u8` and an `i8` have no order term, as a `bool` has none: with 256 +//! values, an order term would rank every row among 256, which a few known +//! rows resolve to the values. So neither is `sem::Orderable` or +//! `op::Ordered`: an `OreTerm`, a plan with `Ore` on an `i8` and an +//! ordering query over a `u8` do not compile. Each keeps its equality term. +use stack_encrypt::kms::FakeDataKeySource; +use stack_encrypt::sem::{OpeTerm, OreTerm}; +use stack_encrypt::{op, Ore, Plan, StackCipher}; + +fn terms(ore: OreTerm, ope: OpeTerm) { + let _ = (ore, ope); +} + +async fn query(cipher: &StackCipher) { + let rank_plan = Plan::context("users/rank").with::(Ore).build().unwrap(); + let _ = cipher.query(op::Lt, &7u8).on(&rank_plan); +} + +fn main() {} diff --git a/packages/stack-encrypt/tests/ui/order_term_of_an_8_bit_integer.stderr b/packages/stack-encrypt/tests/ui/order_term_of_an_8_bit_integer.stderr new file mode 100644 index 000000000..dee586b74 --- /dev/null +++ b/packages/stack-encrypt/tests/ui/order_term_of_an_8_bit_integer.stderr @@ -0,0 +1,84 @@ +error[E0277]: the trait bound `u8: Orderable` is not satisfied + --> tests/ui/order_term_of_an_8_bit_integer.rs:10:15 + | +10 | fn terms(ore: OreTerm, ope: OpeTerm) { + | ^^^^^^^^^^^ the trait `Orderable` is not implemented for `u8` + | + = help: the following other types implement trait `Orderable`: + f32 + f64 + i128 + i16 + i32 + i64 + u128 + u16 + and $N others +note: required by a bound in `OreTerm` + --> src/sem/mod.rs + | + | pub struct OreTerm(OreCllw8VariableV1, PhantomData T>); + | ^^^^^^^^^ required by this bound in `OreTerm` + +error[E0277]: the trait bound `i8: Orderable` is not satisfied + --> tests/ui/order_term_of_an_8_bit_integer.rs:10:33 + | +10 | fn terms(ore: OreTerm, ope: OpeTerm) { + | ^^^^^^^^^^^ the trait `Orderable` is not implemented for `i8` + | + = help: the following other types implement trait `Orderable`: + f32 + f64 + i128 + i16 + i32 + i64 + u128 + u16 + and $N others +note: required by a bound in `OpeTerm` + --> src/sem/mod.rs + | + | pub struct OpeTerm(OpeCllw8VariableV1, PhantomData T>); + | ^^^^^^^^^ required by this bound in `OpeTerm` + +error[E0277]: the trait bound `i8: Orderable` is not satisfied + --> tests/ui/order_term_of_an_8_bit_integer.rs:15:60 + | +15 | let rank_plan = Plan::context("users/rank").with::(Ore).build().unwrap(); + | ---- ^ the trait `Orderable` is not implemented for `i8` + | | + | required by a bound introduced by this call + | + = help: the following other types implement trait `Orderable`: + f32 + f64 + i128 + i16 + i32 + i64 + u128 + u16 + and $N others + = note: required for `stack_encrypt::Ore` to implement `stack_encrypt::Index` + = note: required for `stack_encrypt::Ore` to implement `Indexes` +note: required by a bound in `plan::value::::with` + --> src/plan/value.rs + | + | pub fn with>(self, indexes: X) -> ValuePlanBuilder> { + | ^^^^^^^^^^ required by this bound in `plan::value::::with` + +error[E0599]: the method `build` exists for struct `ValuePlanBuilder>`, but its trait bounds were not satisfied + --> tests/ui/order_term_of_an_8_bit_integer.rs:15:68 + | +15 | let rank_plan = Plan::context("users/rank").with::(Ore).build().unwrap(); + | ^^^^^ method cannot be called on `ValuePlanBuilder>` due to unsatisfied trait bounds + | + ::: src/plan/value.rs + | + | pub struct Indexed(X); + | --------------------- doesn't satisfy `Indexed: ValueLayout` + | + = note: the following trait bounds were not satisfied: + `i8: Orderable` + which is required by `Indexed: ValueLayout` diff --git a/packages/stack-encrypt/tests/ui/owned_fan_out_needs_clone.rs b/packages/stack-encrypt/tests/ui/owned_fan_out_needs_clone.rs index 8c808dca1..4e607736d 100644 --- a/packages/stack-encrypt/tests/ui/owned_fan_out_needs_clone.rs +++ b/packages/stack-encrypt/tests/ui/owned_fan_out_needs_clone.rs @@ -3,10 +3,10 @@ //! one place a copy is unavoidable — the first side gets a clone, the last //! the value — and the refusal names `zip`, not the operations. use stack_encrypt::target::{ciphertext, equality, CallerContext, Owned}; -use stack_encrypt::{nonempty, Encrypt, KeysetCipher}; +use stack_encrypt::{nonempty, KeysetCipher, Encrypt}; use stack_kms::FakeDataKeySource; -fn seal_and_index( +fn seal_and_index( keyset: &KeysetCipher<'_, FakeDataKeySource>, value: S, ) { diff --git a/packages/stack-encrypt/tests/ui/owned_fan_out_needs_clone.stderr b/packages/stack-encrypt/tests/ui/owned_fan_out_needs_clone.stderr index aca006b38..0d16f0b94 100644 --- a/packages/stack-encrypt/tests/ui/owned_fan_out_needs_clone.stderr +++ b/packages/stack-encrypt/tests/ui/owned_fan_out_needs_clone.stderr @@ -15,5 +15,5 @@ note: required by a bound in `Encryption::<'s, S, T, K, Ctx, M>::zip` | ^^^^^^^^^^^^^^^^^^ required by this bound in `Encryption::<'s, S, T, K, Ctx, M>::zip` help: consider further restricting type parameter `S` with trait `Clone` | - 9 | fn seal_and_index( - | +++++++++++++++++++ + 9 | fn seal_and_index( + | +++++++++++++++++++ diff --git a/packages/stack-encrypt/tests/ui/pass/indexes.rs b/packages/stack-encrypt/tests/ui/pass/indexes.rs index 4079dd413..eca5a09c6 100644 --- a/packages/stack-encrypt/tests/ui/pass/indexes.rs +++ b/packages/stack-encrypt/tests/ui/pass/indexes.rs @@ -16,7 +16,7 @@ fn main() { let _ = indexed::(Equality); let _ = indexed::((Equality, Ore)); let _ = indexed::((Equality, Ore, Ope)); - let _ = indexed::(Match::default()); + let _ = indexed::(Match); let _ = indexed::(( Equality, Match::::new(), @@ -25,7 +25,7 @@ fn main() { )); let _ = indexed::(( Equality, - Match::default(), + Match, Ore, Ope, Match::::new(), diff --git a/packages/stack-encrypt/tests/ui/pass/owned_without_clone.rs b/packages/stack-encrypt/tests/ui/pass/owned_without_clone.rs index 4ae01d79f..98e07295c 100644 --- a/packages/stack-encrypt/tests/ui/pass/owned_without_clone.rs +++ b/packages/stack-encrypt/tests/ui/pass/owned_without_clone.rs @@ -1,11 +1,11 @@ //! A single operation in owned mode asks nothing of the plaintext beyond the //! operation's own capability: no `Clone`, so a value that is moved and //! wiped can be sealed or indexed. -use stack_encrypt::sem::{CllwOpeEncrypt, CllwOreEncrypt, EqualityTerm, MatchTerms, OpeTerm, OreTerm}; +use stack_encrypt::sem::{EqualityTerm, MatchTerms, OpeTerm, Orderable, OreTerm}; use stack_encrypt::target::{ ciphertext, equality, matching, ope, ore, CallerContext, Owned, Pending, }; -use stack_encrypt::{nonempty, Encrypt, KeysetCipher, StackCipherText}; +use stack_encrypt::{nonempty, KeysetCipher, Encrypt, StackCipherText}; use stack_kms::FakeDataKeySource; fn seal<'a, S: Encrypt>( @@ -14,7 +14,7 @@ fn seal<'a, S: Encrypt>( ) -> Pending<'a, StackCipherText, FakeDataKeySource> { keyset.run(ciphertext::<_, _, Owned>(), value, nonempty!("column").into()) } -fn index<'a, S: vitaminc_prf::PrfValue>( +fn index<'a, S: Encrypt>( keyset: &'a KeysetCipher<'_, FakeDataKeySource>, value: S, ) -> Pending<'a, EqualityTerm, FakeDataKeySource> { @@ -26,16 +26,15 @@ fn search<'a, S: AsRef>( ) -> Pending<'a, MatchTerms, FakeDataKeySource> { keyset.run(matching::<_, _, Owned, _>(), value, CallerContext::from(nonempty!("column"))) } -// Bounded only by the scheme's own trait: `CllwOreEncrypt` and -// `CllwOpeEncrypt` do not imply `Clone`, so `Clone` returning to either -// constructor's bounds fails this file. +// Bounded only by the order terms' own trait: `Orderable` does not imply +// `Clone`, so `Clone` returning to either constructor's bounds fails this +// file. fn order<'a, S>( keyset: &'a KeysetCipher<'_, FakeDataKeySource>, value: S, ) -> Pending<'a, OreTerm, FakeDataKeySource> where - S: CllwOreEncrypt + Send + 'static, - S::Output: Send + 'static, + S: Orderable, { keyset.run(ore::<_, _, Owned>(), value, CallerContext::from(nonempty!("column"))) } @@ -44,8 +43,7 @@ fn order_preserving<'a, S>( value: S, ) -> Pending<'a, OpeTerm, FakeDataKeySource> where - S: CllwOpeEncrypt + Send + 'static, - S::Output: Send + 'static, + S: Orderable, { keyset.run(ope::<_, _, Owned>(), value, CallerContext::from(nonempty!("column"))) } diff --git a/packages/stack-encrypt/tests/ui/pass/plan_chain.rs b/packages/stack-encrypt/tests/ui/pass/plan_chain.rs index 16671c333..38323e9a4 100644 --- a/packages/stack-encrypt/tests/ui/pass/plan_chain.rs +++ b/packages/stack-encrypt/tests/ui/pass/plan_chain.rs @@ -1,6 +1,7 @@ //! The chain shapes that must compile: a value with a context, indexed, //! field by field, a saved plan over a value and a collection, a query and //! an opening, and several chains batched. +use stack_encrypt::op; use stack_encrypt::kms::FakeDataKeySource; use stack_encrypt::plan::{Field, Fields}; use stack_encrypt::{Equality, Error, Match, Ore, Plan, StackCipher}; @@ -33,7 +34,7 @@ async fn chains(cipher: &StackCipher, person: &Person) -> Res .encrypt(person) .context("people") .fields() - .encrypt_index::("email", (Equality, Match::default())) + .encrypt_index::("email", (Equality, Match)) .encrypt::("age") .keyset("tenant") .extend(7u64) @@ -46,14 +47,31 @@ async fn chains(cipher: &StackCipher, person: &Person) -> Res let row = cipher.encrypt(person).using(&people_plan).await?; let _ = cipher.open(row).using(&people_plan).await?; let email_plan = people_plan.field("email")?; - let _ = cipher.query("bob@example.com").using(&email_plan).equality().await?; + let _ = cipher.query(op::Eq, "bob@example.com").on(&email_plan).await?; + let name_plan = Plan::context("people/name") + .with::(stack_encrypt::Match) + .build()?; + let _ = cipher.query(op::Matches, "ali").on(&name_plan).await?; + let _ = cipher + .query(op::Matches, "ali") + .via(Match) + .context("people/name") + .on(&people_plan.field("email")?) + .await; let age_plan = Plan::context("people/age").with((Equality, Ore)).build()?; + let surname_plan = Plan::context("people/surname").with::(Ore).build()?; + let _ = cipher.query(op::Lt, "nguyen").on(&surname_plan).await?; + let _ = cipher + .query(op::Between, &("a".to_owned(), "m".to_owned())) + .on(&surname_plan) + .await?; let ages = vec![1u32, 2]; let _ = cipher.encrypt(&ages).using(&age_plan).await?; - let _ = cipher.query(&3u32).using(&age_plan).index::().await?; + let _ = cipher.query(op::Lt, &3u32).on(&age_plan).await?; + let _ = cipher.query(op::Between, &(1u32, 5)).on(&age_plan).await?; let _ = stack_encrypt::all(( cipher.encrypt(person).using(&people_plan), - cipher.query(&3u32).using(&age_plan).equality(), + cipher.query(op::Eq, &3u32).on(&age_plan), )) .await?; Ok(()) diff --git a/packages/stack-encrypt/tests/ui/pass/query_only_and_borrowed.rs b/packages/stack-encrypt/tests/ui/pass/query_only_and_borrowed.rs index 3ff7a83e1..3fb03fd8f 100644 --- a/packages/stack-encrypt/tests/ui/pass/query_only_and_borrowed.rs +++ b/packages/stack-encrypt/tests/ui/pass/query_only_and_borrowed.rs @@ -1,12 +1,13 @@ -use stack_encrypt::{EncryptFrom, StackCipher, StackCipherText, nonempty}; +use stack_encrypt::{EncryptFrom, Encrypt, StackCipher, StackCipherText, nonempty}; use stack_encrypt::sem::EqualityTerm; use stack_kms::FakeDataKeySource; #[derive(EncryptFrom)] struct Probe { hm: EqualityTerm } -// No Encrypt bound: producing a term requires only the PRF capability. -fn query(cipher:&StackCipher, value:&S) { +// No `Decrypt` bound: producing a term requires only that the value +// describes itself, not that it can be read back. +fn query(cipher:&StackCipher, value:&S) { let keyset=cipher.default_keyset(); let _ = keyset.encrypt_as::<_,Probe>(value,nonempty!("column").into()); } diff --git a/packages/stack-encrypt/tests/ui/plaintext_needs_encrypt.stderr b/packages/stack-encrypt/tests/ui/plaintext_needs_encrypt.stderr index dd4c11198..a8539066c 100644 --- a/packages/stack-encrypt/tests/ui/plaintext_needs_encrypt.stderr +++ b/packages/stack-encrypt/tests/ui/plaintext_needs_encrypt.stderr @@ -11,17 +11,28 @@ help: the trait `stack_encrypt::Encrypt` is not implemented for `SerdeOnly` | 4 | struct SerdeOnly { value: String } | ^^^^^^^^^^^^^^^^ +note: there are multiple different versions of crate `vitaminc_aead` in the dependency graph + --> $CARGO/vitaminc-aead-$VERSION/src/plaintext/mod.rs + | + | pub trait Encrypt { + | ^^^^^^^^^^^^^^^^^ this is the expected trait + | + ::: $CARGO/vitaminc-aead-$VERSION/src/encrypt/mod.rs + | + | pub trait Encrypt { + | ----------------- this is the trait that was imported + = help: you can use `cargo tree` to explore your dependency tree = help: the following other types implement trait `stack_encrypt::Encrypt`: - &str - ContextTag - FfiValue - HashMap - Vec - Vec - [u8; N] - stack_encrypt::Element + &&'b T + &'a BTreeMap + &'a HashMap + &'a Vec + &'a [T] + &'a std::option::Option + &'a vitaminc_protected::protected::Protected + &PassthroughFrame and $N others - = note: required for `CipherText>` to implement `EncryptFrom` + = note: required for `CipherText` to implement `EncryptFrom` = note: 1 redundant requirement hidden = note: required for `Target` to implement `EncryptFrom` note: required by a bound in `target::operations::>::encrypt_as` diff --git a/packages/stack-encrypt/tests/ui/plan_match_on_integer.rs b/packages/stack-encrypt/tests/ui/plan_match_on_integer.rs index ca5ba34f3..699d6163b 100644 --- a/packages/stack-encrypt/tests/ui/plan_match_on_integer.rs +++ b/packages/stack-encrypt/tests/ui/plan_match_on_integer.rs @@ -21,5 +21,5 @@ impl Field for User { fn main() { let _ = Plan::context("users") .fields::() - .encrypt_index::("age", Match::default()); + .encrypt_index::("age", Match); } diff --git a/packages/stack-encrypt/tests/ui/plan_match_on_integer.stderr b/packages/stack-encrypt/tests/ui/plan_match_on_integer.stderr index af4212052..35d448a70 100644 --- a/packages/stack-encrypt/tests/ui/plan_match_on_integer.stderr +++ b/packages/stack-encrypt/tests/ui/plan_match_on_integer.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `u32: AsRef` is not satisfied --> tests/ui/plan_match_on_integer.rs:24:10 | -24 | .encrypt_index::("age", Match::default()); +24 | .encrypt_index::("age", Match); | ^^^^^^^^^^^^^ the trait `AsRef` is not implemented for `u32` | help: the trait `stack_encrypt::Index` is implemented for `stack_encrypt::Match` diff --git a/packages/stack-encrypt/tests/ui/plan_query_undeclared_index.rs b/packages/stack-encrypt/tests/ui/plan_query_undeclared_index.rs index 9a53fb472..26f9f5e92 100644 --- a/packages/stack-encrypt/tests/ui/plan_query_undeclared_index.rs +++ b/packages/stack-encrypt/tests/ui/plan_query_undeclared_index.rs @@ -1,11 +1,12 @@ //! A one-value plan selects a query's index by type, so asking it for an //! index it does not hold does not compile. +use stack_encrypt::op; use stack_encrypt::kms::FakeDataKeySource; use stack_encrypt::{Ore, Plan, StackCipher}; async fn query(cipher: &StackCipher) { let age_plan = Plan::context("users/age").with::(Ore).build().unwrap(); - let _ = cipher.query(&34u32).using(&age_plan).equality(); + let _ = cipher.query(op::Eq, &34u32).on(&age_plan); } fn main() {} diff --git a/packages/stack-encrypt/tests/ui/plan_query_undeclared_index.stderr b/packages/stack-encrypt/tests/ui/plan_query_undeclared_index.stderr index 8cb4e2b22..a26c14f20 100644 --- a/packages/stack-encrypt/tests/ui/plan_query_undeclared_index.stderr +++ b/packages/stack-encrypt/tests/ui/plan_query_undeclared_index.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `stack_encrypt::Ore: Select` is not satisfied - --> tests/ui/plan_query_undeclared_index.rs:8:51 + --> tests/ui/plan_query_undeclared_index.rs:9:42 | -8 | let _ = cipher.query(&34u32).using(&age_plan).equality(); - | ^^^^^^^^ the trait `Select` is not implemented for `stack_encrypt::Ore` +9 | let _ = cipher.query(op::Eq, &34u32).on(&age_plan); + | ^^ the trait `Select` is not implemented for `stack_encrypt::Ore` | = help: the following other types implement trait `Select`: `(A, B)` implements `Select>` @@ -14,11 +14,32 @@ error[E0277]: the trait bound `stack_encrypt::Ore: Select>` `(A, B, C, D)` implements `Select>` and $N others -note: required by a bound in `QueryUsing::<'a, F, ValuePlan>, K>::equality` + = note: required for `ValuePlan>` to implement `Chooses` + +error[E0277]: the trait bound `stack_encrypt::Ore: Select` is not satisfied + --> tests/ui/plan_query_undeclared_index.rs:9:45 + | +9 | let _ = cipher.query(op::Eq, &34u32).on(&age_plan); + | -- ^^^^^^^^^ the trait `Select` is not implemented for `stack_encrypt::Ore` + | | + | required by a bound introduced by this call + | + = help: the following other types implement trait `Select`: + `(A, B)` implements `Select>` + `(A, B)` implements `Select>` + `(A, B, C)` implements `Select>` + `(A, B, C)` implements `Select>` + `(A, B, C)` implements `Select>` + `(A, B, C, D)` implements `Select>` + `(A, B, C, D)` implements `Select>` + `(A, B, C, D)` implements `Select>` + and $N others + = note: required for `ValuePlan>` to implement `Chooses` +note: required by a bound in `QueryBuilder::<'a, Op, F, K>::on` --> src/plan/chain.rs | - | pub fn equality(self) -> QueryIndex<'a, F, Equality, K> - | -------- required by a bound in this associated function -... - | X: Select, - | ^^^^^^^^^^^^^^^^^^^^ required by this bound in `QueryUsing::<'a, F, ValuePlan>, K>::equality` + | pub fn on(self, plan: &P) -> QueryOp<'a, F, Op, P::Via, K> + | -- required by a bound in this associated function + | where + | P: Chooses, + | ^^^^^^^^^^^^^^^^^^ required by this bound in `QueryBuilder::<'a, Op, F, K>::on` diff --git a/packages/stack-encrypt/tests/ui/struct_field_must_open.rs b/packages/stack-encrypt/tests/ui/struct_field_must_open.rs index 5394b539f..dfa8c9837 100644 --- a/packages/stack-encrypt/tests/ui/struct_field_must_open.rs +++ b/packages/stack-encrypt/tests/ui/struct_field_must_open.rs @@ -1,13 +1,29 @@ //! Every field of a `struct = ..` record opens back into the plaintext //! field it is derived from (`DecryptField`), even when //! the record derives `EncryptFrom` alone: the record's plan seals and -//! opens each field. A borrowed plaintext field cannot be opened into, and -//! a target with no `DecryptField` cannot open. +//! opens each field. A plaintext field with no `Decrypt`, such as one that +//! borrows its text, cannot be opened into, and a target with no +//! `DecryptField` cannot open. use stack_encrypt::target::{Decryptable, Encryption, AeadContext}; -use stack_encrypt::{EncryptFrom, StackCipherText}; +use stack_encrypt::{EncryptFrom, Encrypt, StackCipherText}; +use vitaminc_aead::plaintext::Sink; + +/// Text it borrows: it seals, and there is nothing to open it into. +#[derive(Clone)] +struct Name(&'static str); +impl Encrypt for Name { + fn visit(self, sink: S) -> Result { + self.0.visit(sink) + } +} +impl Encrypt for &Name { + fn visit(self, sink: S) -> Result { + self.0.visit(sink) + } +} struct Profile { - name: &'static str, + name: Name, bio: String, } diff --git a/packages/stack-encrypt/tests/ui/struct_field_must_open.stderr b/packages/stack-encrypt/tests/ui/struct_field_must_open.stderr index 40c9d95bf..59383c476 100644 --- a/packages/stack-encrypt/tests/ui/struct_field_must_open.stderr +++ b/packages/stack-encrypt/tests/ui/struct_field_must_open.stderr @@ -1,18 +1,27 @@ -error[E0277]: the trait bound `&str: Decrypt<'static>` is not satisfied - --> tests/ui/struct_field_must_open.rs:29:11 - | -29 | name: StackCipherText, - | ^^^^^^^^^^^^^^^ the trait `Decrypt<'static>` is not implemented for `&str` - | -help: the trait `Decrypt<'static>` is not implemented for `&str` - but trait `Decrypt<'_>` is implemented for `std::string::String` - --> $CARGO/vitaminc-aead-$VERSION/src/decrypt/impls.rs - | - | impl<'c> Decrypt<'c> for String { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = help: for that trait implementation, expected `std::string::String`, found `&str` - = note: required for `CipherText>` to implement `DecryptInto<&str>` - = note: required for `CipherText>` to implement `DecryptField<&str, CallerContext>` +error[E0277]: the trait bound `Name: FromScalar` is not satisfied + --> tests/ui/struct_field_must_open.rs:45:11 + | +45 | name: StackCipherText, + | ^^^^^^^^^^^^^^^ unsatisfied trait bound + | +help: the trait `FromScalar` is not implemented for `Name` + --> tests/ui/struct_field_must_open.rs:13:1 + | +13 | struct Name(&'static str); + | ^^^^^^^^^^^ + = help: the following other types implement trait `FromScalar`: + Vec + [u8; N] + bool + f32 + f64 + i128 + i16 + i32 + and $N others + = note: required for `Name` to implement `Decrypt` + = note: required for `CipherText` to implement `DecryptInto` + = note: required for `CipherText` to implement `DecryptField` note: required by a bound in `FieldsBuilder::::encrypt_into` --> src/plan/build.rs | @@ -23,22 +32,22 @@ note: required by a bound in `FieldsBuilder::::encrypt_into` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `FieldsBuilder::::encrypt_into` error[E0277]: the trait bound `Opaque: DecryptField` is not satisfied - --> tests/ui/struct_field_must_open.rs:30:10 + --> tests/ui/struct_field_must_open.rs:46:10 | -30 | bio: Opaque, +46 | bio: Opaque, | ^^^^^^ unsatisfied trait bound | help: the trait `DecryptField` is not implemented for `Opaque` - --> tests/ui/struct_field_must_open.rs:15:1 + --> tests/ui/struct_field_must_open.rs:31:1 | -15 | struct Opaque(#[allow(dead_code)] StackCipherText); +31 | struct Opaque(#[allow(dead_code)] StackCipherText); | ^^^^^^^^^^^^^ = help: the following other types implement trait `DecryptField`: `(A, B)` implements `DecryptField` `(A, B, C)` implements `DecryptField` `(A, B, C, D)` implements `DecryptField` `(A, B, C, D, E)` implements `DecryptField` - `CipherText>` implements `DecryptField` + `CipherText` implements `DecryptField` `Encrypted` implements `DecryptField` `EqualityTerm` implements `DecryptField` `MatchTerms` implements `DecryptField` diff --git a/packages/stack-encrypt/tests/value_kinds.rs b/packages/stack-encrypt/tests/value_kinds.rs new file mode 100644 index 000000000..b15247e9f --- /dev/null +++ b/packages/stack-encrypt/tests/value_kinds.rs @@ -0,0 +1,534 @@ +//! The value-kinds fixture: one field of each kind a binding gained with +//! #1144 (`int8`, `int16`, `uint8`, `uint16`, `int128`, `uint128`, `date`, +//! `timestamp`, `decimal`), sealed by the data-plan lowering under a +//! deterministic key source, with each value's transport frame, each term, +//! and the equality queries vitaminc-normalize folds onto a stored term. +//! +//! `tests/fixtures/value_kinds.json` is what the Go SDK's `encrypt` tests +//! read: a generated Go type with the same context and identities opens the +//! sealed record, writes each value as the same frame, and derives the same +//! terms through the deterministic guest. Here the record path, the data +//! query path and the typed path are held to the same bytes. +//! +//! Regenerate with `STACK_ENCRYPT_UPDATE_FIXTURES=1 cargo test -p +//! stack-encrypt --all-features --test value_kinds`. Only the sealed bytes +//! change between runs (every leaf carries a fresh nonce); the frames and the +//! terms must not, and the test fails if they do. The schema is in the +//! README beside the fixture. +#![cfg(feature = "dynamic")] + +mod common; + +use std::path::PathBuf; + +use common::frames::{frame as value_of, object, payload}; +use common::{deterministic_cipher, DeterministicSource}; +use serde_json::{json, Map, Value as Json}; +use stack_encrypt::dynamic::record::{self, Plan as DataPlan}; +use stack_encrypt::dynamic::{ + context, query_term, Error, NoTargets, OpSpec, Operand, Reason, Scope, ValueFrame, ValueKind, +}; +use stack_encrypt::target::IndexSpec; +use stack_encrypt::{CipherText, KeysetCipher, SealedValue, StackCipher, StackCipherText}; +use vitaminc_aead::plaintext::{Int, Logical, Physical, Raw, TimeUnit}; +use vitaminc_aead::plaintext::{MapSink, Sink}; +use vitaminc_aead::{Encrypt, FrameWriter}; + +const SEED: [u8; 32] = *b"stack-encrypt value kinds v1 "; + +/// The table both languages share: one field per kind, its outputs, the +/// value in the text a Go test parses, and the value as the engine holds +/// it. +struct Kind { + field: &'static str, + kind: ValueKind, + outputs: &'static [&'static str], + text: &'static str, + value: Raw<'static>, +} + +fn int(int: Int) -> Raw<'static> { + Raw(None, Physical::Int(int)) +} + +fn date(days: i32) -> Raw<'static> { + Raw(Some(Logical::Date), Physical::Int(Int::I32(days))) +} + +fn instant(nanos: i128) -> Raw<'static> { + Raw( + Some(Logical::Timestamp(TimeUnit::Nanos)), + Physical::Int(Int::I128(nanos)), + ) +} + +fn decimal(mantissa: i128, scale: u8) -> Raw<'static> { + Raw( + Some(Logical::Decimal { scale }), + Physical::Int(Int::I128(mantissa)), + ) +} + +/// A value as the engine holds it: its frame. +fn value(raw: Raw<'_>) -> ValueFrame { + ValueFrame::of(raw).expect("in the value model") +} + +/// 2026-10-17T01:02:03.123456789Z, in nanoseconds since the epoch. +const AT: i128 = 1_792_198_923_123_456_789; + +fn kinds() -> Vec { + vec![ + Kind { + field: "i8", + kind: ValueKind::Int8, + outputs: &["c", "eq"], + text: "-8", + value: int(Int::I8(-8)), + }, + Kind { + field: "i16", + kind: ValueKind::Int16, + outputs: &["c", "eq", "ore"], + text: "-300", + value: int(Int::I16(-300)), + }, + Kind { + field: "u8", + kind: ValueKind::UInt8, + outputs: &["c", "eq"], + text: "200", + value: int(Int::U8(200)), + }, + Kind { + field: "u16", + kind: ValueKind::UInt16, + outputs: &["c", "eq", "ope"], + text: "60000", + value: int(Int::U16(60_000)), + }, + Kind { + field: "i128", + kind: ValueKind::Int128, + outputs: &["c", "eq", "ore"], + text: "-170141183460469231731687303715884105728", + value: int(Int::I128(i128::MIN)), + }, + Kind { + field: "u128", + kind: ValueKind::UInt128, + outputs: &["c", "eq", "ope"], + text: "340282366920938463463374607431768211455", + value: int(Int::U128(u128::MAX)), + }, + Kind { + field: "date", + kind: ValueKind::Date, + outputs: &["c", "eq"], + text: "2024-02-29", + value: date(19_782), + }, + Kind { + field: "at", + kind: ValueKind::Timestamp, + outputs: &["c", "eq"], + text: "2026-10-17T01:02:03.123456789Z", + value: instant(AT), + }, + Kind { + field: "amount", + kind: ValueKind::Decimal, + outputs: &["c", "eq"], + text: "-1234.5600", + value: decimal(-12_345_600, 4), + }, + ] +} + +/// Equality queries whose input differs from the stored value and whose +/// term is the stored one: vitaminc-normalize drops a decimal's trailing +/// zeros and a timestamp's nanoseconds below the microsecond. +fn folded_queries() -> Vec<(&'static str, &'static str, Raw<'static>)> { + vec![ + ("amount", "-1234.56", decimal(-123_456, 2)), + ("at", "2026-10-17T01:02:03.123456Z", instant(AT - 789)), + ] +} + +fn data_plan_json() -> Json { + let mut plan = Map::new(); + for kind in kinds() { + let _ = plan.insert( + kind.field.into(), + json!({ + "context": ["value_kinds", kind.field], + "outputs": kind.outputs, + "type": kind.kind.name(), + }), + ); + } + Json::Object(plan) +} + +fn data_plan() -> DataPlan { + let fields = kinds() + .into_iter() + .map(|kind| { + ( + kind.field, + object(vec![ + ("context", value_of(vec!["value_kinds", kind.field])), + ("outputs", value_of(kind.outputs.to_vec())), + ("type", value_of(kind.kind.name())), + ]), + ) + }) + .collect(); + record::plan(object(fields).risky_ref()).expect("the data plan parses") +} + +/// The source as a binding hands it over: one frame, a map of the fields in +/// plan order. +fn source() -> ValueFrame { + let mut bytes = Vec::new(); + { + let kinds = kinds(); + let mut map = FrameWriter::new(&mut bytes) + .map(Some(kinds.len())) + .expect("a map"); + for kind in kinds { + kind.value + .visit(map.entry(kind.field).expect("an entry")) + .expect("written"); + } + map.end().expect("ended"); + } + ValueFrame::from_bytes(&bytes).expect("in the value model") +} + +fn hex(bytes: &[u8]) -> String { + bytes.iter().map(|b| format!("{b:02x}")).collect() +} + +fn unhex(text: &str) -> Vec { + (0..text.len()) + .step_by(2) + .map(|i| u8::from_str_radix(&text[i..i + 2], 16).expect("hex")) + .collect() +} + +fn frame(raw: Raw<'_>) -> String { + hex(value(raw).risky_ref()) +} + +fn term_bytes(node: StackCipherText) -> Vec { + let CipherText::Passthrough(payload) = node else { + panic!("a term rides as a passthrough"); + }; + vitaminc_aead_frame::serde::from_slice::<&[u8]>(&payload.0) + .expect("a term is bytes") + .to_vec() +} + +/// A stored record as JSON: `"c"` is the leaf's frozen bytes and a term its +/// bytes, both hex. +fn json_of_record(tree: StackCipherText) -> Json { + let CipherText::Map(fields) = tree else { + panic!("a record is a map of fields"); + }; + let mut out = Map::new(); + for (name, node) in fields { + let CipherText::Map(outputs) = node else { + panic!("a field is a map of outputs"); + }; + let mut field = Map::new(); + for (key, node) in outputs { + let value = match node { + CipherText::Single(leaf) => json!(hex(&leaf.to_bytes())), + term => json!(hex(&term_bytes(term))), + }; + let _ = field.insert(key, value); + } + let _ = out.insert(name, Json::Object(field)); + } + Json::Object(out) +} + +fn record_of_json(record: &Json) -> StackCipherText { + CipherText::Map( + record + .as_object() + .expect("an object") + .iter() + .map(|(name, outputs)| { + let nodes = outputs + .as_object() + .expect("an object") + .iter() + .map(|(key, value)| { + let bytes = unhex(value.as_str().expect("hex")); + let node = if key == "c" { + CipherText::Single(SealedValue::from_bytes(&bytes).expect("a leaf")) + } else { + CipherText::Passthrough(stack_encrypt::PassthroughFrame(payload(bytes))) + }; + (key.clone(), node) + }) + .collect(); + (name.clone(), CipherText::Map(nodes)) + }) + .collect(), + ) +} + +/// Every term of a record by `field/key`, so two records compare on their +/// terms whatever their nonces. +fn terms_of(record: &Json) -> Map { + let mut terms = Map::new(); + for (name, outputs) in record.as_object().expect("an object") { + for (key, value) in outputs.as_object().expect("an object") { + if key != "c" { + let _ = terms.insert(format!("{name}/{key}"), value.clone()); + } + } + } + terms +} + +async fn seal(cipher: &StackCipher, plan: &DataPlan) -> StackCipherText { + record::encrypt(&cipher.default_keyset(), source(), plan) + .expect("the source fits") + .await + .expect("the lowering seals") +} + +/// The opened record's frame, hex, which is the source's frame byte for +/// byte when every value opens exactly as it was sealed: a decimal's scale +/// and a timestamp's nanoseconds count. +async fn open( + cipher: &StackCipher, + tree: StackCipherText, + plan: &DataPlan, +) -> String { + hex(record::decrypt(Scope::Client(cipher), tree, plan, None) + .expect("the record fits") + .await + .expect("the lowering opens it") + .risky_ref()) +} + +fn expected_frames() -> String { + hex(source().risky_ref()) +} + +async fn query( + keyset: &KeysetCipher<'_, DeterministicSource>, + plan: &DataPlan, + field: &str, + operator: OpSpec, + input: Raw<'_>, +) -> Vec { + let term = query_term(keyset, plan, field, operator, input, &NoTargets) + .expect("the query fits") + .await + .expect("the term derives"); + match term.operand() { + Operand::One(bytes) => bytes.clone(), + Operand::Range { .. } => panic!("one term"), + } +} + +fn fixture_path() -> PathBuf { + PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/value_kinds.json") +} + +/// The record path, the data query path and the typed path derive one term +/// for each value, and the record opens to exactly what was sealed. +#[tokio::test] +async fn every_new_kind_seals_opens_and_queries_as_the_typed_path() { + let cipher = deterministic_cipher(SEED).await; + let keyset = cipher.default_keyset(); + let plan = data_plan(); + let sealed = json_of_record(seal(&cipher, &plan).await); + assert_eq!( + open(&cipher, record_of_json(&sealed), &plan).await, + expected_frames(), + "each value opens exactly as it was sealed" + ); + for kind in kinds() { + let stored = |key: &str| unhex(sealed[kind.field][key].as_str().expect("a term")); + let eq = query(&keyset, &plan, kind.field, OpSpec::Eq, kind.value).await; + assert_eq!( + eq, + stored("eq"), + "{} eq: the query is the stored term", + kind.field + ); + let ctx = context( + &vitaminc_aead_frame::serde::to_vec(&("value_kinds", kind.field)).expect("frames"), + ) + .expect("context"); + let typed_eq = keyset + .equality_term(kind.value, ctx.clone()) + .await + .expect("the typed path derives"); + assert_eq!( + eq, + typed_eq.into_bytes().to_vec(), + "{} eq: the typed path's term", + kind.field + ); + for (key, index) in [("ore", IndexSpec::Ore), ("ope", IndexSpec::Ope)] { + if kind.outputs.contains(&key) { + let lt = query(&keyset, &plan, kind.field, OpSpec::Lt, kind.value).await; + assert_eq!(lt, stored(key), "{} {key}", kind.field); + let probe = stack_encrypt::dynamic::term(&keyset, kind.value, &index, ctx.clone()) + .await + .expect("derives"); + assert_eq!(probe, stored(key), "{} {key} probe", kind.field); + } + } + } + for (field, _, input) in folded_queries() { + let stored = unhex(sealed[field]["eq"].as_str().expect("a term")); + assert_eq!( + query(&keyset, &plan, field, OpSpec::Eq, input).await, + stored, + "{field}: vitaminc-normalize folds the query onto the stored term" + ); + } +} + +/// A value of another width is not of the field's kind: sealing refuses +/// it, naming the field, where a query reads it as the field's kind. +#[tokio::test] +async fn a_value_of_another_width_is_refused_when_sealed() { + let cipher = deterministic_cipher(SEED).await; + let plan = data_plan(); + // The source with the `int8` field's value sent at 32 bits. + let mut bytes = Vec::new(); + { + let kinds = kinds(); + let mut map = FrameWriter::new(&mut bytes) + .map(Some(kinds.len())) + .expect("a map"); + for kind in kinds { + let entry = map.entry(kind.field).expect("an entry"); + match kind.field { + "i8" => int(Int::I32(-8)).visit(entry), + _ => kind.value.visit(entry), + } + .expect("written"); + } + map.end().expect("ended"); + } + let keyset = cipher.default_keyset(); + let source = vitaminc_aead::Frame::parse(&bytes).expect("a frame"); + let refused = record::encrypt(&keyset, source, &plan); + assert!( + matches!(&refused, Err(error) if error.field() == Some("i8") && error.reason() == Some(Reason::FieldType)), + "an int32 is not an int8: {:?}", + refused.err() + ); + let ore_on_a_date = record::plan( + object(vec![( + "day", + object(vec![ + ("context", value_of(vec!["value_kinds", "day"])), + ("outputs", value_of(vec!["ore"])), + ("type", value_of("date")), + ]), + )]) + .risky_ref(), + ); + assert!(matches!( + ore_on_a_date, + Err(Error::Plan { + reason: Reason::OrderTermPending, + .. + }) + )); +} + +/// The committed fixture: the record sealed in an earlier run opens now, its +/// terms and frames are today's, and each folded query lands on its stored +/// term. With `STACK_ENCRYPT_UPDATE_FIXTURES=1` the record is sealed afresh +/// and the file written. +#[tokio::test] +async fn the_committed_fixture_opens_and_its_terms_are_todays() { + let cipher = deterministic_cipher(SEED).await; + let keyset = cipher.default_keyset(); + let plan = data_plan(); + let path = fixture_path(); + let values = || -> Json { + kinds() + .into_iter() + .map(|kind| { + json!({ + "field": kind.field, + "type": kind.kind.name(), + "text": kind.text, + "frame": frame(kind.value), + }) + }) + .collect() + }; + + if std::env::var_os("STACK_ENCRYPT_UPDATE_FIXTURES").is_some() { + let record = json_of_record(seal(&cipher, &plan).await); + let mut queries = Vec::new(); + for (field, text, input) in folded_queries() { + let term = query(&keyset, &plan, field, OpSpec::Eq, input).await; + queries.push(json!({ + "field": field, + "operator": "eq", + "text": text, + "frame": frame(input), + "term": hex(&term), + })); + } + let fixture = json!({ + "_comment": "One field of each value kind added in #1144, sealed by the data-plan lowering under a deterministic key source, with each value's transport frame and the equality queries vitaminc-normalize folds onto a stored term. Read by tests/value_kinds.rs and the Go SDK's encrypt tests; the schema is in README.md beside this file. Regenerate with STACK_ENCRYPT_UPDATE_FIXTURES=1; do not edit by hand.", + "key_source": { "kind": "deterministic-sha256", "seed": hex(&SEED) }, + "keyset_id": keyset.keyset_id().to_string(), + "plan": data_plan_json(), + "values": values(), + "record": record, + "queries": queries, + }); + let mut text = serde_json::to_string_pretty(&fixture).expect("serialise"); + text.push('\n'); + std::fs::write(&path, text).expect("write the fixture"); + } + + let fixture: Json = + serde_json::from_str(&std::fs::read_to_string(&path).expect("the fixture is committed")) + .expect("the fixture is JSON"); + assert_eq!(fixture["key_source"]["seed"], json!(hex(&SEED))); + assert_eq!(fixture["keyset_id"], json!(keyset.keyset_id().to_string())); + assert_eq!( + fixture["plan"], + data_plan_json(), + "the declaration is this one" + ); + assert_eq!(fixture["values"], values(), "each value frames as it did"); + + let record = &fixture["record"]; + let now = json_of_record(seal(&cipher, &plan).await); + assert_eq!(terms_of(record), terms_of(&now), "the terms are today's"); + assert_eq!( + open(&cipher, record_of_json(record), &plan).await, + expected_frames(), + "the committed record opens to the values" + ); + let queries = fixture["queries"].as_array().expect("a list"); + assert_eq!(queries.len(), folded_queries().len()); + for (entry, (field, text, input)) in queries.iter().zip(folded_queries()) { + assert_eq!(entry["field"], json!(field)); + assert_eq!(entry["text"], json!(text)); + assert_eq!(entry["frame"], json!(frame(input))); + assert_eq!(entry["term"], record[field]["eq"], "{field}: folded"); + let term = query(&keyset, &plan, field, OpSpec::Eq, input).await; + assert_eq!(json!(hex(&term)), entry["term"], "{field}: today's"); + } +} diff --git a/packages/stack-guest-abi/Cargo.toml b/packages/stack-guest-abi/Cargo.toml index 3d3179922..d125c2d48 100644 --- a/packages/stack-guest-abi/Cargo.toml +++ b/packages/stack-guest-abi/Cargo.toml @@ -16,18 +16,18 @@ publish = false [dependencies] zeroize = { workspace = true } # `last_error`: an error is any miette diagnostic plus its structured fields -# (a serde_json map, as `ErrorPayload::payload` gives them), encoded in the -# one transport codec every input and output already uses. +# (a serde_json map, as `ErrorPayload::payload` gives them), encoded as a +# `HostValue` in the one transport frame every input and output uses. miette = { workspace = true } serde_json = { workspace = true } thiserror = { workspace = true } -vitaminc-aead-value = { workspace = true } - -# Only `transport` (wasm32-only) needs these: the import's error type and -# `OpaqueDebug` for its response, whose body can carry wrapped key material -# or a credential and so never prints. Declared for that target alone, so a -# native build carries nothing it does not use and `cargo udeps` sees none. -[target.'cfg(target_arch = "wasm32")'.dependencies] +# `value`: a `HostValue` describes itself to vitaminc's plaintext model and +# crosses to the host as a transport frame. +vitaminc-aead = { workspace = true } +vitaminc-aead-frame = { workspace = true } +# `HostValue::Bytes` holds its bytes in `Protected`, and `transport` +# (wasm32-only) uses `OpaqueDebug` for its response, whose body can carry +# wrapped key material or a credential and so never prints. vitaminc-protected = { workspace = true } [dev-dependencies] @@ -36,3 +36,6 @@ vitaminc-protected = { workspace = true } # host holds, run natively and under Miri. `std` only: the `fork` and # `timeout` defaults spawn processes and threads Miri cannot interpret. proptest = { version = "1.7", default-features = false, features = ["std"] } +# `step`'s tests drive the loop through the combinators the ZeroKMS client +# runs its requests with (`buffered`, `join`). +futures = { version = "0.3", default-features = false, features = ["std", "async-await"] } diff --git a/packages/stack-guest-abi/src/abi.rs b/packages/stack-guest-abi/src/abi.rs index 90d363e35..bc04e172e 100644 --- a/packages/stack-guest-abi/src/abi.rs +++ b/packages/stack-guest-abi/src/abi.rs @@ -71,7 +71,7 @@ pub fn export(f: impl FnOnce() -> Result, u32>) -> u64 { } /// The full error behind the most recent failed export, as a packed buffer -/// result: a transport-codec object of `code`, `message`, `help`, `url` +/// result: a transport-frame map of `code`, `message`, `help`, `url` /// (when set), `severity`, `fields` and `causes` (see /// [`last_error::encode`]). Zero when there is none — no export has failed /// since the last success, or the error was already handed over. diff --git a/packages/stack-guest-abi/src/buffers.rs b/packages/stack-guest-abi/src/buffers.rs index f5cc9207b..109b56e9f 100644 --- a/packages/stack-guest-abi/src/buffers.rs +++ b/packages/stack-guest-abi/src/buffers.rs @@ -135,6 +135,7 @@ pub fn wipe_all() { // The recorded last error is one of these buffers; its slot must not // outlive the wipe and name freed memory. crate::last_error::forget(); + crate::step::forget_pending(); let live = BUFFERS.with(|b| core::mem::take(&mut *b.borrow_mut())); for (ptr, len) in live { // SAFETY: every entry was registered by `register`, which leaked a diff --git a/packages/stack-guest-abi/src/call.rs b/packages/stack-guest-abi/src/call.rs index a215404c0..9ed9f9e78 100644 --- a/packages/stack-guest-abi/src/call.rs +++ b/packages/stack-guest-abi/src/call.rs @@ -16,6 +16,7 @@ use std::panic::{catch_unwind, AssertUnwindSafe}; use crate::buffers; use crate::last_error; +use crate::status::STATUS_NEEDS_IO; /// Run an export's body: clear the last error, run `f` (a panic is an /// internal failure), and then clear the last error again if `f` succeeded, @@ -34,6 +35,11 @@ pub fn run(f: impl FnOnce() -> Result) -> Result { last_error::clear(); Ok(out) } + // A paused operation has not failed: nothing is recorded. + Err(STATUS_NEEDS_IO) => { + last_error::clear(); + Err(STATUS_NEEDS_IO) + } Err(status) => { last_error::ensure(status); Err(status) @@ -93,7 +99,19 @@ pub fn take_last_error() -> Option> { mod tests { use super::*; use crate::status::{STATUS_ENCODING, STATUS_INTERNAL}; - use vitaminc_aead_value::{transport as codec, FfiValue}; + + /// A paused operation is not a failure: it records no error, and clears + /// one recorded on the way to the pause. + #[test] + fn a_pause_records_no_error() { + let paused = run::<()>(|| { + let _ = last_error::malformed("on the way"); + Err(STATUS_NEEDS_IO) + }); + assert_eq!(paused, Err(STATUS_NEEDS_IO)); + assert!(!last_error::is_set()); + } + use crate::value::HostValue; /// A packed result, read the way the Go host reads it. #[derive(Debug, PartialEq)] @@ -117,16 +135,8 @@ mod tests { /// The recorded error's code, handed over as the host would get it. fn last_code() -> Option { let bytes = take_last_error()?; - let value = codec::decode_value(&mut codec::Reader::new(&bytes)).expect("decodes"); - let FfiValue::Object(entries) = value else { - return None; - }; - entries.into_iter().find_map(|(key, value)| match value { - FfiValue::String(code) if key == "code" => { - String::from_utf8(code.risky_ref().to_vec()).ok() - } - _ => None, - }) + let value = HostValue::decode(&bytes).expect("decodes"); + value.get("code")?.as_text().map(str::to_owned) } #[test] diff --git a/packages/stack-guest-abi/src/last_error.rs b/packages/stack-guest-abi/src/last_error.rs index ff8ed8c1d..89db704f4 100644 --- a/packages/stack-guest-abi/src/last_error.rs +++ b/packages/stack-guest-abi/src/last_error.rs @@ -5,7 +5,7 @@ //! the fast path a host acts on, byte-compatible with the vitaminc guest. //! Beside it, the export records the error that produced the number — its //! miette code, message, help, URL, severity, structured fields and causes — -//! as one value in the transport codec every input and output already uses +//! as one value in the transport frame every input and output already uses //! ([`encode`]). A host that wants the detail calls `se_last_error` after a //! non-zero status; a call that succeeds pays nothing. //! @@ -43,10 +43,10 @@ use std::cell::Cell; use std::error::Error; use miette::{Diagnostic, Severity}; -use vitaminc_aead_value::{transport as codec, FfiValue}; use crate::buffers; use crate::status::{STATUS_ENCODING, STATUS_INTERNAL, STATUS_STATE}; +use crate::value::HostValue; thread_local! { /// The registered buffer holding the encoded last error, if any, and @@ -82,7 +82,7 @@ pub const UNDESCRIBED_CAUSE: &str = "an error from another library"; #[non_exhaustive] pub enum GuestError { /// The input failed the export's own validation before any library - /// saw it: bytes that are not the transport codec, a pointer/length + /// saw it: bytes that are not a transport frame, a pointer/length /// pair outside linear memory, a config or option of the wrong shape. #[error("malformed input: {0}")] #[diagnostic(code(stack_guest_abi::malformed_input))] @@ -191,7 +191,7 @@ pub fn encode( error: &dyn Diagnostic, fields: serde_json::Map, describe: &dyn Fn(&(dyn Error + 'static)) -> Option, -) -> FfiValue { +) -> HostValue { let mut entries = Vec::with_capacity(7); if let Some(code) = error.code() { entries.push(("code".to_owned(), text(code.to_string()))); @@ -211,18 +211,13 @@ pub fn encode( entries.push(("severity".to_owned(), text(severity))); entries.push(( "fields".to_owned(), - FfiValue::Object( - fields - .into_iter() - .map(|(key, value)| (key, json_value(value))) - .collect(), - ), + HostValue::from_json(serde_json::Value::Object(fields)), )); entries.push(( "causes".to_owned(), - FfiValue::Array(causes(error, describe)), + HostValue::List(causes(error, describe)), )); - FfiValue::Object(entries) + HostValue::Map(entries) } /// One link of the cause chain. @@ -239,7 +234,7 @@ enum Cause<'a> { fn causes( error: &dyn Diagnostic, describe: &dyn Fn(&(dyn Error + 'static)) -> Option, -) -> Vec { +) -> Vec { let mut out = Vec::new(); let mut next = next_of(error); while let Some(cause) = next { @@ -263,7 +258,7 @@ fn causes( entry.push(("code".to_owned(), text(code))); } entry.push(("message".to_owned(), text(message))); - out.push(FfiValue::Object(entry)); + out.push(HostValue::Map(entry)); next = after; } out @@ -279,35 +274,8 @@ fn next_of(diagnostic: &dyn Diagnostic) -> Option> { } /// A string leaf. -fn text(value: impl Into) -> FfiValue { - FfiValue::String(value.into().into()) -} - -/// A structured field as a transport value. -fn json_value(value: serde_json::Value) -> FfiValue { - match value { - serde_json::Value::Null => FfiValue::Null, - serde_json::Value::Bool(value) => FfiValue::Bool(value), - serde_json::Value::Number(number) => { - if let Some(value) = number.as_u64() { - FfiValue::UInt64(value) - } else if let Some(value) = number.as_i64() { - FfiValue::Int64(value) - } else { - FfiValue::Float64(number.as_f64().unwrap_or(f64::NAN)) - } - } - serde_json::Value::String(value) => text(value), - serde_json::Value::Array(items) => { - FfiValue::Array(items.into_iter().map(json_value).collect()) - } - serde_json::Value::Object(entries) => FfiValue::Object( - entries - .into_iter() - .map(|(key, value)| (key, json_value(value))) - .collect(), - ), - } +fn text(value: impl Into) -> HostValue { + HostValue::text(value) } /// Record `error` as the last error for `status`, with its structured @@ -331,14 +299,14 @@ pub fn record_with( describe: &dyn Fn(&(dyn Error + 'static)) -> Option, status: u32, ) -> u32 { - let mut bytes = Vec::new(); // An error that does not encode (it cannot: every leaf is a string, a - // number or a container) leaves the last error empty rather than half - // written; the status still says what happened. - if codec::encode_value(encode(error, fields, describe), &mut bytes).is_err() { + // number or a container, and every key is distinct) leaves the last + // error empty rather than half written; the status still says what + // happened. + let Ok(bytes) = encode(error, fields, describe).encode() else { clear(); return status; - } + }; store(bytes, status); status } @@ -417,22 +385,16 @@ pub fn take() -> Option> { mod tests { use super::*; - fn decode(bytes: &[u8]) -> FfiValue { - codec::decode_value(&mut codec::Reader::new(bytes)).expect("an encoded error decodes") + fn decode(bytes: &[u8]) -> HostValue { + HostValue::decode(bytes).expect("an encoded error decodes") } - fn get<'a>(value: &'a FfiValue, key: &str) -> Option<&'a FfiValue> { - match value { - FfiValue::Object(entries) => entries.iter().find(|(k, _)| k == key).map(|(_, v)| v), - _ => None, - } + fn get<'a>(value: &'a HostValue, key: &str) -> Option<&'a HostValue> { + value.get(key) } - fn string(value: Option<&FfiValue>) -> Option { - match value? { - FfiValue::String(s) => String::from_utf8(s.risky_ref().to_vec()).ok(), - _ => None, - } + fn string(value: Option<&HostValue>) -> Option { + value?.as_text().map(str::to_owned) } #[derive(Debug, thiserror::Error, Diagnostic)] @@ -473,9 +435,9 @@ mod tests { assert_eq!(string(get(&value, "severity")).as_deref(), Some("error")); assert!(matches!( get(get(&value, "fields").expect("fields"), "count"), - Some(FfiValue::UInt64(2)) + Some(HostValue::UInt(2)) )); - let Some(FfiValue::Array(causes)) = get(&value, "causes") else { + let Some(HostValue::List(causes)) = get(&value, "causes") else { panic!("causes is a list"); }; assert_eq!(causes.len(), 2); @@ -504,7 +466,7 @@ mod tests { struct Wrapper(#[source] Foreign); let _ = record(&Wrapper(Foreign), serde_json::Map::new(), STATUS_INTERNAL); let value = decode(&take().expect("recorded")); - let Some(FfiValue::Array(causes)) = get(&value, "causes") else { + let Some(HostValue::List(causes)) = get(&value, "causes") else { panic!("causes is a list"); }; assert_eq!( @@ -550,7 +512,7 @@ mod tests { ); assert!(matches!( get(get(&value, "fields").expect("fields"), "status"), - Some(FfiValue::UInt64(42)) + Some(HostValue::UInt(42)) )); } diff --git a/packages/stack-guest-abi/src/lib.rs b/packages/stack-guest-abi/src/lib.rs index f635c2855..37a246a52 100644 --- a/packages/stack-guest-abi/src/lib.rs +++ b/packages/stack-guest-abi/src/lib.rs @@ -54,8 +54,8 @@ //! both are tested natively and the guests' leak tests run the real //! lifecycle. //! - [`last_error`] — the full error behind the most recent failed export: -//! its code, message, help, fields and causes, encoded once in the -//! transport codec for `se_last_error`. The status number stays the fast +//! its code, message, help, fields and causes, encoded once as a +//! transport frame for `se_last_error`. The status number stays the fast //! path; this is the detail a host asks for after it. //! - [`status`] — the status table. **One numbering for every guest**: the //! codes below keep their values for good, and a guest that needs more @@ -65,6 +65,8 @@ //! call and gets both response buffers back through the registry. //! - [`headers`] — the `name: value` line format request and response //! headers cross the import in. +//! - [`value`] — [`HostValue`](value::HostValue), a value a guest hands its +//! host, and the transport frame it crosses as. //! //! What is deliberately *not* here: anything that names a crate a guest is //! built over. The ZeroKMS connection over the transport, the token import @@ -102,6 +104,8 @@ pub mod call; pub mod headers; pub mod last_error; pub mod status; +pub mod step; +pub mod value; #[cfg(target_arch = "wasm32")] pub mod abi; diff --git a/packages/stack-guest-abi/src/status.rs b/packages/stack-guest-abi/src/status.rs index a62ba51c3..7e32fdc4d 100644 --- a/packages/stack-guest-abi/src/status.rs +++ b/packages/stack-guest-abi/src/status.rs @@ -15,8 +15,8 @@ //! run this call against. Codes 5–10 are the outcomes of a request to //! ZeroKMS, so a host can distinguish a refused credential from a tampered //! ciphertext without parsing strings; 11 and 12 were appended by the -//! crypto guest, 13–27 by the credential guest, and 28 by the crypto guest -//! again. +//! crypto guest, 13–27 by the credential guest, and 28 and 29 by the +//! crypto guest again. 29 is not a failure: see [`STATUS_NEEDS_IO`]. //! //! Each code is documented here as the *verdict* it carries to a host — the //! thing the host can act on. Which of a library's errors reach which code, @@ -122,10 +122,16 @@ pub const STATUS_AUTH_REFRESH_REQUIRED: u32 = 27; /// and only that — never a verdict on the record's integrity. pub const STATUS_CONTEXT_MISMATCH: u32 = 28; +/// Not a failure: the operation is paused, waiting for the host to perform +/// HTTP requests on its behalf (the step loop, [`crate::step`]). The host +/// takes the requests and the operation's handle from the guest, performs +/// them, and resumes it with the responses. No error is recorded. +pub const STATUS_NEEDS_IO: u32 = 29; + /// The last code in the table. A guest appending a code of its own starts /// at `LAST_STATUS + 1` and moves this constant with it, so two guests can /// never claim one number. -pub const LAST_STATUS: u32 = STATUS_CONTEXT_MISMATCH; +pub const LAST_STATUS: u32 = STATUS_NEEDS_IO; #[cfg(test)] mod tests { @@ -164,6 +170,7 @@ mod tests { STATUS_AUTH_OTHER, STATUS_AUTH_REFRESH_REQUIRED, STATUS_CONTEXT_MISMATCH, + STATUS_NEEDS_IO, ]; for (i, code) in codes.iter().enumerate() { assert_eq!(*code, i as u32 + 1, "code {i} is out of sequence"); diff --git a/packages/stack-guest-abi/src/step.rs b/packages/stack-guest-abi/src/step.rs new file mode 100644 index 000000000..e99047dbc --- /dev/null +++ b/packages/stack-guest-abi/src/step.rs @@ -0,0 +1,659 @@ +//! The step loop: how a guest export that needs the network returns to its +//! host instead of blocking on it. +//! +//! An export that may reach ZeroKMS runs its work as a future, polled once +//! ([`start`]). Where the work sends an HTTP request ([`request`]), the +//! request is recorded and the future stays pending. The export then ends: +//! the future is kept in a table under a handle, and the host is handed the +//! handle and the requests it recorded ([`Step::NeedsIo`]). The host performs +//! them however it likes (a goroutine, `fetch`) and hands the responses back +//! ([`resume`]), in the order of the requests. The future is polled again, +//! and the loop repeats until it is done ([`Step::Done`]) or fails. A host +//! that gives up drops the operation ([`abort`]). +//! +//! The guest is never running while a request is in flight, so a host's +//! cancellation never interrupts it: an aborted operation is a future +//! dropped between two polls, and everything it held is wiped on drop. +//! +//! # Handles +//! +//! - A handle names one paused operation. It is issued when an operation +//! first pauses, never before, so an export that completes in one poll +//! costs no handle. +//! - Handles are issued in increasing order and never reused, so a stale +//! [`resume`] can never reach another operation: it is an unknown handle. +//! They are 64-bit so a long-lived instance never runs out: at a million +//! pauses a second, that takes over half a million years. +//! - At most [`MAX_OPEN`] operations may be paused at once. One more is +//! refused, and dropped, so a host that forgets to abort cannot grow the +//! table without bound. The cap guards against a faulty host; a host +//! with more concurrent callers than that bounds itself to it, so they +//! wait rather than fail (the Go client does, in `Client.drive`). +//! - An unknown, finished or aborted handle is `STATUS_STATE`. It never +//! panics. +//! +//! # Wakers +//! +//! The work may run requests through combinators that poll an inner future +//! again only once its waker has been woken (`FuturesOrdered`, `buffered`). +//! So each request stores the waker it was polled with, and [`resume`] wakes +//! it when its response arrives, before polling the operation again. The +//! operation itself is polled with a waker that does nothing: the loop polls +//! it on every step regardless. +//! +//! This module holds no encoding: the guest decides how a step's requests +//! and the host's responses cross the boundary. + +use std::cell::{Cell, RefCell}; +use std::collections::BTreeMap; +use std::future::Future; +use std::pin::Pin; +use std::rc::Rc; +use std::task::{Context, Poll, Waker}; + +use vitaminc_protected::OpaqueDebug; +use zeroize::Zeroizing; + +use crate::buffers; +use crate::last_error; + +/// An operation's work: what an export would have run with `block_on`, +/// owning its inputs, with the export's output or status as its result. +pub type Operation = Pin, u32>>>>; + +/// The most operations that may be paused at once. +pub const MAX_OPEN: usize = 64; + +/// One HTTP request an operation needs the host to perform. +/// +/// The headers (in the [`crate::headers`] line format, a bearer token +/// among them) and the body (which can carry key-material contexts) are +/// wiped on drop. +#[derive(OpaqueDebug)] +#[non_exhaustive] +pub struct Request { + /// The HTTP method. + #[non_sensitive] + pub method: &'static str, + /// The URL. + #[non_sensitive] + pub url: String, + /// The request headers. + pub headers: Zeroizing>, + /// The request body. + pub body: Zeroizing>, +} + +impl Request { + /// A request. + pub fn new( + method: &'static str, + url: String, + headers: Zeroizing>, + body: Zeroizing>, + ) -> Self { + Self { + method, + url, + headers, + body, + } + } +} + +/// The host's answer to one [`Request`]. +/// +/// `Debug` shows the status alone: the body can carry wrapped key material +/// or a credential. +#[derive(OpaqueDebug)] +#[non_exhaustive] +pub struct Response { + /// The HTTP status code, or negative for a transport-level failure — + /// then `body` is the host's error text. + #[non_sensitive] + pub status: i32, + /// The response headers, in the [`crate::headers`] line format. + pub headers: Vec, + /// The response body. Wiped on drop. + pub body: Zeroizing>, +} + +impl Response { + /// A response. + pub fn new(status: i32, headers: Vec, body: Zeroizing>) -> Self { + Self { + status, + headers, + body, + } + } +} + +/// What a step of an operation came to, when it did not fail. +#[derive(Debug)] +pub enum Step { + /// The operation finished, with this output. + Done(Vec), + /// The operation is paused under `handle`, waiting for the host to + /// perform `requests` and [`resume`] it with their responses, in order. + NeedsIo { + /// The paused operation. + handle: u64, + /// What it waits on. + requests: Vec, + }, +} + +/// A request made outside a step: the work was polled by something other +/// than [`start`] or [`resume`], so no host can be asked to perform it. +#[derive(Debug, thiserror::Error)] +#[error("an HTTP request was made outside a guest step")] +pub struct NotInStep; + +/// One request of a paused operation, from the moment the work makes it to +/// the moment it reads the response. +#[derive(Default)] +struct Exchange { + /// The request, until the step that made it hands it to the host. + request: Option, + /// The response, from [`resume`] until the work reads it. + response: Option, + /// The waker the request was last polled with. + waker: Option, +} + +/// The requests of one operation. +#[derive(Default)] +struct Io { + exchanges: RefCell>, +} + +/// A paused operation. +struct Open { + work: Operation, + io: Rc, + /// The exchanges whose requests the host was handed at the last step, + /// in the order it was handed them: where [`resume`]'s responses go. + awaiting: Vec, +} + +thread_local! { + /// The requests of the operation being polled, so [`request`] can record + /// into them without the work knowing which operation it belongs to. + static CURRENT: RefCell>> = const { RefCell::new(None) }; + static OPEN: RefCell> = const { RefCell::new(BTreeMap::new()) }; + /// The next handle to issue. Zero is never issued. + static NEXT: Cell = const { Cell::new(1) }; + /// A step's requests, encoded and registered for the host to take + /// ([`take_pending`]). + static PENDING: Cell> = const { Cell::new(None) }; +} + +/// Send `request` through the host: record it for the step being polled, +/// and resolve to the host's response once [`resume`] delivers it. +/// +/// The request is recorded on the first poll, which must happen inside a +/// step ([`start`] or [`resume`]); otherwise it resolves to [`NotInStep`]. +pub fn request(request: Request) -> impl Future> { + HostRequest::Unsent(Some(request)) +} + +enum HostRequest { + Unsent(Option), + Sent { io: Rc, index: usize }, + Finished, +} + +impl Future for HostRequest { + type Output = Result; + + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + let this = self.get_mut(); + match this { + HostRequest::Unsent(request) => { + let Some(io) = CURRENT.with(|current| current.borrow().clone()) else { + *this = HostRequest::Finished; + return Poll::Ready(Err(NotInStep)); + }; + let index = { + let mut exchanges = io.exchanges.borrow_mut(); + exchanges.push(Exchange { + request: request.take(), + response: None, + waker: Some(cx.waker().clone()), + }); + exchanges.len() - 1 + }; + *this = HostRequest::Sent { io, index }; + Poll::Pending + } + HostRequest::Sent { io, index } => { + let response = { + let mut exchanges = io.exchanges.borrow_mut(); + let exchange = &mut exchanges[*index]; + let response = exchange.response.take(); + if response.is_none() { + exchange.waker = Some(cx.waker().clone()); + } + response + }; + match response { + Some(response) => { + *this = HostRequest::Finished; + Poll::Ready(Ok(response)) + } + None => Poll::Pending, + } + } + HostRequest::Finished => Poll::Ready(Err(NotInStep)), + } + } +} + +/// Run an operation's first step. +/// +/// # Errors +/// +/// The operation's own failure, or `STATUS_STATE` when [`MAX_OPEN`] +/// operations are already paused (the operation is dropped), or +/// `STATUS_INTERNAL` when it paused without asking for anything. +pub fn start(work: Operation) -> Result { + clear_pending(); + step(None, work, Rc::default()) +} + +/// Hand a paused operation the responses to the requests its last step +/// asked for, in that order, and run its next step. +/// +/// The handle is spent whatever the outcome: a paused operation comes back +/// under a new [`Step::NeedsIo`] with the same handle. +/// +/// # Errors +/// +/// `STATUS_STATE` for an unknown handle; `STATUS_ENCODING` when the number +/// of responses is not the number of requests (the operation is dropped); +/// otherwise as [`start`]. +pub fn resume(handle: u64, responses: Vec) -> Result { + clear_pending(); + let Some(open) = OPEN.with(|open| open.borrow_mut().remove(&handle)) else { + return Err(unknown_handle()); + }; + if responses.len() != open.awaiting.len() { + drop(open); + return Err(last_error::malformed( + "the number of responses is not the number of requests", + )); + } + { + let mut exchanges = open.io.exchanges.borrow_mut(); + for (index, response) in open.awaiting.iter().zip(responses) { + let exchange = &mut exchanges[*index]; + exchange.response = Some(response); + if let Some(waker) = exchange.waker.take() { + waker.wake(); + } + } + } + step(Some(handle), open.work, open.io) +} + +/// Drop a paused operation, wiping everything it held. +/// +/// # Errors +/// +/// `STATUS_STATE` for an unknown handle. +pub fn abort(handle: u64) -> Result<(), u32> { + match OPEN.with(|open| open.borrow_mut().remove(&handle)) { + Some(open) => { + drop(open); + Ok(()) + } + None => Err(unknown_handle()), + } +} + +/// Drop every paused operation: what a guest's shutdown does before it +/// drops the state they share. +pub fn drop_all() { + let open = OPEN.with(|open| core::mem::take(&mut *open.borrow_mut())); + drop(open); + clear_pending(); +} + +/// How many operations are paused. +pub fn open_count() -> usize { + OPEN.with(|open| open.borrow().len()) +} + +/// Poll `work` once, as operation `handle` if it has one, and say what came +/// of it. +fn step(handle: Option, mut work: Operation, io: Rc) -> Result { + let previous = CURRENT.with(|current| current.replace(Some(io.clone()))); + let polled = work.as_mut().poll(&mut Context::from_waker(Waker::noop())); + CURRENT.with(|current| *current.borrow_mut() = previous); + if let Poll::Ready(result) = polled { + return result.map(Step::Done); + } + // Every request made since the last step, in the order made. + let (awaiting, requests): (Vec, Vec) = { + let mut exchanges = io.exchanges.borrow_mut(); + exchanges + .iter_mut() + .enumerate() + .filter_map(|(index, exchange)| exchange.request.take().map(|r| (index, r))) + .unzip() + }; + if requests.is_empty() { + // Nothing to wait for, so nothing would ever wake it. + drop(work); + return Err(last_error::internal( + "an operation paused without asking the host for anything", + )); + } + let handle = match handle { + Some(handle) => handle, + None => { + if open_count() >= MAX_OPEN { + drop(work); + return Err(last_error::out_of_order( + "too many operations are paused: resume or abort one first", + )); + } + issue()? + } + }; + OPEN.with(|open| { + let _ = open + .borrow_mut() + .insert(handle, Open { work, io, awaiting }); + }); + Ok(Step::NeedsIo { handle, requests }) +} + +/// The next handle. +fn issue() -> Result { + NEXT.with(|next| { + let handle = next.get(); + let following = handle + .checked_add(1) + .ok_or_else(|| last_error::out_of_order("this instance has issued every handle"))?; + next.set(following); + Ok(handle) + }) +} + +fn unknown_handle() -> u32 { + last_error::out_of_order("no paused operation has this handle") +} + +/// Register a step's encoded requests for the host to take with +/// [`take_pending`], replacing (and wiping) any it did not take. +pub fn set_pending(bytes: Vec) { + clear_pending(); + let len = bytes.len(); + let ptr = buffers::register(bytes); + PENDING.with(|pending| pending.set(Some((ptr, len)))); +} + +/// Hand the registered requests over, emptying the slot: what the guest's +/// export returns to the host, which releases the buffer with `se_dealloc`. +pub fn take_pending() -> Option<(*mut u8, usize)> { + PENDING.with(Cell::take) +} + +/// Wipe and free registered requests the host never took. +fn clear_pending() { + if let Some((ptr, len)) = PENDING.with(Cell::take) { + // SAFETY: the pair is the one `buffers::register` returned in + // `set_pending`, and nothing else holds it: the host is only given + // it by `take_pending`, which empties the slot first. + unsafe { buffers::dealloc(ptr, len) }; + } +} + +/// Drop the slot without freeing, for a registry wipe about to free it. +pub(crate) fn forget_pending() { + PENDING.with(|pending| pending.set(None)); +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::status::{STATUS_ENCODING, STATUS_INTERNAL, STATUS_STATE}; + + fn get(url: &str) -> Request { + Request::new( + "POST", + url.to_owned(), + Zeroizing::new(b"authorization: Bearer t\n".to_vec()), + Zeroizing::new(b"{}".to_vec()), + ) + } + + fn ok(body: &[u8]) -> Response { + Response::new(200, Vec::new(), Zeroizing::new(body.to_vec())) + } + + /// Starts a test from an empty table and slot, and leaves them empty: + /// a recorded error or a paused operation is a registered buffer, which + /// Miri reports as leaked if a test ends holding one. + #[must_use] + struct Reset; + + impl Drop for Reset { + fn drop(&mut self) { + drop_all(); + last_error::clear(); + } + } + + fn reset() -> Reset { + drop_all(); + last_error::clear(); + Reset + } + + /// Work that makes `n` requests one after another and outputs their + /// bodies joined. + fn sequential(n: usize) -> Operation { + Box::pin(async move { + let mut out = Vec::new(); + for i in 0..n { + let response = request(get(&format!("https://kms/{i}"))) + .await + .map_err(|_| STATUS_INTERNAL)?; + out.extend_from_slice(&response.body); + } + Ok(out) + }) + } + + fn needs_io(step: Result) -> (u64, Vec) { + match step { + Ok(Step::NeedsIo { handle, requests }) => (handle, requests), + other => panic!("expected NeedsIo, got {other:?}"), + } + } + + #[test] + fn work_that_needs_no_request_is_done_without_a_handle() { + let _reset = reset(); + let step = start(Box::pin(async { Ok(b"out".to_vec()) })).unwrap(); + assert!(matches!(step, Step::Done(out) if out == b"out")); + assert_eq!(open_count(), 0); + } + + #[test] + fn a_failure_is_the_status_and_holds_no_handle() { + let _reset = reset(); + assert_eq!( + start(Box::pin(async { Err(STATUS_ENCODING) })).unwrap_err(), + STATUS_ENCODING + ); + assert_eq!(open_count(), 0); + } + + #[test] + fn each_request_is_one_step_and_the_responses_reach_the_work() { + let _reset = reset(); + let (handle, requests) = needs_io(start(sequential(2))); + assert_eq!(requests.len(), 1); + assert_eq!(requests[0].url, "https://kms/0"); + let (again, requests) = needs_io(resume(handle, vec![ok(b"a")])); + assert_eq!(again, handle, "a paused operation keeps its handle"); + assert_eq!(requests[0].url, "https://kms/1"); + let done = resume(handle, vec![ok(b"b")]).unwrap(); + assert!(matches!(done, Step::Done(out) if out == b"ab")); + assert_eq!(open_count(), 0); + assert_eq!( + resume(handle, vec![]).unwrap_err(), + STATUS_STATE, + "a finished handle is spent" + ); + } + + /// `buffered` polls an inner future again only once it is woken: the + /// stored waker is what keeps the operation from stalling after a + /// response. + #[test] + fn a_combinator_that_waits_on_its_wakers_is_woken() { + use futures::stream::{self, StreamExt}; + let _reset = reset(); + let work: Operation = Box::pin(async { + let bodies: Vec<_> = stream::iter(0..3) + .map(|i| request(get(&format!("https://kms/{i}")))) + .buffered(1) + .collect() + .await; + let mut out = Vec::new(); + for body in bodies { + out.extend_from_slice(&body.map_err(|_| STATUS_INTERNAL)?.body); + } + Ok(out) + }); + let (handle, _) = needs_io(start(work)); + needs_io(resume(handle, vec![ok(b"x")])); + needs_io(resume(handle, vec![ok(b"y")])); + let done = resume(handle, vec![ok(b"z")]).unwrap(); + assert!(matches!(done, Step::Done(out) if out == b"xyz")); + } + + #[test] + fn several_requests_in_one_step_take_their_responses_in_order() { + use futures::future::join; + let _reset = reset(); + let work: Operation = Box::pin(async { + let (a, b) = join(request(get("https://kms/a")), request(get("https://kms/b"))).await; + let mut out = a.map_err(|_| STATUS_INTERNAL)?.body.to_vec(); + out.extend_from_slice(&b.map_err(|_| STATUS_INTERNAL)?.body); + Ok(out) + }); + let (handle, requests) = needs_io(start(work)); + let urls: Vec<_> = requests.iter().map(|r| r.url.as_str()).collect(); + assert_eq!(urls, ["https://kms/a", "https://kms/b"]); + let done = resume(handle, vec![ok(b"1"), ok(b"2")]).unwrap(); + assert!(matches!(done, Step::Done(out) if out == b"12")); + } + + #[test] + fn handles_interleave_and_are_never_reused() { + let _reset = reset(); + let (first, _) = needs_io(start(sequential(1))); + let (second, _) = needs_io(start(sequential(1))); + assert!(second > first); + let done = resume(second, vec![ok(b"2")]).unwrap(); + assert!(matches!(done, Step::Done(out) if out == b"2")); + let done = resume(first, vec![ok(b"1")]).unwrap(); + assert!(matches!(done, Step::Done(out) if out == b"1")); + let (third, _) = needs_io(start(sequential(1))); + assert!(third > second, "a spent handle is not issued again"); + abort(third).unwrap(); + } + + #[test] + fn an_aborted_operation_is_dropped_and_its_handle_spent() { + let _reset = reset(); + let dropped = Rc::new(Cell::new(false)); + struct Flag(Rc>); + impl Drop for Flag { + fn drop(&mut self) { + self.0.set(true); + } + } + let flag = Flag(dropped.clone()); + let (handle, _) = needs_io(start(Box::pin(async move { + let _flag = flag; + request(get("https://kms")) + .await + .map_err(|_| STATUS_INTERNAL)?; + Ok(Vec::new()) + }))); + assert!(!dropped.get()); + abort(handle).unwrap(); + assert!(dropped.get(), "aborting drops the work"); + assert_eq!(abort(handle).unwrap_err(), STATUS_STATE); + assert_eq!(resume(handle, vec![ok(b"")]).unwrap_err(), STATUS_STATE); + } + + #[test] + fn the_wrong_number_of_responses_is_refused_and_drops_the_operation() { + let _reset = reset(); + let (handle, _) = needs_io(start(sequential(1))); + assert_eq!(resume(handle, vec![]).unwrap_err(), STATUS_ENCODING); + assert_eq!(open_count(), 0); + } + + #[test] + fn no_more_than_max_open_operations_pause() { + let _reset = reset(); + for _ in 0..MAX_OPEN { + needs_io(start(sequential(1))); + } + assert_eq!(start(sequential(1)).unwrap_err(), STATUS_STATE); + assert_eq!(open_count(), MAX_OPEN); + // A step that completes needs no handle, so it still runs. + assert!(matches!( + start(Box::pin(async { Ok(Vec::new()) })), + Ok(Step::Done(_)) + )); + drop_all(); + assert_eq!(open_count(), 0); + } + + #[test] + fn work_that_pauses_without_a_request_is_an_internal_failure() { + let _reset = reset(); + let work: Operation = Box::pin(futures::future::pending()); + assert_eq!(start(work).unwrap_err(), STATUS_INTERNAL); + assert_eq!(open_count(), 0); + } + + #[test] + fn a_request_outside_a_step_says_so() { + let mut work = Box::pin(request(get("https://kms"))); + let polled = work.as_mut().poll(&mut Context::from_waker(Waker::noop())); + assert!(matches!(polled, Poll::Ready(Err(NotInStep)))); + } + + /// A registry wipe frees the step's buffer with every other, so the slot + /// must not go on naming it. + #[test] + fn a_registry_wipe_empties_the_slot() { + let _reset = reset(); + set_pending(b"step".to_vec()); + buffers::wipe_all(); + assert!(take_pending().is_none()); + } + + #[test] + fn pending_requests_are_handed_over_once_and_replaced_wiped() { + let _reset = reset(); + set_pending(b"one".to_vec()); + set_pending(b"two".to_vec()); + let (ptr, len) = take_pending().unwrap(); + // SAFETY: registered above and handed over once. + let bytes = unsafe { buffers::take(ptr, len) }.unwrap(); + assert_eq!(bytes, b"two"); + assert!(take_pending().is_none()); + } +} diff --git a/packages/stack-guest-abi/src/value.rs b/packages/stack-guest-abi/src/value.rs new file mode 100644 index 000000000..a350c3cde --- /dev/null +++ b/packages/stack-guest-abi/src/value.rs @@ -0,0 +1,393 @@ +//! [`HostValue`]: a value a guest hands its host, and how it crosses the +//! boundary. +//! +//! Every structured output a guest returns (a list of workspace ids, the +//! fields of a token, the last error) crosses as one transport frame, the +//! encoding vitaminc's `Frame` and `FrameWriter` define and the Go module +//! reads with `vcffi`. A `HostValue` describes itself to vitaminc's +//! [`Encrypt`] model, so [`encode`](HostValue::encode) is vitaminc's own +//! frame writer, and [`decode`](HostValue::decode) reads a frame back +//! through a [`Sink`], for the tests that check what a host is given. + +use vitaminc_aead::plaintext::{ + visit_map, visit_seq, Encrypt, Float, Logical, MapSink, Physical, SeqSink, Sink, SourceError, +}; +use vitaminc_aead_frame::{to_frame, Frame, FrameError, FrameWriteError}; +use vitaminc_protected::{Controlled, Protected}; +use zeroize::Zeroizing; + +/// A value a guest hands its host: a scalar, a list or a map with string +/// keys. +/// +/// Integers are 64-bit, unsigned where the value cannot be negative, so the +/// host reads one integer type per field. Bytes are held in [`Protected`], +/// as a client key is, and wiped when the value drops. +pub enum HostValue { + /// No value. + Null, + /// A boolean. + Bool(bool), + /// An unsigned integer. + UInt(u64), + /// A signed integer. + Int(i64), + /// A float. + Float(f64), + /// Text, wiped when dropped: a guest hands secrets back as text (an + /// access token), and the guest heap is not cleared when it frees. + Text(Zeroizing), + /// Bytes. + Bytes(Protected>), + /// A list. + List(Vec), + /// A map, in the order its entries were given. + Map(Vec<(String, HostValue)>), +} + +impl HostValue { + /// Text, from anything that converts to a `String`. + pub fn text(value: impl Into) -> Self { + Self::Text(Zeroizing::new(value.into())) + } + + /// A structured field as a host value: a JSON number becomes an + /// unsigned integer if it is one, then a signed integer, then a float. + pub fn from_json(value: serde_json::Value) -> Self { + match value { + serde_json::Value::Null => Self::Null, + serde_json::Value::Bool(value) => Self::Bool(value), + serde_json::Value::Number(number) => { + if let Some(value) = number.as_u64() { + Self::UInt(value) + } else if let Some(value) = number.as_i64() { + Self::Int(value) + } else { + Self::Float(number.as_f64().unwrap_or(f64::NAN)) + } + } + serde_json::Value::String(value) => Self::Text(Zeroizing::new(value)), + serde_json::Value::Array(items) => { + Self::List(items.into_iter().map(Self::from_json).collect()) + } + serde_json::Value::Object(entries) => Self::Map( + entries + .into_iter() + .map(|(key, value)| (key, Self::from_json(value))) + .collect(), + ), + } + } + + /// This value as a transport frame. + /// + /// The frame is returned bare, as every guest output is: it becomes a + /// registered buffer, which the registry wipes when the host releases + /// it. Its capacity is its length: registering a `Vec` with spare + /// capacity reallocates it (`into_boxed_slice`), and the allocation left + /// behind is not wiped. So the frame is copied into an exactly sized + /// buffer, and the writer's own buffer is wiped when it drops. + /// + /// # Errors + /// + /// [`FrameWriteError`] for a map with a repeated key or a value nested + /// deeper than a frame carries. A guest builds its outputs itself, so + /// either is a bug in the guest. + pub fn encode(&self) -> Result, FrameWriteError> { + let frame = to_frame(self)?; + let mut out = Vec::with_capacity(frame.risky_ref().len()); + out.extend_from_slice(frame.risky_ref()); + Ok(out) + } + + /// Read one value from a transport frame. + /// + /// # Errors + /// + /// [`DecodeError`] when the bytes are not exactly one frame, or the + /// frame holds a scalar a `HostValue` does not (a 32-bit float, a date). + pub fn decode(bytes: &[u8]) -> Result { + let frame = Frame::parse(bytes).map_err(DecodeError::Frame)?; + frame.visit(ValueSink(Root)) + } + + /// The entry under `key`, if this is a map that has one. + pub fn get(&self, key: &str) -> Option<&HostValue> { + match self { + Self::Map(entries) => entries.iter().find(|(k, _)| k == key).map(|(_, v)| v), + _ => None, + } + } + + /// The text, if this is text. + pub fn as_text(&self) -> Option<&str> { + match self { + Self::Text(text) => Some(text.as_str()), + _ => None, + } + } +} + +/// Why [`HostValue::decode`] refused its bytes. +#[derive(Debug, thiserror::Error)] +pub enum DecodeError { + /// The bytes are not exactly one well-formed frame. + #[error(transparent)] + Frame(FrameError), + /// The frame holds a scalar no `HostValue` holds. + #[error("the frame holds a scalar a host value does not")] + Scalar, + /// The frame's source failed (it cannot: a parsed frame is complete). + #[error("the frame could not be read")] + Source, +} + +impl vitaminc_aead::plaintext::Error for DecodeError { + fn source(_: SourceError) -> Self { + Self::Source + } +} + +/// Walks the value, leaving it where it is. +impl Encrypt for &HostValue { + fn visit(self, sink: S) -> Result { + match self { + HostValue::Null => sink.scalar(None, Physical::Null), + HostValue::Bool(b) => sink.scalar(None, Physical::Bool(*b)), + HostValue::UInt(u) => sink.scalar(None, Physical::Int((*u).into())), + HostValue::Int(i) => sink.scalar(None, Physical::Int((*i).into())), + HostValue::Float(f) => sink.scalar(None, Physical::Float(Float::F64(*f))), + HostValue::Text(text) => sink.scalar(None, Physical::Text(text.as_str())), + HostValue::Bytes(bytes) => sink.scalar(None, Physical::Bytes(bytes.risky_ref())), + HostValue::List(items) => visit_seq(sink, Some(items.len()), items), + HostValue::Map(entries) => visit_map( + sink, + Some(entries.len()), + entries.iter().map(|(key, value)| (key.as_str(), value)), + ), + } + } +} + +/// Where a finished value goes: back to the caller, or into its parent. +trait Put { + type Ok; + fn put(self, value: HostValue) -> Self::Ok; +} + +struct Root; + +impl Put for Root { + type Ok = HostValue; + fn put(self, value: HostValue) -> HostValue { + value + } +} + +struct Element<'s>(&'s mut Vec); + +impl Put for Element<'_> { + type Ok = (); + fn put(self, value: HostValue) { + self.0.push(value); + } +} + +struct Entry<'s>(&'s mut Vec<(String, HostValue)>, String); + +impl Put for Entry<'_> { + type Ok = (); + fn put(self, value: HostValue) { + self.0.push((self.1, value)); + } +} + +/// Builds the value a frame describes. +struct ValueSink(O); + +impl Sink for ValueSink { + type Ok = O::Ok; + type Error = DecodeError; + type Seq = ValueSeq; + type Map = ValueMap; + + fn scalar(self, ty: Option, value: Physical<'_>) -> Result { + let value = match (ty, value) { + (None, Physical::Null) => HostValue::Null, + (None, Physical::Bool(b)) => HostValue::Bool(b), + (None, Physical::Int(int)) => { + if let Some(u) = int.to_u128().and_then(|u| u64::try_from(u).ok()) { + HostValue::UInt(u) + } else if let Some(i) = int.to_i128().and_then(|i| i64::try_from(i).ok()) { + HostValue::Int(i) + } else { + return Err(DecodeError::Scalar); + } + } + (None, Physical::Float(Float::F64(f))) => HostValue::Float(f), + (None, Physical::Text(text)) => HostValue::Text(Zeroizing::new(text.to_owned())), + (None, Physical::Bytes(bytes)) => HostValue::Bytes(Protected::new(bytes.to_vec())), + _ => return Err(DecodeError::Scalar), + }; + Ok(self.0.put(value)) + } + + fn seq(self, _: Option) -> Result, DecodeError> { + Ok(ValueSeq { + out: self.0, + items: Vec::new(), + }) + } + + fn map(self, _: Option) -> Result, DecodeError> { + Ok(ValueMap { + out: self.0, + entries: Vec::new(), + }) + } + + /// A guest never hands its host a passthrough. + fn passthrough(self, _: P) -> Result { + Err(DecodeError::Scalar) + } +} + +struct ValueSeq { + out: O, + items: Vec, +} + +impl SeqSink for ValueSeq { + type Ok = O::Ok; + type Error = DecodeError; + type Element<'s> + = ValueSink> + where + Self: 's; + + fn element(&mut self) -> Result>, DecodeError> { + Ok(ValueSink(Element(&mut self.items))) + } + + fn end(self) -> Result { + Ok(self.out.put(HostValue::List(self.items))) + } +} + +struct ValueMap { + out: O, + entries: Vec<(String, HostValue)>, +} + +impl MapSink for ValueMap { + type Ok = O::Ok; + type Error = DecodeError; + type Entry<'s> + = ValueSink> + where + Self: 's; + + fn entry(&mut self, key: &str) -> Result>, DecodeError> { + Ok(ValueSink(Entry(&mut self.entries, key.to_owned()))) + } + + fn end(self) -> Result { + Ok(self.out.put(HostValue::Map(self.entries))) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + /// An encoded frame has no spare capacity, so registering it does not + /// reallocate and leave an unwiped copy behind. + #[test] + fn an_encoded_frame_has_no_spare_capacity() { + let out = HostValue::Map(vec![( + "access_token".to_string(), + HostValue::text("a-bearer-token"), + )]) + .encode() + .unwrap(); + assert_eq!(out.capacity(), out.len()); + } + + /// Text is held as `Zeroizing`, so a secret a guest hands back + /// as text (the auth guest's access token) is wiped when the value is + /// dropped, by every path that builds one: the constructor, JSON and a + /// decoded frame. A plain `String` here would leave it in freed guest + /// memory. + #[test] + fn text_is_wiped_on_drop() { + fn held(value: HostValue) -> Zeroizing { + match value { + HostValue::Text(text) => text, + _ => panic!("not text"), + } + } + assert_eq!(held(HostValue::text("token")).as_str(), "token"); + assert_eq!( + held(HostValue::from_json(serde_json::json!("token"))).as_str(), + "token" + ); + let frame = HostValue::text("token").encode().unwrap(); + assert_eq!(held(HostValue::decode(&frame).unwrap()).as_str(), "token"); + } + + #[test] + fn a_value_reads_back_as_it_was_written() { + let value = HostValue::Map(vec![ + ("null".into(), HostValue::Null), + ("yes".into(), HostValue::Bool(true)), + ("big".into(), HostValue::UInt(u64::MAX)), + ("negative".into(), HostValue::Int(-2)), + ("half".into(), HostValue::Float(0.5)), + ("name".into(), HostValue::text("alice")), + ("key".into(), HostValue::Bytes(Protected::new(vec![1, 2]))), + ( + "ids".into(), + HostValue::List(vec![HostValue::text("a"), HostValue::List(vec![])]), + ), + ]); + let bytes = value.encode().expect("encodes"); + let back = HostValue::decode(&bytes).expect("decodes"); + assert!(matches!(back.get("null"), Some(HostValue::Null))); + assert!(matches!(back.get("yes"), Some(HostValue::Bool(true)))); + assert!(matches!(back.get("big"), Some(HostValue::UInt(u64::MAX)))); + assert!(matches!(back.get("negative"), Some(HostValue::Int(-2)))); + assert!(matches!(back.get("half"), Some(HostValue::Float(f)) if *f == 0.5)); + assert_eq!(back.get("name").and_then(HostValue::as_text), Some("alice")); + assert!(matches!(back.get("key"), Some(HostValue::Bytes(b)) if b.risky_ref() == &[1, 2])); + assert!(matches!(back.get("ids"), Some(HostValue::List(items)) if items.len() == 2)); + } + + #[test] + fn a_map_with_a_repeated_key_does_not_encode() { + let value = HostValue::Map(vec![ + ("a".into(), HostValue::Null), + ("a".into(), HostValue::Null), + ]); + assert!(value.encode().is_err()); + } + + #[test] + fn bytes_that_are_not_one_frame_do_not_decode() { + assert!(matches!(HostValue::decode(&[]), Err(DecodeError::Frame(_)))); + } + + #[test] + fn json_numbers_keep_their_integer_type() { + assert!(matches!( + HostValue::from_json(serde_json::json!(2)), + HostValue::UInt(2) + )); + assert!(matches!( + HostValue::from_json(serde_json::json!(-2)), + HostValue::Int(-2) + )); + assert!(matches!( + HostValue::from_json(serde_json::json!(0.5)), + HostValue::Float(f) if f == 0.5 + )); + } +} diff --git a/packages/stack-kms/fuzz/Cargo.lock b/packages/stack-kms/fuzz/Cargo.lock index a18c2eba9..c7e4cc7fd 100644 --- a/packages/stack-kms/fuzz/Cargo.lock +++ b/packages/stack-kms/fuzz/Cargo.lock @@ -304,9 +304,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "chacha20" -version = "0.10.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" +checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" dependencies = [ "cfg-if", "cpufeatures 0.3.0",